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/.cvsignore3
-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/.cvsignore2
-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/.cvsignore1
-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.xml121
-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/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/.cvsignore1
-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.xml38
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore3
-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.core/.classpath13
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/build.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml264
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel399
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecore481
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecoredi9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/persistence.ecoredi257
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.properties39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.xml232
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd122
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ContextModel.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java330
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java318
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java349
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModel.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/TextRange.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractColumn.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractJoinColumn.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJpaContent.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractColumn.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractJoinColumn.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractColumn.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractJoinColumn.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJpaContextNode.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitDefaults.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceJpaContextNode.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java466
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractResourceModel.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaFile.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java550
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java679
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java551
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleSchedulingRule.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericJpaContent.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/RelationshipMappingTools.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaColumn.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java451
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java189
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java427
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java437
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java252
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java350
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java376
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java1805
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java440
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java755
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java497
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java316
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java334
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmColumn.java308
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJpaContextNode.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java297
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java284
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java287
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java744
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java339
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java316
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java330
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java1565
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java347
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java632
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java366
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java819
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java284
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java306
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceJpaContextNode.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java1191
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/ComponentUtilities.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeSearchUtil.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodes.java726
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java420
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationStringArrayExpressionConverter.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanExpressionConverter.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java490
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DefaultAnnotationEditFormatter.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java359
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/GenericVisitor.java795
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JPTTools.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java476
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java455
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java331
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NodeFinder.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullAnnotationEditFormatter.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberIntegerExpressionConverter.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java326
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java606
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java278
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractAnnotationResource.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractColumnImpl.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java526
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractMemberResource.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java283
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResource.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractTableResource.java330
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java285
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourceModel.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java409
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java492
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java389
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitResource.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractColumn.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractTable.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverride.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java322
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java465
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmptyTagBooleanTranslator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResourceModel.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AbstractColumnAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrides.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrides.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Basic.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValue.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Embedded.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedId.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Enumerated.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Id.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClass.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Inheritance.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumns.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Lob.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToMany.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOne.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKey.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueries.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueries.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToMany.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOne.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderBy.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumns.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTables.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Temporal.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Transient.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraint.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Version.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java518
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java421
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java273
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java526
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java608
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java462
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java799
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java289
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/IdClass.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmArtifactEdit.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java1047
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java13447
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceModel.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java317
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/UniqueConstraint.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java292
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java619
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java369
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java1925
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java1079
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java261
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java596
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java261
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java734
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java634
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java1040
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java328
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java787
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java751
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java505
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java395
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java797
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java344
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceArtifactEdit.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java1324
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceModel.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java277
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java955
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore6
-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/.cvsignore6
-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.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.java60
-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.java276
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java323
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java236
-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.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java342
-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.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java363
-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.htm42
-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.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm45
-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.htm12
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm105
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.htm132
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm209
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.htm57
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm76
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm126
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm127
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm83
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm83
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm61
-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.pngbin25146 -> 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.xml555
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm39
-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.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm225
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm138
-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.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm75
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm101
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm94
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm103
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm45
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm110
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm38
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm59
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm70
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm72
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm68
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm75
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm184
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm107
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm87
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm169
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm172
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm127
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm162
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm128
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm83
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml119
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm44
-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/.cvsignore6
-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.java1517
-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/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.options14
-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.MF66
-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/jpa-content.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gifbin968 -> 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.properties51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/plugin.xml384
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties88
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties237
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_orm.properties41
-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/JpaPlatformUi.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaUiFactory.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AsynchronousUiCommandExecutor.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaUiFactory.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaUiFactory.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaFileAdapterFactory.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/SynchronousUiCommandExecutor.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java178
-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.java48
-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.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OrmPersistentAttributeActionFilter.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java41
-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/details/AbstractJpaDetailsPage.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java432
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java358
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java275
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/BasicMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultBasicMappingUiProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultEmbeddedMappingUiProvider.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddableUiProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedIdMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EntityUiProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IdMappingUiProvider.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToManyMappingUiProvider.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToOneMappingUiProvider.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/MappedSuperclassUiProvider.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullAttributeMappingUiProvider.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullTypeMappingUiProvider.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToManyMappingUiProvider.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToOneMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/TransientMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/VersionMappingUiProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractItemLabelProvider.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractTreeItemContentProvider.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingContentAndLabelProvider.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProviderFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProvider.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProviderFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/StructuredContentProviderAdapter.java261
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProvider.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProviderFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTListChangeListenerWrapper.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTStateChangeListenerWrapper.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTTreeChangeListenerWrapper.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/AbstractDatabaseObjectCombo.java587
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/CatalogCombo.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/ColumnCombo.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SchemaCombo.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SequenceCombo.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/TableCombo.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialogPane.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnStateObject.java256
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicMappingComposite.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java335
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdMappingComposite.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedMappingComposite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumTypeComposite.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/FetchTypeComposite.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java351
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GenerationComposite.java268
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdMappingComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialogPane.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableDialog.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableStateObject.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialogPane.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideStateObject.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableStateObject.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingStateObject.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnStateObject.java180
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java531
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobComposite.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyMappingComposite.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneMappingComposite.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByComposite.java248
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyMappingComposite.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneMappingComposite.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OptionalComposite.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java651
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialogPane.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnStateObject.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java394
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java425
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java238
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityComposite.java387
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TemporalTypeComposite.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientMappingComposite.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionMappingComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorContentProvider.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorLabelProvider.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/JptUiOrmMessages.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/AccessTypeComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/EntityMappingsDetailsPage.java252
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/MetaDataCompleteComboViewer.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmDetailsProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaAttributeChooser.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaClassChooser.java277
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPackageChooser.java271
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentAttributeDetailsPage.java189
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentTypeDetailsPage.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/PersistenceUnitMetadataComposite.java276
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/JpaPlatformUiRegistry.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorContentProvider.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorLabelProvider.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/EntitiesGenerator.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/generic/GenericPlatformUi.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.java205
-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.java424
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelection.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelectionManager.java298
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelection.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionEvent.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionManager.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionParticipant.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemContentProviderFactory.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemLabelProviderFactory.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemContentProviderFactory.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemLabelProviderFactory.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaResourceModelStructureProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JpaStructureProvider.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemContentProviderFactory.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmResourceModelStructureProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemContentProviderFactory.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemLabelProviderFactory.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceResourceModelStructureProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/ResourceModelStructureProvider.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/BooleanButtonModelAdapter.java217
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/ListBoxModelAdapter.java627
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TextFieldModelAdapter.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TriStateCheckBoxModelAdapter.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlAligner.java850
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlEnabler.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlSwitcher.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlVisibilityEnabler.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledButton.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControl.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControlUpdater.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledLabel.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneEnabler.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneVisibilityEnabler.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java302
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/StateController.java320
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java189
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructurePage.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructureView.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialog.java343
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialogPane.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractEnumComboViewer.java356
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractFormPane.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractPane.java2733
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractValidatingDialog.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java316
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java771
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java177
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/NullPostExecution.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/PostExecution.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/TriStateCheckBox.java285
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/WidgetFactory.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java359
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java507
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java494
-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/java/details/AttributeMappingUiProvider.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/TypeMappingUiProvider.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.cvsignore4
-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.MF21
-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/Command.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java1678
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java912
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java3901
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java51
-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/HashBag.java842
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java814
-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.java256
-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/NullList.java151
-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.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java3243
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java365
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java280
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java69
-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.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java126
-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.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java242
-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/ReadOnlyCompositeListIterator.java179
-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.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java1002
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java2360
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java332
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java279
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java297
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java180
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java407
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java575
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java296
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java256
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java317
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java346
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java217
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java200
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java364
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java287
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java427
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java724
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java991
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java420
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java330
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java457
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java427
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java263
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java313
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore6
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF25
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties19
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java43
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java26
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java84
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.classpath12
-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/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF18
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/build.properties15
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties21
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/mysql41.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties20
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties20
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties20
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/postgresql824.properties21
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver2005.properties30
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sybase12.properties21
-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.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java46
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java417
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQL41Tests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQL824Tests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Sybase12Tests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/build.properties4
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties22
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java589
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java569
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java59
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java641
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java320
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java674
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java85
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java85
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java123
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java125
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java123
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore5
-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.MF18
-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.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java633
-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.java3881
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java31
-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.java493
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java511
-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.java61
-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/SimpleAssociationTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java142
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java1176
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java226
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java293
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java271
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java142
-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.java132
-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.java350
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java331
-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.java299
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java196
-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.java55
-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/ReadOnlyCompositeListIteratorTests.java205
-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.java229
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java321
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java210
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java1686
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java455
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java744
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java195
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java146
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java515
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java410
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java237
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java236
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java416
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java849
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java256
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java294
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java288
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java187
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java242
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java333
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java304
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java72
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java475
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java274
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java316
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java327
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java154
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java201
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java411
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java329
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java94
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java198
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java319
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java185
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java355
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java158
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java169
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java383
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java277
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java136
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java315
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java113
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java393
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java160
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java257
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java372
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java200
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java231
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java343
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java646
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java733
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java817
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java426
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java528
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/test.xml40
1750 files changed, 43 insertions, 266023 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 7f986a7f5d..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="2.0.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <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 2544693f86..0000000000
--- a/assembly/features/org.eclipse.jpt.tests/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.bin.dist.zip
-build.xml
-org.eclipse.jpt.tests_1.0.0.* \ No newline at end of file
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 957e7c2d52..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="2.0.0.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <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 de8b73fb72..0000000000
--- a/assembly/features/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.*
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 162ff9e5da..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="2.0.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt"
- image="eclipse_update_120.jpg">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <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 c9401a2c83..0000000000
--- a/assembly/plugins/org.eclipse.jpt/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.* \ No newline at end of file
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 293a9e0e63..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: 2.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/.cvsignore b/jpa/features/org.eclipse.jpt.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
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 51b12484b6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature"
- label="%featureName"
- version="2.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.ui"/>
- <import feature="org.eclipse.datatools.connectivity.feature"/>
- <import feature="org.eclipse.datatools.modelbase.feature"/>
- <import feature="org.eclipse.datatools.sqldevtools.feature"/>
- <import feature="org.eclipse.datatools.enablement.feature"/>
- <import plugin="org.eclipse.datatools.connectivity.db.generic.ui"/>
- <import plugin="org.eclipse.datatools.connectivity.db.generic"/>
- <import plugin="org.eclipse.datatools.doc.user"/>
- <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/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/.cvsignore b/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
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 c319651293..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
+++ /dev/null
@@ -1,38 +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="2.0.0.qualifier"
- provider-name="Eclipse.org">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <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"/>
-
- <plugin
- id="org.eclipse.jpt.core.tests.extension.resource"
- 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/.cvsignore b/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt_sdk.feature_1.0.1.*
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 b2b4f96606..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="2.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.core/.classpath b/jpa/plugins/org.eclipse.jpt.core/.classpath
deleted file mode 100644
index 5ee7c76127..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.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.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.core/.cvsignore
deleted file mode 100644
index 31362a7d19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.*
diff --git a/jpa/plugins/org.eclipse.jpt.core/.project b/jpa/plugins/org.eclipse.jpt.core/.project
deleted file mode 100644
index 6ab3035c3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core</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.core/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 56f01c3c10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:10:33 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 00070b73fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Nov 12 15:24:36 EST 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-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.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 4a059d9849..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,62 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core;singleton:=true
-Bundle-Version: 2.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.core.JptCorePlugin
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Require-Bundle: org.eclipse.core.commands,
- org.eclipse.core.expressions,
- org.eclipse.core.filebuffers,
- 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.jem.util,
- org.eclipse.jem.workbench,
- org.eclipse.jpt.db,
- org.eclipse.jpt.utility,
- org.eclipse.jst.j2ee,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.jee.ejb,
- org.eclipse.text,
- org.eclipse.wst.common.emf,
- org.eclipse.wst.common.emfworkbench.integration,
- org.eclipse.wst.common.frameworks,
- org.eclipse.wst.common.modulecore,
- org.eclipse.wst.common.project.facet.core,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.validation,
- org.eclipse.wst.xml.core,
- org.eclipse.xsd
-Export-Package: org.eclipse.jpt.core,
- org.eclipse.jpt.core.context,
- org.eclipse.jpt.core.context.java,
- org.eclipse.jpt.core.context.orm,
- org.eclipse.jpt.core.context.persistence,
- org.eclipse.jpt.core.internal;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.java;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.orm;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.context.persistence;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.emfutility;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.facet;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.jdtutility;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.platform;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.prefs;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource.common.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource.java;x-friends:="org.eclipse.jpt.ui,org.eclipse.jpt.gen",
- org.eclipse.jpt.core.internal.resource.orm.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.resource.persistence.translators;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.synch;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.internal.validation;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.core.resource.common,
- org.eclipse.jpt.core.resource.java,
- org.eclipse.jpt.core.resource.orm,
- org.eclipse.jpt.core.resource.persistence
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jpa/plugins/org.eclipse.jpt.core/about.html b/jpa/plugins/org.eclipse.jpt.core/about.html
deleted file mode 100644
index 9e73bdabb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/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.core/build.properties b/jpa/plugins/org.eclipse.jpt.core/build.properties
deleted file mode 100644
index 1db25e376d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/build.properties
+++ /dev/null
@@ -1,23 +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 = .,\
- model/,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = model/
diff --git a/jpa/plugins/org.eclipse.jpt.core/component.xml b/jpa/plugins/org.eclipse.jpt.core/component.xml
deleted file mode 100644
index 2311024fcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/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.core"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.core" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml b/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
deleted file mode 100644
index a8ed2dd9e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<profiles version="11">
-<profile kind="CodeFormatterProfile" name="DaliEMFFormatter" version="11">
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="48"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="52"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-</profile>
-</profiles>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel
deleted file mode 100644
index 40b9091a6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/jptResourceModels.genmodel
+++ /dev/null
@@ -1,399 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jpt.core/src"
- creationCommands="false" creationIcons="false" editDirectory="" editorDirectory=""
- modelPluginID="org.eclipse.jpt.core" modelName="Core" editPluginClass="" editorPluginClass=""
- rootExtendsInterface="org.eclipse.jpt.core.resource.common.JpaEObject" rootExtendsClass="org.eclipse.jpt.core.resource.common.AbstractJpaEObject"
- suppressInterfaces="true" testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
- <foreignModel>orm.ecore</foreignModel>
- <foreignModel>persistence.ecore</foreignModel>
- <genPackages prefix="Orm" basePackage="org.eclipse.jpt.core.resource" disposableProviderFactory="true"
- adapterFactory="false" ecorePackage="orm.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//AccessType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//AccessType/PROPERTY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//AccessType/FIELD"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//DiscriminatorType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/STRING"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/CHAR"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/INTEGER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//EnumType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//EnumType/ORDINAL"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//EnumType/STRING"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//FetchType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//FetchType/LAZY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//FetchType/EAGER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//GenerationType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/SEQUENCE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/IDENTITY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//InheritanceType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/SINGLE_TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/JOINED"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/TABLE_PER_CLASS"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//TemporalType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/DATE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/TIME"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/TIMESTAMP"/>
- </genEnums>
- <genDataTypes ecoreDataType="orm.ecore#//DiscriminatorValue"/>
- <genDataTypes ecoreDataType="orm.ecore#//Enumerated"/>
- <genDataTypes ecoreDataType="orm.ecore#//OrderBy"/>
- <genDataTypes ecoreDataType="orm.ecore#//VersionType"/>
- <genClasses ecoreClass="orm.ecore#//XmlEntityMappings">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/version"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/persistenceUnitMetadata"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/package"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/access"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/sequenceGenerators"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/tableGenerators"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/namedQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/namedNativeQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/sqlResultSetMappings"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/mappedSuperclasses"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/entities"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/embeddables"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlPersistenceUnitMetadata">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitMetadata/xmlMappingMetadataComplete"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistenceUnitMetadata/persistenceUnitDefaults"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlPersistenceUnitDefaults">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/access"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/cascadePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistenceUnitDefaults/entityListeners"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlTypeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/className"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/access"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/metadataComplete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTypeMapping/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlTypeMapping/attributes"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlMappedSuperclass">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/idClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMappedSuperclass/excludeDefaultListeners"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMappedSuperclass/excludeSuperclassListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/entityListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/postLoad"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEntity">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/name"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/table"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/secondaryTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/primaryKeyJoinColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/idClass"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/inheritance"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/discriminatorValue"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/discriminatorColumn"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/sequenceGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/tableGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/namedQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/namedNativeQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/sqlResultSetMappings"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/excludeDefaultListeners"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/excludeSuperclassListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/entityListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/postLoad"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/attributeOverrides"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/associationOverrides"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddable"/>
- <genClasses ecoreClass="orm.ecore#//Attributes">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/ids"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/embeddedIds"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/basics"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/versions"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/manyToOnes"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/oneToManys"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/oneToOnes"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/manyToManys"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/embeddeds"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/transients"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAttributeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAttributeMapping/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlAttributeMapping"/>
- <genClasses ecoreClass="orm.ecore#//ColumnMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//ColumnMapping/column"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlRelationshipMapping/targetEntity"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlRelationshipMapping/fetch"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlRelationshipMapping/joinTable"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlRelationshipMapping/cascade"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlMultiRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMultiRelationshipMapping/mappedBy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMultiRelationshipMapping/orderBy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMultiRelationshipMapping/mapKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlSingleRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlSingleRelationshipMapping/optional"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlSingleRelationshipMapping/joinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlId">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/generatedValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlId/temporal"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/tableGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/sequenceGenerator"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlIdImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbeddedId">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEmbeddedId/attributeOverrides"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddedIdImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlBasic">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/fetch"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/optional"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/lob"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/temporal"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/enumerated"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlBasicImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlVersion">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlVersion/temporal"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlVersionImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="orm.ecore#//XmlManyToOneImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToMany">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlOneToMany/joinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlOneToManyImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToOne">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlOneToOne/mappedBy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlOneToOne/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlOneToOneImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToMany"/>
- <genClasses ecoreClass="orm.ecore#//XmlManyToManyImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbedded">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEmbedded/attributeOverrides"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddedImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTransient"/>
- <genClasses ecoreClass="orm.ecore#//XmlTransientImpl"/>
- <genClasses ecoreClass="orm.ecore#//XmlAssociationOverride">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAssociationOverride/joinColumns"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAssociationOverride/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAttributeOverride">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAttributeOverride/column"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAttributeOverride/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlAttributeOverrideImpl"/>
- <genClasses ecoreClass="orm.ecore#//CascadeType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeAll"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeMerge"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeRefresh"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//CascadeTypeImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlNamedColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedColumn/columnDefinition"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedColumn/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlNamedColumn"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAbstractColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/insertable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/nullable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/unique"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAbstractColumn/updatable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlAbstractColumn"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/length"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/precision"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/scale"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlColumnImpl"/>
- <genClasses ecoreClass="orm.ecore#//ColumnResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//ColumnResult/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlDiscriminatorColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/discriminatorType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/length"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityListeners">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListeners/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityListener">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityListener/className"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListener/postLoad"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityResult/discriminatorColumn"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityResult/entityClass"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityResult/fieldResults"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EventMethod">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EventMethod/methodName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//FieldResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//FieldResult/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//FieldResult/column"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlGeneratedValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGeneratedValue/generator"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGeneratedValue/strategy"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlGeneratedValueImpl"/>
- <genClasses ecoreClass="orm.ecore#//IdClass">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//IdClass/className"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//Inheritance">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//Inheritance/strategy"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlJoinColumn/referencedColumnName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlJoinColumnImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTable/joinColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTable/inverseJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlJoinTableImpl"/>
- <genClasses ecoreClass="orm.ecore#//Lob"/>
- <genClasses ecoreClass="orm.ecore#//MapKey">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//MapKey/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//MapKeyImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQuery/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQuery/query"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlQuery/hints"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlNamedNativeQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedNativeQuery/resultClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedNativeQuery/resultSetMapping"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlNamedQuery"/>
- <genClasses ecoreClass="orm.ecore#//PostLoad"/>
- <genClasses ecoreClass="orm.ecore#//PostPersist"/>
- <genClasses ecoreClass="orm.ecore#//PostRemove"/>
- <genClasses ecoreClass="orm.ecore#//PostUpdate"/>
- <genClasses ecoreClass="orm.ecore#//PrePersist"/>
- <genClasses ecoreClass="orm.ecore#//PreRemove"/>
- <genClasses ecoreClass="orm.ecore#//PreUpdate"/>
- <genClasses ecoreClass="orm.ecore#//XmlPrimaryKeyJoinColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPrimaryKeyJoinColumn/referencedColumnName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlQueryHint">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQueryHint/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQueryHint/value"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlBaseTable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlBaseTable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBaseTable/schema"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlBaseTable/uniqueConstraints"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlTable"/>
- <genClasses ecoreClass="orm.ecore#//XmlSecondaryTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlSecondaryTable/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlSecondaryTableImpl"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/initialValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/allocationSize"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlSequenceGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlSequenceGenerator/sequenceName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlSequenceGeneratorImpl"/>
- <genClasses ecoreClass="orm.ecore#//SqlResultSetMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//SqlResultSetMapping/name"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//SqlResultSetMapping/entityResults"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//SqlResultSetMapping/columnResults"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTableGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/pkColumnName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/valueColumnName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/pkColumnValue"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlTableGenerator/uniqueConstraints"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlTableGeneratorImpl"/>
- <genClasses ecoreClass="orm.ecore#//UniqueConstraint">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//UniqueConstraint/columnNames"/>
- </genClasses>
- </genPackages>
- <genPackages prefix="Persistence" basePackage="org.eclipse.jpt.core.resource" disposableProviderFactory="true"
- adapterFactory="false" ecorePackage="persistence.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="persistence.ecore#//XmlPersistenceUnitTransactionType">
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/JTA"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/RESOURCE_LOCAL"/>
- </genEnums>
- <genDataTypes ecoreDataType="persistence.ecore#//XmlPersistenceUnitTransactionTypeObject"/>
- <genDataTypes ecoreDataType="persistence.ecore#//XmlVersion"/>
- <genClasses ecoreClass="persistence.ecore#//XmlPersistence">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistence/persistenceUnits"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistence/version"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlPersistenceUnit">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/description"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/provider"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/jtaDataSource"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/nonJtaDataSource"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/mappingFiles"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/jarFiles"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/classes"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/excludeUnlistedClasses"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/properties"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/transactionType"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlMappingFileRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlMappingFileRef/fileName"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlJavaClassRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlJavaClassRef/javaClass"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlProperties">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlProperties/properties"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlProperty">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlProperty/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlProperty/value"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
deleted file mode 100644
index 8fcf2862e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ /dev/null
@@ -1,481 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="orm"
- nsURI="jpt.orm.xmi" nsPrefix="org.eclipse.jpt.core.resource.orm">
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" lowerBound="1"
- eType="#//VersionType" defaultValueLiteral="1.0" unsettable="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnitMetadata"
- eType="#//XmlPersistenceUnitMetadata" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="package" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sequenceGenerators" upperBound="-1"
- eType="#//XmlSequenceGenerator" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerators" upperBound="-1"
- eType="#//XmlTableGenerator" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedQueries" upperBound="-1"
- eType="#//XmlNamedQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedNativeQueries" upperBound="-1"
- eType="#//XmlNamedNativeQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings" upperBound="-1"
- eType="#//SqlResultSetMapping" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappedSuperclasses" upperBound="-1"
- eType="#//XmlMappedSuperclass" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entities" upperBound="-1"
- eType="#//XmlEntity" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddables" upperBound="-1"
- eType="#//XmlEmbeddable" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlMappingMetadataComplete"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnitDefaults"
- eType="#//XmlPersistenceUnitDefaults" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadePersist" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlTypeMapping" abstract="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="access" eType="#//AccessType"
- defaultValueLiteral="PROPERTY"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="metadataComplete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" eType="#//Attributes"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//AbstractXmlTypeMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="idClass" eType="#//IdClass"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="prePersist" eType="#//PrePersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postPersist" eType="#//PostPersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preRemove" eType="#//PreRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postRemove" eType="#//PostRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preUpdate" eType="#//PreUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postUpdate" eType="#//PostUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postLoad" eType="#//PostLoad"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="#//AbstractXmlTypeMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="#//XmlTable"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="secondaryTables" upperBound="-1"
- eType="#//XmlSecondaryTable" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="idClass" eType="#//IdClass"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="inheritance" eType="#//Inheritance"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorValue" eType="#//DiscriminatorValue"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="discriminatorColumn" eType="#//XmlDiscriminatorColumn"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sequenceGenerator" eType="#//XmlSequenceGenerator"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerator" eType="#//XmlTableGenerator"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedQueries" upperBound="-1"
- eType="#//XmlNamedQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedNativeQueries" upperBound="-1"
- eType="#//XmlNamedNativeQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings" upperBound="-1"
- eType="#//SqlResultSetMapping" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="prePersist" eType="#//PrePersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postPersist" eType="#//PostPersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preRemove" eType="#//PreRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postRemove" eType="#//PostRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preUpdate" eType="#//PreUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postUpdate" eType="#//PostUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postLoad" eType="#//PostLoad"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="associationOverrides" upperBound="-1"
- eType="#//XmlAssociationOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="#//AbstractXmlTypeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes">
- <eStructuralFeatures xsi:type="ecore:EReference" name="ids" upperBound="-1" eType="#//XmlId"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddedIds" upperBound="-1"
- eType="#//XmlEmbeddedId" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="basics" upperBound="-1"
- eType="#//XmlBasic" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="versions" upperBound="-1"
- eType="#//XmlVersion" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="manyToOnes" upperBound="-1"
- eType="#//XmlManyToOne" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oneToManys" upperBound="-1"
- eType="#//XmlOneToMany" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oneToOnes" upperBound="-1"
- eType="#//XmlOneToOne" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="manyToManys" upperBound="-1"
- eType="#//XmlManyToMany" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddeds" upperBound="-1"
- eType="#//XmlEmbedded" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="transients" upperBound="-1"
- eType="#//XmlTransient" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlAttributeMapping" abstract="true"
- eSuperTypes="#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="ColumnMapping" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" eType="#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlAttributeMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetEntity" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//FetchType"
- defaultValueLiteral="LAZY"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinTable" eType="#//XmlJoinTable"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cascade" eType="#//CascadeType"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultiRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="orderBy" eType="#//OrderBy"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKey" eType="#//MapKey"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSingleRelationshipMapping" abstract="true"
- interface="true" eSuperTypes="#//XmlRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//ColumnMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="#//XmlGeneratedValue"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="temporal" eType="#//TemporalType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerator" eType="#//XmlTableGenerator"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sequenceGenerator" eType="#//XmlSequenceGenerator"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIdImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlId"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedIdImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlEmbeddedId"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//ColumnMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//FetchType"
- defaultValueLiteral="LAZY"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="lob" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="temporal" eType="#//TemporalType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="enumerated" eType="#//EnumType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlBasic"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping #//ColumnMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="temporal" eType="#//TemporalType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersionImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlVersion"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" abstract="true" interface="true"
- eSuperTypes="#//XmlSingleRelationshipMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOneImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlManyToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" abstract="true" interface="true"
- eSuperTypes="#//XmlMultiRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToManyImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlOneToMany"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" abstract="true" interface="true"
- eSuperTypes="#//XmlSingleRelationshipMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOneImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlOneToOne"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" abstract="true" interface="true"
- eSuperTypes="#//XmlMultiRelationshipMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToManyImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlManyToMany"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping">
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlEmbedded"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" abstract="true" interface="true"
- eSuperTypes="#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransientImpl" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlTransient"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAssociationOverride">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" lowerBound="1"
- upperBound="-1" eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverride" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" lowerBound="1"
- eType="#//XmlColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverrideImpl" eSuperTypes="#//XmlAttributeOverride"/>
- <eClassifiers xsi:type="ecore:EClass" name="CascadeType" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadePersist" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeMerge" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeRemove" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeRefresh" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="CascadeTypeImpl" eSuperTypes="#//CascadeType"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedColumn" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnDefinition" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlNamedColumn" abstract="true"
- eSuperTypes="#//XmlNamedColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAbstractColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insertable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nullable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="unique" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="updatable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlAbstractColumn" abstract="true"
- eSuperTypes="#//AbstractXmlNamedColumn #//XmlAbstractColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlAbstractColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="precision" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="scale" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlColumnImpl" eSuperTypes="#//AbstractXmlAbstractColumn #//XmlColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="ColumnResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlDiscriminatorColumn" eSuperTypes="#//AbstractXmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorType" eType="#//DiscriminatorType"
- defaultValueLiteral="STRING"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityListeners">
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" upperBound="-1"
- eType="#//EntityListener" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityListener">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="prePersist" eType="#//PrePersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postPersist" eType="#//PostPersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preRemove" eType="#//PreRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postRemove" eType="#//PostRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preUpdate" eType="#//PreUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postUpdate" eType="#//PostUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postLoad" eType="#//PostLoad"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorColumn" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="entityClass" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="fieldResults" upperBound="-1"
- eType="#//FieldResult" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EventMethod">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="methodName" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="FieldResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="column" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGeneratedValue" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="generator" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//GenerationType"
- defaultValueLiteral="TABLE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGeneratedValueImpl" eSuperTypes="#//XmlGeneratedValue"/>
- <eClassifiers xsi:type="ecore:EClass" name="IdClass">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Inheritance">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//InheritanceType"
- defaultValueLiteral="SINGLE_TABLE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinColumn" abstract="true" interface="true"
- eSuperTypes="#//XmlAbstractColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="referencedColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinColumnImpl" eSuperTypes="#//AbstractXmlAbstractColumn #//XmlJoinColumn"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable" abstract="true" interface="true"
- eSuperTypes="#//XmlBaseTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="inverseJoinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTableImpl" eSuperTypes="#//AbstractXmlBaseTable #//XmlJoinTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="Lob"/>
- <eClassifiers xsi:type="ecore:EClass" name="MapKey" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="MapKeyImpl" eSuperTypes="#//MapKey"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQuery" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="query" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hints" upperBound="-1"
- eType="#//XmlQueryHint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedNativeQuery" eSuperTypes="#//XmlQuery">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultSetMapping" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedQuery" eSuperTypes="#//XmlQuery"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostLoad" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostPersist" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostRemove" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostUpdate" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PrePersist" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PreRemove" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PreUpdate" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKeyJoinColumn" eSuperTypes="#//AbstractXmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="referencedColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryHint">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlBaseTable" abstract="true"
- eSuperTypes="#//XmlBaseTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBaseTable" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="uniqueConstraints" upperBound="-1"
- eType="#//UniqueConstraint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable" eSuperTypes="#//AbstractXmlBaseTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable" abstract="true" interface="true"
- eSuperTypes="#//XmlBaseTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTableImpl" eSuperTypes="#//AbstractXmlBaseTable #//XmlSecondaryTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGenerator" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="initialValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="allocationSize" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSequenceGenerator" abstract="true"
- interface="true" eSuperTypes="#//XmlGenerator">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="sequenceName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSequenceGeneratorImpl" eSuperTypes="#//XmlSequenceGenerator"/>
- <eClassifiers xsi:type="ecore:EClass" name="SqlResultSetMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityResults" upperBound="-1"
- eType="#//EntityResult" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="columnResults" upperBound="-1"
- eType="#//ColumnResult" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator" abstract="true" interface="true"
- eSuperTypes="#//XmlGenerator">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="pkColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="pkColumnValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="uniqueConstraints" upperBound="-1"
- eType="#//UniqueConstraint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGeneratorImpl" eSuperTypes="#//XmlTableGenerator"/>
- <eClassifiers xsi:type="ecore:EClass" name="UniqueConstraint">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- lowerBound="1" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="DiscriminatorValue" instanceClassName="java.lang.String"/>
- <eClassifiers xsi:type="ecore:EDataType" name="Enumerated" instanceClassName="org.eclipse.emf.common.util.Enumerator"/>
- <eClassifiers xsi:type="ecore:EDataType" name="OrderBy" instanceClassName="java.lang.String"/>
- <eClassifiers xsi:type="ecore:EDataType" name="VersionType" instanceClassName="java.lang.String"/>
- <eClassifiers xsi:type="ecore:EEnum" name="AccessType">
- <eLiterals name="PROPERTY"/>
- <eLiterals name="FIELD" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="DiscriminatorType">
- <eLiterals name="STRING"/>
- <eLiterals name="CHAR" value="1"/>
- <eLiterals name="INTEGER" value="2"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="EnumType">
- <eLiterals name="ORDINAL"/>
- <eLiterals name="STRING" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="FetchType">
- <eLiterals name="LAZY"/>
- <eLiterals name="EAGER" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="GenerationType">
- <eLiterals name="TABLE"/>
- <eLiterals name="SEQUENCE" value="1"/>
- <eLiterals name="IDENTITY" value="2"/>
- <eLiterals name="AUTO" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="InheritanceType">
- <eLiterals name="SINGLE_TABLE" literal="SINGLE_TABLE"/>
- <eLiterals name="JOINED" value="1"/>
- <eLiterals name="TABLE_PER_CLASS" value="2" literal="TABLE_PER_CLASS"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="TemporalType">
- <eLiterals name="DATE"/>
- <eLiterals name="TIME" value="1"/>
- <eLiterals name="TIMESTAMP" value="2"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecoredi b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecoredi
deleted file mode 100644
index 2a157d937e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecoredi
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<diagrams:Diagrams xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.topcased.org/DI/1.0" xmlns:diagrams="http://www.topcased.org/Diagrams/1.0" xmi:id="_Zg6S0EtFEdyx4aXsvvq6Lg">
- <model href="orm.ecore#/"/>
- <diagrams xmi:id="_ZiDiUEtFEdyx4aXsvvq6Lg" position="0,0" size="100,100" name="No name" viewport="0,0">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_ZiDiUUtFEdyx4aXsvvq6Lg" presentation="org.topcased.modeler.ecore.ediagram">
- <element href="orm.ecore#/"/>
- </semanticModel>
- </diagrams>
-</diagrams:Diagrams>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore b/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
deleted file mode 100644
index 02c5c5f7d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="persistence"
- nsURI="jpt.persistence.xmi" nsPrefix="org.eclipse.jpt.core.resource.persistence">
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistence">
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnits" upperBound="-1"
- eType="#//XmlPersistenceUnit" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" unique="false"
- lowerBound="1" eType="#//XmlVersion"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnit">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="provider" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jtaDataSource" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonJtaDataSource" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappingFiles" unique="false"
- upperBound="-1" eType="#//XmlMappingFileRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jarFiles" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="classes" unique="false"
- upperBound="-1" eType="#//XmlJavaClassRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeUnlistedClasses"
- unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"
- defaultValueLiteral="false" unsettable="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" eType="#//XmlProperties"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="transactionType" unique="false"
- eType="#//XmlPersistenceUnitTransactionType" defaultValueLiteral="JTA" unsettable="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappingFileRef">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fileName" ordered="false"
- unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJavaClassRef">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaClass" ordered="false"
- unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperties">
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
- eType="#//XmlProperty" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperty">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlPersistenceUnitTransactionType">
- <eLiterals name="JTA"/>
- <eLiterals name="RESOURCE_LOCAL" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EDataType" name="XmlPersistenceUnitTransactionTypeObject"
- instanceClassName="org.eclipse.emf.common.util.Enumerator"/>
- <eClassifiers xsi:type="ecore:EDataType" name="XmlVersion" instanceClassName="java.lang.String"/>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecoredi b/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecoredi
deleted file mode 100644
index 291a403df5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecoredi
+++ /dev/null
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<diagrams:Diagrams xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.topcased.org/DI/1.0" xmlns:diagrams="http://www.topcased.org/Diagrams/1.0" xmi:id="_PX6KMDPmEdyvyINE9bD7Ew" activeDiagram="_PYSksDPmEdyvyINE9bD7Ew">
- <model href="persistence.ecore#/"/>
- <diagrams xmi:id="_PYSksDPmEdyvyINE9bD7Ew" position="0,0" size="100,100" name="persistence" viewport="0,0">
- <property xmi:id="_PrM5oDPmEdyvyINE9bD7Ew" key="pageFormatName" value="A4"/>
- <property xmi:id="_PrM5oTPmEdyvyINE9bD7Ew" key="diagramWidth" value="840"/>
- <property xmi:id="_PrM5ojPmEdyvyINE9bD7Ew" key="diagramHeight" value="1188"/>
- <property xmi:id="_PrM5ozPmEdyvyINE9bD7Ew" key="pageMarginName" value="Small Margin"/>
- <property xmi:id="_PrM5pDPmEdyvyINE9bD7Ew" key="diagramTopMargin" value="20"/>
- <property xmi:id="_PrM5pTPmEdyvyINE9bD7Ew" key="diagramBottomMargin" value="20"/>
- <property xmi:id="_PrM5pjPmEdyvyINE9bD7Ew" key="diagramLeftMargin" value="20"/>
- <property xmi:id="_PrM5pzPmEdyvyINE9bD7Ew" key="diagramRightMargin" value="20"/>
- <property xmi:id="_PrM5qDPmEdyvyINE9bD7Ew" key="orientation" value="landscape"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PYSksTPmEdyvyINE9bD7Ew" presentation="org.topcased.modeler.ecore.ediagram">
- <element href="persistence.ecore#/"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzghEDPmEdyvyINE9bD7Ew" position="35,26" size="126,-1">
- <anchorage xmi:id="_Pz_CMTPmEdyvyINE9bD7Ew" graphEdge="_P0pwkTPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzghETPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Persistence"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzghEjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzghEzPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzghFDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Persistence"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzghGDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzghGTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Persistence/version"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzghFTPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzghFjPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzghFzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Persistence"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnsDPmEdyvyINE9bD7Ew" position="35,120" size="298,-1">
- <anchorage xmi:id="_P0pwkDPmEdyvyINE9bD7Ew" graphEdge="_P0pwkTPmEdyvyINE9bD7Ew _P0v3MDPmEdyvyINE9bD7Ew _P0v3NTPmEdyvyINE9bD7Ew _P0v3OjPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnsTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnsjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzmnszPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmntDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnuDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnuTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/description"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnujPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnuzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/provider"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnvDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnvTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/jtaDataSource"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnvjPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnvzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/nonJtaDataSource"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnwDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnwTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/jarFiles"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnwjPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnwzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/excludeUnlistedClasses"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnxDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnxTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/name"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnxjPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnxzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/transactionType"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmntTPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzmntjPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmntzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnyDPmEdyvyINE9bD7Ew" position="162,360" size="135,-1">
- <anchorage xmi:id="_P0pwlTPmEdyvyINE9bD7Ew" graphEdge="_P0v3MDPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnyTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//MappingFileRef"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnyjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzmnyzPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnzDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//MappingFileRef"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuUDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuUTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//MappingFileRef/fileName"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzmnzTPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzmnzjPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzmnzzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//MappingFileRef"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuUjPmEdyvyINE9bD7Ew" position="342,359" size="141,-1">
- <anchorage xmi:id="_P0v3NDPmEdyvyINE9bD7Ew" graphEdge="_P0v3NTPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuUzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//JavaClassRef"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuVDPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuVTPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuVjPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//JavaClassRef"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuWjPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuWzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//JavaClassRef/javaClass"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuVzPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuWDPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuWTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//JavaClassRef"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuXDPmEdyvyINE9bD7Ew" position="37,361" size="95,-1">
- <anchorage xmi:id="_P0v3OTPmEdyvyINE9bD7Ew" graphEdge="_P0v3OjPmEdyvyINE9bD7Ew _P0v3PzPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuXTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Properties"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuXjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuXzPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuYDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Properties"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuYTPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuYjPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuYzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Properties"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuZDPmEdyvyINE9bD7Ew" position="37,455" size="109,-1">
- <anchorage xmi:id="_P0v3PjPmEdyvyINE9bD7Ew" graphEdge="_P0v3PzPmEdyvyINE9bD7Ew"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuZTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Property"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuZjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuZzPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="21"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuaDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Property"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsubDPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsubTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Property/name"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsubjPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsubzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Property/value"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsuaTPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuajPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="11"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsuazPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Property"/>
- </semanticModel>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsucDPmEdyvyINE9bD7Ew" position="365,183" size="209,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsucTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnitTransactionType"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_PzsucjPmEdyvyINE9bD7Ew">
- <property xmi:id="_PzsuczPmEdyvyINE9bD7Ew" key="eStructuralFeatureID" value="9"/>
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_PzsudDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnitTransactionType"/>
- </semanticModel>
- <contained xsi:type="di:GraphNode" xmi:id="_Pzy08DPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_Pzy08TPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnitTransactionType/JTA"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_Pzy08jPmEdyvyINE9bD7Ew" position="0,0" size="-1,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_Pzy08zPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnitTransactionType/RESOURCE_LOCAL"/>
- </semanticModel>
- </contained>
- </contained>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_Pzy09DPmEdyvyINE9bD7Ew" position="365,121" size="292,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_Pzy09TPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnitTransactionTypeObject"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphNode" xmi:id="_Pzy09jPmEdyvyINE9bD7Ew" position="239,26" size="174,-1">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_Pzy09zPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Version"/>
- </semanticModel>
- </contained>
- <contained xsi:type="di:GraphEdge" xmi:id="_P0pwkTPmEdyvyINE9bD7Ew" anchor="_Pz_CMTPmEdyvyINE9bD7Ew _P0pwkDPmEdyvyINE9bD7Ew">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_P0pwkjPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Persistence/persistenceUnits"/>
- </semanticModel>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0pwkzPmEdyvyINE9bD7Ew" id="nameLabel" uDistance="20" vDistance="20"/>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0pwlDPmEdyvyINE9bD7Ew" id="cardinalityLabel" uDistance="20" vDistance="-20"/>
- </contained>
- <contained xsi:type="di:GraphEdge" xmi:id="_P0v3MDPmEdyvyINE9bD7Ew" anchor="_P0pwkDPmEdyvyINE9bD7Ew _P0pwlTPmEdyvyINE9bD7Ew">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_P0v3MTPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/mappingFiles"/>
- </semanticModel>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3MjPmEdyvyINE9bD7Ew" id="nameLabel" uDistance="5" vDistance="13"/>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3MzPmEdyvyINE9bD7Ew" id="cardinalityLabel" uDistance="5" vDistance="-19"/>
- </contained>
- <contained xsi:type="di:GraphEdge" xmi:id="_P0v3NTPmEdyvyINE9bD7Ew" anchor="_P0pwkDPmEdyvyINE9bD7Ew _P0v3NDPmEdyvyINE9bD7Ew">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_P0v3NjPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/classes"/>
- </semanticModel>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3NzPmEdyvyINE9bD7Ew" id="nameLabel" uDistance="10" vDistance="1"/>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3ODPmEdyvyINE9bD7Ew" id="cardinalityLabel" uDistance="-3" vDistance="-35"/>
- </contained>
- <contained xsi:type="di:GraphEdge" xmi:id="_P0v3OjPmEdyvyINE9bD7Ew" anchor="_P0pwkDPmEdyvyINE9bD7Ew _P0v3OTPmEdyvyINE9bD7Ew">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_P0v3OzPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//PersistenceUnit/properties"/>
- </semanticModel>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3PDPmEdyvyINE9bD7Ew" id="nameLabel" uDistance="7" vDistance="18"/>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3PTPmEdyvyINE9bD7Ew" id="cardinalityLabel" uDistance="7" vDistance="-14"/>
- </contained>
- <contained xsi:type="di:GraphEdge" xmi:id="_P0v3PzPmEdyvyINE9bD7Ew" anchor="_P0v3OTPmEdyvyINE9bD7Ew _P0v3PjPmEdyvyINE9bD7Ew">
- <semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_P0v3QDPmEdyvyINE9bD7Ew" presentation="default">
- <element href="persistence.ecore#//Properties/properties"/>
- </semanticModel>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3QTPmEdyvyINE9bD7Ew" id="nameLabel" uDistance="8" vDistance="14"/>
- <contained xsi:type="di:EdgeObjectUV" xmi:id="_P0v3QjPmEdyvyINE9bD7Ew" id="cardinalityLabel" uDistance="9" vDistance="-14"/>
- </contained>
- </diagrams>
-</diagrams:Diagrams>
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.core/plugin.properties
deleted file mode 100644
index b7fb3b7d62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.properties
+++ /dev/null
@@ -1,39 +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 - Core
-providerName = Eclipse.org
-
-JPA_PLATFORM="JPA Platform"
-JPA_PROBLEM_MARKER=JPA Problem Marker
-JPA_FILE_CONTENT=JPA File Content
-
-GENERIC_PLATFORM_LABEL=Generic
-
-JPA_FACET_LABEL=Java Persistence
-JPA_FACET_DESCRIPTION=Adds support for writing persistent meta-data using Java Persistence Architecture.
-JPA_PRESET_LABEL=Utility JPA project with Java 5.0
-JPA_TEMPLATE_LABEL=JPA Project
-JPA_VALIDATOR=JPA Validator
-
-ORM_XML_CONTENT = ORM XML Content
-PERSISTENCE_XML_CONTENT = Persistence XML Content
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
deleted file mode 100644
index 54341c2b6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jpaPlatform"
- name="%JPA_PLATFORM"
- schema="schema/jpaPlatform.exsd"
- />
-
-
- <!-- ***** Eclipse core extensions ***** -->
-
- <extension
- point="org.eclipse.core.resources.markers"
- id="jpaProblemMarker"
- name="%JPA_PROBLEM_MARKER">
-
- <persistent value="true"/>
-
- <!-- Can't use text marker until we have specific models for each input type (XML, java)
- <super type="org.eclipse.core.resources.textmarker"/>
- -->
-
- <super type="org.eclipse.wst.validation.problemmarker"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
- adaptableType="org.eclipse.core.resources.IProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.core.internal.JpaProjectAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IJavaProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.core.content.orm"
- name="%ORM_XML_CONTENT"
- base-type="org.eclipse.core.runtime.xml"
- file-names="orm.xml">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
- <parameter name="element" value="entity-mappings"/>
- </describer>
- </content-type>
-
- <content-type
- id="org.eclipse.jpt.core.content.persistence"
- name="%PERSISTENCE_XML_CONTENT"
- base-type="org.eclipse.core.runtime.xml"
- file-names="persistence.xml">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
- <parameter name="element" value="persistence"/>
- </describer>
- </content-type>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.preferences">
-
- <initializer
- class="org.eclipse.jpt.core.internal.prefs.JpaPreferenceInitializer"/>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.persistence.PersistenceResourceFactory"
- isDefault="true"
- shortSegment="persistence.xml">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.persistence">
- </contentTypeBinding>
- </resourceFactory>
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.orm.OrmResourceFactory"
- isDefault="true"
- shortSegment="orm.xml">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jpt.jpa">
- <label>%JPA_FACET_LABEL</label>
- <description>%JPA_FACET_DESCRIPTION</description>
- </project-facet>
-
- <project-facet-version facet="jpt.jpa" version="1.0">
- <constraint>
- <and>
- <requires facet="jst.java" version="[5.0"/>
- <or>
- <requires facet="jst.utility" version="[1.0"/>
- <requires facet="jst.appclient" version="[1.2"/>
- <requires facet="jst.ejb" version="[1.1"/>
- <requires facet="jst.connector" version="[1.0"/>
- <requires facet="jst.web" version="[2.2"/>
- </or>
- </and>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jpa.template">
- <label>%JPA_TEMPLATE_LABEL</label>
- <fixed facet="jst.java"/>
- <fixed facet="jst.utility"/>
- <fixed facet="jpt.jpa"/>
- <preset id="jpt.jpa.preset"/>
- </template>
-
- <action facet="jpt.jpa" type="install" id="jpt.jpa.install">
- <config-factory class="org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider"/>
- <delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate"/>
- </action>
-
- <!-- The uninstall action is only used to enable facet uninstallation
- through the facet UI. The delegate has no functionality. -->
- <action facet="jpt.jpa" type="uninstall" id="jpt.jpa.uninstall">
- <delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetUninstallDelegate"/>
- </action>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.presets">
-
- <static-preset id="jpt.jpa.preset">
- <label>%JPA_PRESET_LABEL</label>
- <facet id="jst.java" version="5.0"/>
- <facet id="jst.utility" version="1.0"/>
- <facet id="jpt.jpa" version="1.0"/>
- </static-preset>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
-
- <supported>
- <runtime-component any="true"/>
- <facet id="jpt.jpa"/>
- </supported>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="jpaValidator"
- name="%JPA_VALIDATOR">
-
- <validator>
- <enablement>
- <and>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa"/>
- </and>
- </enablement>
-
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="orm.xml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="persistence.xml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.java"/>
-
- <run class="org.eclipse.jpt.core.internal.validation.JpaValidator"/>
- <helper class="org.eclipse.jpt.core.internal.validation.JpaHelper"/>
-
- <markerId markerIdValue="jpaProblemMarker"/>
-
- <!-- don't know what this does
- <dependentValidator depValValue="true"/>
- -->
-
- </validator>
-
- </extension>
-
-
- <!-- ***** JPT extensions (eat our own dogfood) ***** -->
-
- <extension
- point="org.eclipse.jpt.core.jpaPlatform">
-
- <jpaPlatform
- id="generic"
- label="%GENERIC_PLATFORM_LABEL"
- class="org.eclipse.jpt.core.internal.platform.GenericJpaPlatform"/>
-
- </extension>
-
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
deleted file mode 100644
index 8e0a958a77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
+++ /dev/null
@@ -1,22 +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
-###############################################################################
-
-VALIDATE_PLATFORM_NOT_SPECIFIED=Platform must be specified
-VALIDATE_CONNECTION_NOT_SPECIFIED=Connection must be specified
-VALIDATE_CONNECTION_NOT_CONNECTED=Connection must be active to get data source specific help and validation.
-VALIDATE_RUNTIME_NOT_SPECIFIED=There is no server runtime associated with this project to provide a JPA implementation
-VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30=The server runtime selected does not support EJB 3.0, so it likely does not provide a JPA implementation
-VALIDATE_LIBRARY_NOT_SPECIFIED=No JPA implementation library specified
-SYNCHRONIZE_CLASSES_JOB=Synchronizing classes
-SYNCHRONIZING_CLASSES_TASK=Synchronizing classes ...
-INVALID_PERSISTENCE_XML_CONTENT=Invalid persistence.xml content
-ERROR_SYNCHRONIZING_CLASSES_COULD_NOT_VALIDATE=Error synchronizing classes. Could not validate.
-ERROR_WRITING_FILE=Could not write to persistence.xml \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
deleted file mode 100644
index 2729194da2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
+++ /dev/null
@@ -1,66 +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
-###############################################################################
-
-PROJECT_NO_CONNECTION=No connection specified for project. No data-specific validation will be performed.
-PROJECT_INACTIVE_CONNECTION=Connection \"{0}\" is not active. No validation will be done against the data source.
-PROJECT_NO_PERSISTENCE_XML=No persistence.xml file in project
-PROJECT_MULTIPLE_PERSISTENCE_XML=Multiple persistence.xml files in project
-PERSISTENCE_XML_INVALID_CONTENT=Invalid content (no root node)
-PERSISTENCE_NO_PERSISTENCE_UNIT=No persistence unit defined
-PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=Multiple persistence units defined
-PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=Unspecified mapping file
-PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=Mapping file \"{0}\" cannot be resolved
-PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file \"{0}\" does not have ORM content
-PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=Duplicate mapping file \"{0}\"
-PERSISTENCE_UNIT_UNSPECIFIED_CLASS=Unspecified class
-PERSISTENCE_UNIT_NONEXISTENT_CLASS=Class \"{0}\" cannot be resolved
-PERSISTENCE_UNIT_INVALID_CLASS=Class \"{0}\" is not annotated as a persistent class
-PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate class \"{0}\"
-ENTITY_MAPPINGS_MULTIPLE_METADATA=Metadata for persistence unit \"{0}\" specified in multiple mapping files
-PERSISTENT_TYPE_UNSPECIFIED_CONTEXT=This mapped class is not contained in any persistence unit
-PERSISTENT_TYPE_UNSPECIFIED_CLASS=Unspecified class
-PERSISTENT_TYPE_UNRESOLVED_CLASS=Class \"{0}\" cannot be resolved
-ENTITY_NO_ID=Entity \"{0}\" has no Id or EmbeddedId
-PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Unspecified name
-PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute \"{0}\" in class \"{1}\" cannot be resolved
-PERSISTENT_ATTRIBUTE_INVALID_MAPPING=Attribute \"{0}\" has invalid mapping type in this context
-PERSISTENT_ATTRIBUTE_FINAL_FIELD=The java field for attribute \"{0}\" is final
-PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=The java field for attribute \"{0}\" is public
-MAPPING_UNRESOLVED_MAPPED_BY=Cannot resolve attribute named \"{0}\"
-MAPPING_INVALID_MAPPED_BY=Attribute named \"{0}\" has invalid mapping for this relationship
-MAPPING_MAPPED_BY_WITH_JOIN_TABLE=Cannot specify join table if this attribute is mapped by another attribute
-MAPPING_MAPPED_BY_ON_BOTH_SIDES=Relationship must have an owner
-TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for table \"{1}\"
-TABLE_UNRESOLVED_NAME=Table \"{0}\" cannot be resolved
-SECONDARY_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for secondary table \"{1}\"
-SECONDARY_TABLE_UNRESOLVED_NAME=Secondary table \"{0}\" cannot be resolved
-JOIN_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for join table \"{1}\"
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=In virtual attribute \"{0}\", schema \"{1}\" cannot be resolved for join table \"{2}\"
-JOIN_TABLE_UNRESOLVED_NAME=Join table \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=In virtual attribute \"{0}\", join table \"{1}\" cannot be resolved
-COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE=In virtual attribute \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE=In virtual attribute override \"{0}\", table \"{1}\" for column \"{2}\" cannot be resolved
-COLUMN_UNRESOLVED_NAME=Column \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In virtual attribute override \"{0}\", column \"{1}\" cannot be resolved
-JOIN_COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for join column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE=In virtual attribute \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE=In virtual association override \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved
-JOIN_COLUMN_UNRESOLVED_NAME=Join column \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", join column \"{1}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=In virtual association override \"{0}\", join column \"{1}\" cannot be resolved
-JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Referenced column \"{0}\" in join column \"{1}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In virtual attribute \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In virtual association override \"{0}\", referenced column \"{1}\" in join column \"{2}\" cannot be resolved
-GENERATED_VALUE_UNRESOLVED_GENERATOR=No generator named \"{0}\" is defined in the persistence unit
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column \"{0}\" cannot be resolved
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced Column \"{0}\" in primary key join column \"{1}\" cannot be resolved
diff --git a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd b/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd
deleted file mode 100644
index dbdb3ec6f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatform.exsd
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jpt.core" id="jpaPlatform" name="JPA Platform"/>
- </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">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- An translatable string representation of the platform.
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.jpt.core.internal.IJpaPlatform"/>
- </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.core/src/org/eclipse/jpt/core/ContextModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ContextModel.java
deleted file mode 100644
index 6372e22054..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ContextModel.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ContextModel
-{
- /**
- * Update the context model with the content of the JPA project
- */
- void update(IProgressMonitor monitor);
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #addToMessages(List<IMessage>)}
- * should be preceded by a "super" call to this method
- */
- public void addToMessages(List<IMessage> messages);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java
deleted file mode 100644
index 06a665d85a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java
+++ /dev/null
@@ -1,84 +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;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-public interface JpaAnnotationProvider
-{
- /**
- * Build an Annotation with the given fully qualififed annotation name.
- * @param type
- * @param mappingAnnotationName
- * @return
- */
- Annotation buildTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String mappingAnnotationName);
-
- Annotation buildNullTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String mappingAnnotationName);
-
- /**
- * Build an Annotation with the given fully qualififed annotation name.
- * @param type
- * @param annotationName
- * @return
- */
- Annotation buildTypeAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
- Annotation buildNullTypeAnnotation(JavaResourcePersistentType parent, Type type, String annotationName);
-
- /**
- * Ordered iterator of fully qualified annotation names that can apply to a Type
- */
- ListIterator<String> typeMappingAnnotationNames();
-
- /**
- * Iterator of fully qualified annotation(non-mapping) names that can apply to a Type
- */
- Iterator<String> typeAnnotationNames();
-
- /**
- * Build a Annotation with the given fully qualififed annotation name.
- * @param attribute
- * @param mappingAnnotationName
- * @return
- */
- Annotation buildAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String mappingAnnotationName);
-
- Annotation buildNullAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String mappingAnnotationName);
-
- /**
- * Build an Annotation with the given fully qualififed annotation name.
- * @param attribute
- * @param annotationName
- * @return
- */
- Annotation buildAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
- Annotation buildNullAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
-
- /**
- * Ordered iterator of fully qualified annotation names that can apply to an Attribute
- */
- ListIterator<String> attributeMappingAnnotationNames();
-
- /**
- * Iterator of fully qualified annotation(non-mapping) names that can apply to an Attribute
- */
- Iterator<String> attributeAnnotationNames();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java
deleted file mode 100644
index a8b1df779c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaDataSource extends JpaNode {
-
- /**
- * Return the data source's connection profile name.
- * The connection profile is looked up based on this setting.
- */
- String connectionProfileName();
-
- /**
- * Set the data source's connection profile name.
- * The connection profile is looked up based on this setting.
- */
- void setConnectionProfileName(String connectionProfileName);
-
- /**
- * ID string used when connectionProfileName property is changed
- * @see org.eclipse.jpt.utility.internal.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.internal.model.listener.PropertyChangeListener)
- */
- public static final String CONNECTION_PROFILE_NAME_PROPERTY = "connectionProfileName";
-
- /**
- * The data source's connection profile should never be null.
- * If we do not have a connection, return a "null" connection profile.
- */
- ConnectionProfile connectionProfile();
-
- /**
- * ID string used when connectionProfile property is changed
- * @see org.eclipse.jpt.utility.internal.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.internal.model.listener.PropertyChangeListener)
- */
- public static final String CONNECTION_PROFILE_PROPERTY = "connectionProfile";
-
- boolean isConnected();
-
- boolean hasAConnection();
-
- void dispose();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
deleted file mode 100644
index d1da7aa946..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
+++ /dev/null
@@ -1,330 +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;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaAbstractJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAbstractJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-/**
- * Use JpaFactory to create any core (e.g. JpaProject), resource
- * (e.g. PersistenceResource), or context (e.g. AttributeMapping) model objects.
- *
- * Assumes a base JPA project context structure
- * corresponding to the JPA spec:
- *
- * RootContent
- * |- persistence.xml
- * |- persistence unit(s)
- * |- mapping file(s) (e.g. orm.xml)
- * | |- persistent type mapping(s) (e.g. Entity)
- * | |- persistent attribute mapping(s) (e.g. Basic)
- * |- persistent type mapping(s)
- *
- * ... and associated objects.
- *
- * @see org.eclipse.jpt.core.internal.platform.GenericJpaFactory
- */
-public interface JpaFactory
-{
- // **************** core objects *******************************************
-
- /**
- * Construct a JpaProject for the specified config, to be
- * added to the specified JPA project. Return null if unable to create
- * the JPA file (e.g. the content type is unrecognized).
- */
- JpaProject buildJpaProject(JpaProject.Config config) throws CoreException;
-
- JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName);
-
- /**
- * Construct a JPA file for the specified file and with the specified resource
- * model, to be added to the specified JPA project.
- * This should be non-null iff (if and only if) {@link #hasRelevantContent(IFile)}
- * returns true.
- */
- JpaFile buildJpaFile(JpaProject jpaProject, IFile file, ResourceModel resourceModel);
-
- /**
- * Return true if a resource model will be provided for the given file
- */
- boolean hasRelevantContent(IFile file);
-
- /**
- * Build a resource model to be associated with the given file.
- * This should be non-null iff (if and only if) {@link #hasRelevantContent(IFile)}
- * returns true.
- */
- ResourceModel buildResourceModel(JpaProject jpaProject, IFile file);
-
- /**
- * Build a (updated) context model to be associated with the given JPA project.
- * The context model will be built once, but updated many times.
- * @see JpaProject.update(ProgressMonitor)
- */
- ContextModel buildContextModel(JpaProject jpaProject);
-
-
- // **************** persistence context objects ****************************
-
- PersistenceXml buildPersistenceXml(BaseJpaContent parent, PersistenceResource persistenceResource);
-
- Persistence buildPersistence(PersistenceXml parent, XmlPersistence xmlPersistence);
-
- PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit);
-
- /**
- * xmlMappingFileRef is allowed to be null, this would be used for the implied mapping file ref
- */
- MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef);
-
- ClassRef buildClassRef(PersistenceUnit parent, XmlJavaClassRef xmlClassRef);
-
- ClassRef buildClassRef(PersistenceUnit parent, String className);
-
- Property buildProperty(PersistenceUnit parent, XmlProperty property);
-
-
- // **************** orm context objects ************************************
-
- OrmXml buildOrmXml(MappingFileRef parent, OrmResource ormResource);
-
- EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings entityMappings);
-
- PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings entityMappings);
-
- PersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings entityMappings);
-
- OrmPersistentType buildOrmPersistentType(EntityMappings parent, String mappingKey);
-
- OrmEntity buildOrmEntity(OrmPersistentType parent);
-
- OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent);
-
- OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent);
-
- OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, String mappingKey);
-
- OrmTable buildOrmTable(OrmEntity parent);
-
- OrmSecondaryTable buildOrmSecondaryTable(OrmEntity parent);
-
- OrmPrimaryKeyJoinColumn buildOrmPrimaryKeyJoinColumn(OrmJpaContextNode parent, OrmAbstractJoinColumn.Owner owner);
-
- OrmJoinTable buildOrmJoinTable(OrmRelationshipMapping parent);
-
- OrmJoinColumn buildOrmJoinColumn(OrmJpaContextNode parent, OrmJoinColumn.Owner owner);
-
- OrmAttributeOverride buildOrmAttributeOverride(OrmJpaContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride);
-
- OrmAssociationOverride buildOrmAssociationOverride(OrmJpaContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride associationOverride);
-
- OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmNamedColumn.Owner owner);
-
- OrmColumn buildOrmColumn(OrmJpaContextNode parent, OrmColumn.Owner owner);
-
- OrmGeneratedValue buildOrmGeneratedValue(OrmJpaContextNode parent);
-
- OrmSequenceGenerator buildOrmSequenceGenerator(OrmJpaContextNode parent);
-
- OrmTableGenerator buildOrmTableGenerator(OrmJpaContextNode parent);
-
- OrmNamedNativeQuery buildOrmNamedNativeQuery(OrmJpaContextNode parent);
-
- OrmNamedQuery buildOrmNamedQuery(OrmJpaContextNode parent);
-
- OrmQueryHint buildOrmQueryHint(OrmQuery parent);
-
- OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent);
-
- OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent);
-
- OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent);
-
- OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent);
-
- OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent);
-
- OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent);
-
- OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent);
-
- OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent);
-
- OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent);
-
- OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent);
-
- OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent);
-
- // **************** java context objects ***********************************
-
- JavaPersistentType buildJavaPersistentType(JpaContextNode parent, JavaResourcePersistentType resourcePersistentType);
-
- JavaEntity buildJavaEntity(JavaPersistentType parent);
-
- JavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent);
-
- JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent);
-
- JavaTypeMapping buildJavaNullTypeMapping(JavaPersistentType parent);
-
- JavaPersistentAttribute buildJavaPersistentAttribute(JavaPersistentType parent);
-
- JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedIdMapping buildJavaEmbeddedIdMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedMapping buildJavaEmbeddedMapping(JavaPersistentAttribute parent);
-
- JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent);
-
- JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent);
-
- JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent);
-
- JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent);
-
- JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent);
-
- JavaTransientMapping buildJavaTransientMapping(JavaPersistentAttribute parent);
-
- JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent);
-
- JavaAttributeMapping buildJavaNullAttributeMapping(JavaPersistentAttribute parent);
-
- JavaTable buildJavaTable(JavaEntity parent);
-
- JavaJoinTable buildJavaJoinTable(JavaRelationshipMapping parent);
-
- JavaColumn buildJavaColumn(JavaJpaContextNode parent, JavaColumn.Owner owner);
-
- JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner);
-
- JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner);
-
- JavaSecondaryTable buildJavaSecondaryTable(JavaEntity parent);
-
- JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent);
-
- JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent);
-
- JavaGeneratedValue buildJavaGeneratedValue(JavaAttributeMapping parent);
-
- JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaAbstractJoinColumn.Owner owner);
-
- JavaAttributeOverride buildJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner);
-
- JavaAssociationOverride buildJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner);
-
- JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent);
-
- JavaNamedNativeQuery buildJavaNamedNativeQuery(JavaJpaContextNode parent);
-
- JavaQueryHint buildJavaQueryHint(JavaQuery parent);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java
deleted file mode 100644
index 32f14a033a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaFile extends JpaNode
-{
- /**
- * Return the type of resource represented by this JPA file
- * @see ResourceModel#getResourceType()
- */
- String getResourceType();
-
- /**
- * Return the IFile associated with this JPA file
- */
- IFile getFile();
-
- /**
- * Return the resource model represented by this JPA file
- */
- ResourceModel getResourceModel();
-
- /**
- * Return the structure node best represented by the location in the file
- */
- JpaStructureNode structureNode(int textOffset);
-
- /**
- * Forward the Java element changed event to the JPA file's content.
- */
- void javaElementChanged(ElementChangedEvent event);
-
- /**
- * The JPA file has been removed from the JPA project. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
- /**
- * jpaFile was added to the JpaProject
- * @param jpaFile
- */
- void fileAdded(JpaFile jpaFile);
-
- /**
- * jpaFile was removed from the JpaProject
- * @param jpaFile
- */
- void fileRemoved(JpaFile jpaFile);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java
deleted file mode 100644
index bee6685c71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaModel.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * The JPA model holds all the JPA projects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaModel extends Model {
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project.
- * Return null if unable to associate the specified Eclipse project
- * with a JPA project.
- */
- JpaProject jpaProject(IProject project) throws CoreException;
-
- /**
- * Return whether the JPA model contains a JPA project corresponding
- * to the specified Eclipse project.
- */
- boolean containsJpaProject(IProject project);
-
- /**
- * Return the JPA model's JPA projects. This has performance implications,
- * it will build all the JPA projects.
- */
- Iterator<JpaProject> jpaProjects() throws CoreException;
- public static final String JPA_PROJECTS_COLLECTION = "jpaProjects";
-
- /**
- * Return the size of the JPA model's list of JPA projects.
- */
- int jpaProjectsSize();
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- JpaFile jpaFile(IFile file) throws CoreException;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java
deleted file mode 100644
index 95fc063706..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.utility.internal.node.Node;
-
-/**
- * Tweak the node interface with JPA-specific protocol.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaNode extends Node, IAdaptable
-{
-
- /**
- * Return the JPA project the node belongs to.
- */
- JpaProject jpaProject();
-
- /**
- * Return the resource that most directly contains the node.
- * This is used by JpaHelper.
- */
- IResource resource();
-
- // ********** covariant overrides **********
-
- JpaNode parent();
-
- JpaProject root();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
deleted file mode 100644
index 5308322fe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
+++ /dev/null
@@ -1,134 +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;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * the core JPA model. The core JPA model will provide functionality for JPA
- * spec annotations in java, persistence.xml and (orm.xml) mapping files.
- * The org.eclipse.jpt.core.genericPlatform extension supplies
- * resource models for those file types. As another vendor option you
- * will have to supply those resource models as well or different ones
- * as necessary.
- *
- * See the org.eclipse.jpt.core.jpaPlatform extension point
- */
-public interface JpaPlatform
-{
- /**
- * Get the ID for this platform
- */
- String getId();
-
- /**
- * Set the ID for this platform. This is an extension
- * so you can't use a non-default constructor.
- *
- * *************
- * * IMPORTANT * For INTERNAL use only!!
- * *************
- */
- void setId(String theId);
-
-
- // **************** Model construction / updating **************************
-
- /**
- * Construct a JPA file for the specified file, to be added to the specified
- * JPA project. (Defer to the factory for actual object creation.)
- * Return null if unable to create the JPA file (e.g. the content type is
- * unrecognized).
- */
- JpaFile buildJpaFile(JpaProject jpaProject, IFile file);
-
- /**
- * Return a factory responsible for creating core (e.g. IJpaProject), resource
- * (e.g. PersistenceResource), and context (e.g. IPersistenceUnit) model
- * objects
- */
- JpaFactory jpaFactory();
-
-
- // **************** Java annotation support ********************************
-
- /**
- * Return an annotation provider responsible for determining what annotations
- * are supported and constructing java resource model objects
- */
- JpaAnnotationProvider annotationProvider();
-
-
- // **************** Java type mapping support ********************************
-
- /**
- * Build a Java type mapping with the given mapping key and parent. Throws a IllegalArgumentException
- * if the typeMappingKey is not supported by this platform.
- * Override {@link #GenericJpaPlatform.addJavaTypeMappingProvidersTo(Collection<IJavaTypeMappingProvider>)}
- * to add new supported type mappings to the platform
- */
- JavaTypeMapping buildJavaTypeMappingFromMappingKey(String typeMappingKey, JavaPersistentType parent);
-
- /**
- * Build a Java type mapping with the given mapping annotation and parent. Throws a IllegalArgumentException
- * if the mapping annotation is not supported by this platform.
- * Override {@link #GenericJpaPlatform.addJavaTypeMappingProvidersTo(Collection<IJavaTypeMappingProvider>)}
- * to add new supported type mappings to the platform
- */
- JavaTypeMapping buildJavaTypeMappingFromAnnotation(String mappingAnnotationName, JavaPersistentType parent);
-
- // **************** Java attribute mapping support ********************************
-
- /**
- * Build a Java attribute mapping with the given mapping key and parent. Throws a IllegalArgumentException
- * if the attributeMappingKey is not supported by this platform.
- * Override {@link #GenericJpaPlatform.addJavaAttributeMappingProvidersTo(Collection<IJavaAttributeMappingProvider>)}
- * to add new supported attribute mappings to the platform
- */
- JavaAttributeMapping buildJavaAttributeMappingFromMappingKey(String attributeMappingKey, JavaPersistentAttribute parent);
-
- /**
- * Build a Java attribute mapping with the given mapping annotation and parent. Throws a IllegalArgumentException
- * if the mapping annotation is not supported by this platform.
- * Override {@link #GenericJpaPlatform.addJavaAttributeMappingProvidersTo(Collection<IJavaAttributeMappingProvider>)}
- * to add new supported attribute mappings to the platform
- */
- JavaAttributeMapping buildJavaAttributeMappingFromAnnotation(String mappingAnnotationName, JavaPersistentAttribute parent);
-
- /**
- * Build a default Java attribute mapping with the given mapping annotation and parent. Throws a IllegalArgumentException
- * if the mapping annotation is not supported by this platform.
- * Override {@link #GenericJpaPlatform.addDefaultJavaAttributeMappingProvidersTo(Collection<IDefaultJavaAttributeMappingProvider>)}
- * to add new supported attribute mappings to the platform
- */
- JavaAttributeMapping buildDefaultJavaAttributeMapping(JavaPersistentAttribute parent);
-
- /**
- * Return the attribute mapping key corresponding to the default atribute mapping
- * that applies to the Java persistent attribute. This will be based on the attribute's
- * type. See {@link IDefaultJavaAttributeMappingProvider.#defaultApplies(IJavaPersistentAttribute)}
- */
- String defaultJavaAttributeMappingKey(JavaPersistentAttribute persistentAttribute);
-
- // *************************************************************************
-
- /**
- * Adds validation messages to the growing list of messages for a given project
- */
- void addToMessages(JpaProject project, List<IMessage> messages);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java
deleted file mode 100644
index 82e8d1c37b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaProject extends JpaNode {
-
- /**
- * Return the JPA project's name, which is the Eclipse project's name.
- */
- String name();
-
- /**
- * Return the Eclipse project associated with the JPA project.
- */
- IProject project();
-
- /**
- * Return the Java project associated with the JPA project.
- */
- IJavaProject javaProject();
-
- /**
- * Return the vendor-specific JPA platform that builds the JPA project
- * and its contents.
- */
- JpaPlatform jpaPlatform();
-
- /**
- * Return the project's connection
- */
- ConnectionProfile connectionProfile();
-
- /**
- * Return the project's default schema, taken from the ConnectionProfile
- */
- Schema defaultSchema();
-
- /**
- * Return the data source the JPA project is mapped to.
- */
- JpaDataSource dataSource();
-
-
- // **************** discover annotated classes *****************************
-
- /**
- * ID string used when discoversAnnotatedClasses property is changed.
- * @see org.eclipse.jpt.utility.internal.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.internal.model.listener.PropertyChangeListener)
- */
- String DISCOVERS_ANNOTATED_CLASSES_PROPERTY = "discoversAnnotatedClasses";
-
- /**
- * Return whether the JPA project will "discover" annotated classes
- * automatically, as opposed to requiring the classes to be
- * listed in persistence.xml.
- */
- boolean discoversAnnotatedClasses();
-
- /**
- * Set whether the JPA project will "discover" annotated classes
- * automatically, as opposed to requiring the classes to be
- * listed in persistence.xml.
- */
- void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses);
-
-
- // **************** jpa files **********************************************
-
- /**
- * ID string used when jpaFiles collection is changed.
- * @see org.eclipse.jpt.utility.internal.model.Model#addCollectionChangeListener(String, org.eclipse.jpt.utility.internal.model.listener.CollectionChangeListener)
- */
- String JPA_FILES_COLLECTION = "jpaFiles";
-
- /**
- * Return the JPA project's JPA files.
- */
- Iterator<JpaFile> jpaFiles();
-
- /**
- * Return the size of the JPA project's JPA files.
- */
- int jpaFilesSize();
-
- /**
- * Return the JPA file corresponding to the specified file.
- * Return null if unable to associate the given file
- * with a JPA file.
- */
- JpaFile jpaFile(IFile file);
-
- /**
- * Return the JPA project's JPA files for the specified content type ID.
- * The content type ID should match that given in the
- * JPA file content provider.
- */
- Iterator<JpaFile> jpaFiles(String contentTypeId);
-
-
- // **************** various queries ****************************************
-
- /**
- * Return the JPA project's root "deploy path".
- * JPA projects associated with Web projects return "WEB-INF/classes";
- * all others simply return an empty string.
- */
- String rootDeployLocation();
-
- /**
- * Return the context model representing the JPA content of this project
- */
- ContextModel contextModel();
-
- /**
- * Return an iterator on all ITypes that are annotated within this project
- */
- Iterator<IType> annotatedClasses();
-
- /**
- * Return the Java persistent type resource for the specified fully qualified type name;
- * null, if none exists.
- */
- JavaResourcePersistentType javaPersistentTypeResource(String typeName);
-
-
- // **************** jpa model synchronization and lifecycle ****************
-
- /**
- * Synchronize the JPA project's JPA files with the specified resource
- * delta, watching for added and removed files.
- */
- void synchronizeJpaFiles(IResourceDelta delta) throws CoreException;
-
- /**
- * Forward the Java element change event to the JPA project's JPA files.
- */
- void javaElementChanged(ElementChangedEvent event);
-
- /**
- * The JPA project has been removed from the JPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // **************** validation *********************************************
-
- /**
- * Return project's validation messages.
- */
- Iterator<IMessage> validationMessages();
-
- /**
- * Add to the list of current validation messages
- */
- void addToMessages(List<IMessage> messages);
-
-
- // **************** support for modifying shared documents *****************
-
- /**
- * Set a thread-specific implementation of the CommandExecutor
- * interface that will be used to execute a command to modify a shared
- * document. If necessary, the command executor can be cleared by
- * setting it to null.
- * This allows background clients to modify documents that are
- * already present in the UI. See implementations of CommandExecutor.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the CommandExecutorProvider
- * interface.
- */
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider();
-
-
- // **************** project "update" ***************************************
-
- /**
- * Return the implementation of the Updater
- * interface that will be used to "update" a JPA project.
- */
- Updater updater();
-
- /**
- * Set the implementation of the Updater
- * interface that will be used to "update" a JPA project.
- */
- void setUpdater(Updater updater);
-
- /**
- * Something in the JPA project has changed, "update" those parts of the
- * JPA project that are dependent on other parts of the JPA project.
- * This is called when
- * - the JPA project is first constructed
- * - anything in the JPA project changes
- * - the JPA project's database connection is changed, opened, or closed
- */
- void update();
-
- /**
- * This is the callback used by the updater to perform the actual
- * "update".
- */
- IStatus update(IProgressMonitor monitor);
-
-
- /**
- * Define a strategy that can be used to "update" a JPA project whenever
- * something changes.
- */
- interface Updater {
-
- /**
- * Update the JPA project.
- */
- void update();
-
- /**
- * The JPA project is disposed; dispose the updater.
- */
- void dispose();
-
- /**
- * This updater does nothing. Useful for testing.
- */
- final class Null implements Updater {
- public static final Updater INSTANCE = new Null();
- public static Updater instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void update() {
- // do nothing
- }
- public void dispose() {
- // do nothing
- }
- @Override
- public String toString() {
- return "IJpaProject.Updater.Null";
- }
- }
-
- }
-
-
- // **************** config that can be used to construct a JPA project *****
-
- /**
- * The settings used to construct a JPA project.
- */
- interface Config {
-
- /**
- * Return the Eclipse project to be associated with the new JPA project.
- */
- IProject project();
-
- /**
- * Return the JPA platform to be associated with the new JPA project.
- */
- JpaPlatform jpaPlatform();
-
- /**
- * Return the name of the connection profile to be associated
- * with the new JPA project. (This connection profile wraps a DTP
- * connection profile.)
- */
- String connectionProfileName();
-
- /**
- * Return whether the new JPA project is to "discover" annotated
- * classes.
- */
- boolean discoverAnnotatedClasses();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java
deleted file mode 100644
index 28bae740c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-
-/**
- * Implement this interface for objects that appear in the Structure view
- * This is used by JpaSelection to determine selection in the editor.
- * Details pages are also provided for each IJpaStructureNode.
- *
- * I did not implement JpaContextNode and I'm not even sure we should implement
- * JpaNode. It is possibly someone could want a structure node that is
- * not actually a contextNode in the model.//TODO
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaStructureNode extends JpaNode
-{
- /**
- * Return the structure node at the given offset.
- */
- JpaStructureNode structureNode(int textOffset);
-
- /**
- * Return the text range do be used to select text in the editor
- * corresponding to this node.
- */
- TextRange selectionTextRange();
-
- /**
- * Return a unique identifier for all of this class of structure nodes
- */
- String getId();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
deleted file mode 100644
index c93fa0521e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jpt.core.internal.JpaModelManager;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * The JPT plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-// TODO keep preferences in synch with the JPA project
-// (connection profile name, "discover" flag)
-// use listeners?
-public class JptCorePlugin extends Plugin {
-
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of the persistence support
- * (value <code>"org.eclipse.jpt.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.core"; //$NON-NLS-1$
-
- /**
- * The identifier for the JPA facet
- * (value <code>"jpt.jpa"</code>).
- */
- public static final String FACET_ID = "jpt.jpa"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's platform in the Eclipse
- * project's preferences.
- */
- public static final String JPA_PLATFORM = PLUGIN_ID + ".platform"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's "discover" flag in the Eclipse
- * project's preferences.
- */
- public static final String DISCOVER_ANNOTATED_CLASSES = PLUGIN_ID + ".discoverAnnotatedClasses"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's data source connection profile name
- * in the Eclipse project's persistent property's.
- */
- public static final QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME =
- new QualifiedName(PLUGIN_ID, "dataSource.connectionProfileName"); //$NON-NLS-1$
-
- /**
- * The identifier for the JPA validation marker
- * (value <code>"org.eclipse.jpt.core.jpaProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jpaProblemMarker"; //$NON-NLS-1$
-
- /**
- * Value of the content-type for orm.xml mappings files. Use this value to retrieve
- * the ORM xml content type from the content type manager and to add new
- * orm.xml-like extensions to this content type.
- *
- * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String)
- */
- public static final String ORM_XML_CONTENT_TYPE = PLUGIN_ID + ".content.orm"; //$NON-NLS-1$
-
- /**
- * Ditto for persistence.xml.
- * @see #ORM_XML_CONTENT_TYPE
- */
- public static final String PERSISTENCE_XML_CONTENT_TYPE = PLUGIN_ID + ".content.persistence"; //$NON-NLS-1$
-
- /**
- * Web projects have some special exceptions.
- */
- public static final String WEB_PROJECT_FACET_ID = IModuleConstants.JST_WEB_MODULE;
-
- /**
- * Web projects have some special exceptions.
- */
- public static final String WEB_PROJECT_DEPLOY_PREFIX = J2EEConstants.WEB_INF_CLASSES;
-
- public static final String DEFAULT_PERSISTENCE_XML_FILE_PATH = "META-INF/persistence.xml";
-
- public static final String DEFAULT_ORM_XML_FILE_PATH = "META-INF/orm.xml";
-
-
- // ********** singleton **********
-
- private static JptCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPA plug-in.
- */
- public static JptCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JPA model corresponding to the current workspace.
- */
- public static JpaModel jpaModel() {
- return JpaModelManager.instance().jpaModel();
- }
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project,
- * or null if unable to associate the specified project with a
- * JPA project.
- */
- public static JpaProject jpaProject(IProject project) {
- try {
- return JpaModelManager.instance().jpaProject(project);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- public static JpaFile jpaFile(IFile file) {
- try {
- return JpaModelManager.instance().jpaFile(file);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Return whether the specified Eclipse project has a JPA facet.
- */
- public static boolean projectHasJpaFacet(IProject project) {
- return projectHasFacet(project, FACET_ID);
- }
-
- /**
- * Return whether the specified Eclipse project has a JPA facet.
- */
- public static boolean projectHasWebFacet(IProject project) {
- return projectHasFacet(project, WEB_PROJECT_FACET_ID);
- }
-
- /**
- * Checked exceptions bite.
- */
- private static boolean projectHasFacet(IProject project, String facetId) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, facetId);
- } catch (CoreException ex) {
- log(ex); // problems reading the project metadata - assume facet doesn't exist - return 'false'
- return false;
- }
- }
-
- /**
- * Return the persistence.xml deployment URI for the specified project.
- */
- public static String persistenceXmlDeploymentURI(IProject project) {
- return deploymentURI(project, DEFAULT_PERSISTENCE_XML_FILE_PATH);
- }
-
- /**
- * Return the orm.xml deployment URI for the specified project.
- */
- public static String ormXmlDeploymentURI(IProject project) {
- return deploymentURI(project, DEFAULT_ORM_XML_FILE_PATH);
- }
-
- /**
- * Tweak the specified deployment URI if the specified project
- * has a web facet.
- */
- private static String deploymentURI(IProject project, String defaultURI) {
- return projectHasWebFacet(project) ?
- WEB_PROJECT_DEPLOY_PREFIX + "/" + defaultURI
- :
- defaultURI;
- }
-
- /**
- * Return the JPA preferences for the specified Eclipse project.
- */
- public static IEclipsePreferences preferences(IProject project) {
- IScopeContext context = new ProjectScope(project);
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Return the JPA platform associated with the specified Eclipse project.
- */
- public static JpaPlatform jpaPlatform(IProject project) {
- return JpaPlatformRegistry.instance().jpaPlatform(jpaPlatformId(project));
- }
-
- /**
- * Return the JPA platform ID associated with the specified Eclipse project.
- */
- public static String jpaPlatformId(IProject project) {
- return preferences(project).get(JPA_PLATFORM, GenericJpaPlatform.ID);
- }
-
- /**
- * Set the JPA platform ID associated with the specified Eclipse project.
- */
- public static void setJpaPlatformId(IProject project, String jpaPlatformId) {
- IEclipsePreferences prefs = preferences(project);
- prefs.put(JPA_PLATFORM, jpaPlatformId);
- flush(prefs);
- }
-
- /**
- * Return the JPA "discover" flag associated with the specified
- * Eclipse project.
- */
- public static boolean discoverAnnotatedClasses(IProject project) {
- return preferences(project).getBoolean(DISCOVER_ANNOTATED_CLASSES, false);
- }
-
- /**
- * Set the JPA "discover" flag associated with the specified
- * Eclipse project.
- */
- public static void setDiscoverAnnotatedClasses(IProject project, boolean discoverAnnotatedClasses) {
- IEclipsePreferences prefs = preferences(project);
- prefs.putBoolean(DISCOVER_ANNOTATED_CLASSES, discoverAnnotatedClasses);
- flush(prefs);
- }
-
- /**
- * checked exceptions bite
- */
- private static void flush(IEclipsePreferences prefs) {
- try {
- prefs.flush();
- } catch(BackingStoreException ex) {
- log(ex);
- }
- }
-
- /**
- * Return the name of the connection profile associated with the specified
- * Eclipse project.
- */
- public static String connectionProfileName(IProject project) {
- try {
- return project.getPersistentProperty(DATA_SOURCE_CONNECTION_PROFILE_NAME);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Set the name of the connection profile associated with the specified
- * Eclipse project.
- */
- public static void setConnectionProfileName(IProject project, String connectionProfileName) {
- try {
- project.setPersistentProperty(DATA_SOURCE_CONNECTION_PROFILE_NAME, connectionProfileName);
- } catch (CoreException ex) {
- log(ex);
- }
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **********
-
- public JptCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JpaModelManager.instance().start();
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- JpaModelManager.instance().stop();
- } finally {
- super.stop(context);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java
deleted file mode 100644
index 5f87c92672..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappingKeys
-{
- String ENTITY_TYPE_MAPPING_KEY = "entity";
- String MAPPED_SUPERCLASS_TYPE_MAPPING_KEY = "mappedSuperclass";
- String EMBEDDABLE_TYPE_MAPPING_KEY = "embeddable";
- String NULL_TYPE_MAPPING_KEY = null;
-
- String BASIC_ATTRIBUTE_MAPPING_KEY = "basic";
- String ID_ATTRIBUTE_MAPPING_KEY = "id";
- String VERSION_ATTRIBUTE_MAPPING_KEY = "version";
- String ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "oneToOne";
- String ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY = "oneToMany";
- String MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY = "manyToOne";
- String MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY = "manyToMany";
- String EMBEDDED_ATTRIBUTE_MAPPING_KEY = "embedded";
- String EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY = "embeddedId";
- String TRANSIENT_ATTRIBUTE_MAPPING_KEY = "transient";
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModel.java
deleted file mode 100644
index 21af0c529e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModel.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ResourceModel extends Model
-{
- /**
- * Constant representing a Java resource type
- * @see ResourceModel#getResourceType()
- */
- static final String JAVA_RESOURCE_TYPE = "JAVA_RESOURCE_TYPE";
-
- /**
- * Constant representing a persistence.xml resource type
- * @see ResourceModel#getResourceType()
- */
- static final String PERSISTENCE_RESOURCE_TYPE = "PERSISTENCE_RESOURCE_TYPE";
-
- /**
- * Constant representing a mapping file (e.g. orm.xml) resource type
- * @see ResourceModel#getResourceType()
- */
- static final String ORM_RESOURCE_TYPE = "ORM_RESOURCE_TYPE";
-
-
- /**
- * Return a unique identifier for all resource models of this type
- */
- String getResourceType();
-
-
- // **************** root structure nodes *************************************
-
- /**
- * String constant associated with changes to the list of root structure nodes
- */
- final static String ROOT_STRUCTURE_NODES_LIST = "rootStructureNodes";
-
- /**
- * Return a list iterator of all root structure nodes
- */
- ListIterator<JpaStructureNode> rootStructureNodes();
-
- /**
- * Return the size of all root structure nodes
- */
- int rootStructureNodesSize();
-
- /**
- * Return a structure node for the given text offset
- */
- JpaStructureNode structureNode(int textOffset);
-
-
- void javaElementChanged(ElementChangedEvent event);
-
-
- void addResourceModelChangeListener(ResourceModelListener listener);
-
- void removeResourceModelChangeListener(ResourceModelListener listener);
-
-
- void dispose();
-
- /**
- * Use to resolve type information that could be dependent on other files being added/removed
- */
- void resolveTypes();
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java
deleted file mode 100644
index d5882d8b3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceModelListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ResourceModelListener extends ChangeListener
-{
- void resourceModelChanged();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/TextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/TextRange.java
deleted file mode 100644
index 9b583d5c4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/TextRange.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core;
-
-/**
- * A text range defines the offset into, length of, and line of a piece
- * of text.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TextRange {
-
- /**
- * Returns the offset of the text.
- *
- * @return the offset of the text
- */
- int getOffset();
-
- /**
- * Return the length of the text.
- */
- int getLength();
-
- /**
- * Return whether the range includes the character at the specified index.
- */
- boolean includes(int index);
-
- /**
- * Return whether the range touches an insertion cursor at the
- * specified index.
- */
- boolean touches(int index);
-
- /**
- * Return the line number of the text.
- */
- int getLineNumber();
-
- /**
- * Return true if the offsets and lengths are the same.
- */
- boolean equals(Object obj);
-
- /**
- * Return a hash code that corresponds to the #equals() contract.
- */
- int hashCode();
-
-
- /**
- * Empty implementation of text range.
- */
- final class Empty implements TextRange {
- public static final TextRange INSTANCE = new Empty();
- public static TextRange instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- public int getOffset() {
- return 0;
- }
- public int getLength() {
- return 0;
- }
- public boolean includes(int index) {
- return false;
- }
- public boolean touches(int index) {
- return index == 0; // ???
- }
- public int getLineNumber() {
- return 0;
- }
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == 0)
- && (r.getLength() == 0);
- }
- @Override
- public int hashCode() {
- return 0;
- }
- @Override
- public String toString() {
- return "ITextRange.Empty";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractColumn.java
deleted file mode 100644
index d33027f10e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractColumn.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AbstractColumn extends NamedColumn
-{
-
- String getTable();
-
- String getDefaultTable();
- String DEFAULT_TABLE_PROPERTY = "defaultTableProperty";
-
- String getSpecifiedTable();
- void setSpecifiedTable(String value);
- String SPECIFIED_TABLE_PROPERTY = "specifiedTableProperty";
-
-
- Boolean getUnique();
-
- Boolean getDefaultUnique();
- String DEFAULT_UNIQUE_PROPERTY = "defaultUniqueProperty";
- Boolean DEFAULT_UNIQUE = Boolean.FALSE;
- Boolean getSpecifiedUnique();
- void setSpecifiedUnique(Boolean newSpecifiedUnique);
- String SPECIFIED_UNIQUE_PROPERTY = "specifiedUniqueProperty";
-
-
- Boolean getNullable();
-
- Boolean getDefaultNullable();
- String DEFAULT_NULLABLE_PROPERTY = "defaultNullableProperty";
- Boolean DEFAULT_NULLABLE = Boolean.TRUE;
- Boolean getSpecifiedNullable();
- void setSpecifiedNullable(Boolean newSpecifiedNullable);
- String SPECIFIED_NULLABLE_PROPERTY = "specifiedNullableProperty";
-
-
- Boolean getInsertable();
-
- Boolean getDefaultInsertable();
- String DEFAULT_INSERTABLE_PROPERTY = "defaulInsertableProperty";
- Boolean DEFAULT_INSERTABLE = Boolean.TRUE;
- Boolean getSpecifiedInsertable();
- void setSpecifiedInsertable(Boolean newSpecifiedInsertable);
- String SPECIFIED_INSERTABLE_PROPERTY = "specifiedInsertableProperty";
-
-
- Boolean getUpdatable();
-
- Boolean getDefaultUpdatable();
- String DEFAULT_UPDATABLE_PROPERTY = "defaulUpdatableProperty";
- Boolean DEFAULT_UPDATABLE = Boolean.TRUE;
- Boolean getSpecifiedUpdatable();
- void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable);
- String SPECIFIED_UPDATABLE_PROPERTY = "specifiedUpdatableProperty";
-
- //TODO not sure we really need/want this to be public. This
- //is used by ColumnComposite to get a list of possible associated tables, but
- //right now that list isn't going to update in the UI except when we repopulate
- Owner owner();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the name of the persistent attribute that contains the column.
- */
- String defaultTableName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractJoinColumn.java
deleted file mode 100644
index 5a9da776db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AbstractJoinColumn.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AbstractJoinColumn extends NamedColumn
-{
- String getReferencedColumnName();
- String getDefaultReferencedColumnName();
- String getSpecifiedReferencedColumnName();
- void setSpecifiedReferencedColumnName(String value);
- String SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY = "specifiedReferencedColumnName";
- String DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY = "defaultReferencedColumnName";
-
- /**
- * Return the wrapper for the datasource referenced column
- */
- Column dbReferencedColumn();
-
- /**
- * Return whether the reference column is found on the datasource
- */
- boolean isReferencedColumnResolved();
-
- boolean isVirtual();
-
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the wrapper for the datasource table for the referenced column
- */
- Table dbReferencedColumnTable();
-
- boolean isVirtual(AbstractJoinColumn joinColumn);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java
deleted file mode 100644
index e57caa5d32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum AccessType {
-
- FIELD,
- PROPERTY;
-
-
- public static AccessType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.AccessType javaAccessType) {
- if (javaAccessType == null) {
- return null;
- }
- switch (javaAccessType) {
- case FIELD:
- return FIELD;
- case PROPERTY:
- return PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + javaAccessType);
- }
- }
-
- public static AccessType fromXmlResourceModel(org.eclipse.jpt.core.resource.orm.AccessType ormAccessType) {
- if (ormAccessType == null) {
- return null;
- }
- switch (ormAccessType) {
- case FIELD:
- return FIELD;
- case PROPERTY:
- return PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + ormAccessType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.AccessType toXmlResourceModel(AccessType accessType) {
- if (accessType == null) {
- return null;
- }
- switch (accessType) {
- case FIELD:
- return org.eclipse.jpt.core.resource.orm.AccessType.FIELD;
- case PROPERTY:
- return org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY;
- default:
- throw new IllegalArgumentException("unknown access type: " + accessType);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java
deleted file mode 100644
index ecabbba160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AssociationOverride extends BaseOverride
-{
- <T extends JoinColumn> ListIterator<T> joinColumns();
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- <T extends JoinColumn> ListIterator<T> defaultJoinColumns();
- int joinColumnsSize();
- int specifiedJoinColumnsSize();
- int defaultJoinColumnsSize();
- JoinColumn addSpecifiedJoinColumn(int index);
- void removeSpecifiedJoinColumn(int index);
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
- String DEFAULT_JOIN_COLUMNS_LIST = "defaultJoinColumnsList";
-
- boolean containsSpecifiedJoinColumns();
-
- AssociationOverride.Owner owner();
-
- interface Owner extends BaseOverride.Owner
- {
- /**
- * Return the relationship mapping with the given attribute name.
- * Return null if it does not exist. This relationship mapping
- * will be found in the mapped superclass, not in the owning entity
- */
- RelationshipMapping relationshipMapping(String attributeName);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java
deleted file mode 100644
index 10000304fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeMapping extends JpaContextNode
-{
- PersistentAttribute persistentAttribute();
-
- boolean isDefault();
-
- /**
- * Return a unique key for the IPersistentAttributeMapping. If this is defined in
- * an extension they should be equal.
- */
- String getKey();
-
- /**
- * If the mapping is for a primary key column, return the column's name,
- * otherwise return null.
- */
- String primaryKeyColumnName();
-
- /**
- * Return the mapping for the attribute mapping's attribute's type.
- */
- TypeMapping typeMapping();
-
- /**
- * Return whether the "attribute" mapping can be overridden.
- */
- boolean isOverridableAttributeMapping();
-
- /**
- * Return whether the "association" mapping can be overridden.
- */
- boolean isOverridableAssociationMapping();
-
- /**
- * Return whether the "attribute" mapping is for an ID.
- */
- boolean isIdMapping();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java
deleted file mode 100644
index b72b577dd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeOverride extends BaseOverride, Column.Owner
-{
- Column getColumn();
-
- AttributeOverride.Owner owner();
-
- interface Owner extends BaseOverride.Owner
- {
- /**
- * Return the column mapping with the given attribute name.
- * Return null if it does not exist. This column mapping
- * will be found in the mapped superclass (or embeddable), not in the owning entity
- */
- ColumnMapping columnMapping(String attributeName);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJpaContent.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJpaContent.java
deleted file mode 100644
index 1073bd69cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJpaContent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.core.ContextModel;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface BaseJpaContent extends JpaContextNode, ContextModel
-{
-
- /**
- * String constant associated with changes to the persistenceXml property
- */
- public final static String PERSISTENCE_XML_PROPERTY = "persistenceXml";
-
- /**
- * Return the content represented by the persistence.xml file associated with
- * this project.
- * This may be null.
- */
- PersistenceXml getPersistenceXml();
-
- /**
- * Add a persistence.xml file to this content and return the content associated
- * with it.
- * Throws {@link IllegalStateException} if a persistence.xml already exists.
- */
- PersistenceXml addPersistenceXml();
-
- /**
- * Remove the persistence.xml file from this content.
- * Throws {@link IllegalStateException} if a persistence.xml does not exist.
- */
- void removePersistenceXml();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
deleted file mode 100644
index 7087609f80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface BaseOverride extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return true if override exists as specified on the owning object, or false
- * if the override is "gotten for free" as a result of defaults calculation
- */
- boolean isVirtual();
-
- interface Owner
- {
- /**
- * Return the type mapping that this override is contained in
- * @return
- */
- TypeMapping typeMapping();
-
- /**
- * Teturn whether the given override is virtual. virtual means that
- * it is not specified, but defaulted in from the mapped superclass or
- * embeddable.
- */
- boolean isVirtual(BaseOverride override);
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java
deleted file mode 100644
index 44005adb88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface BasicMapping extends AttributeMapping, ColumnMapping, Fetchable, Nullable
-{
- FetchType DEFAULT_FETCH_TYPE = FetchType.EAGER;
-
- boolean isLob();
-
- void setLob(boolean value);
- String LOB_PROPERTY = "lobProperty";
-
- EnumType getEnumerated();
-
- EnumType getDefaultEnumerated();
- String DEFAULT_ENUMERATED_PROPERTY = "defaultEnumeratedProperty";
- EnumType DEFAULT_ENUMERATED = EnumType.ORDINAL;
-
- EnumType getSpecifiedEnumerated();
- void setSpecifiedEnumerated(EnumType newSpecifiedEnumerated);
- String SPECIFIED_ENUMERATED_PROPERTY = "specifiedEnumeratedProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java
deleted file mode 100644
index af68654463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Cascade extends JpaContextNode
-{
-
- boolean isAll();
- void setAll(boolean value);
- String ALL_PROPERTY = "allProperty";
-
- boolean isPersist();
- void setPersist(boolean value);
- String PERSIST_PROPERTY = "persistProperty";
-
- boolean isMerge();
- void setMerge(boolean value);
- String MERGE_PROPERTY = "mergeProperty";
-
- boolean isRemove();
- void setRemove(boolean value);
- String REMOVE_PROPERTY = "removeProperty";
-
- boolean isRefresh();
- void setRefresh(boolean value);
- String REFRESH_PROPERTY = "refreshProperty";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java
deleted file mode 100644
index ed9beecea3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Column extends AbstractColumn
-{
- Integer getLength();
-
- Integer getDefaultLength();
- Integer DEFAULT_LENGTH = Integer.valueOf(255);
- String DEFAULT_LENGTH_PROPERTY = "defaultLengthProperty";
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer newSpecifiedLength);
- String SPECIFIED_LENGTH_PROPERTY = "spcifiedLengthProperty";
-
- Integer getPrecision();
-
- Integer getDefaultPrecision();
- Integer DEFAULT_PRECISION = Integer.valueOf(0);
- String DEFAULT_PRECISION_PROPERTY = "defaultPrecisionProperty";
-
- Integer getSpecifiedPrecision();
- void setSpecifiedPrecision(Integer newSpecifiedPrecision);
- String SPECIFIED_PRECISION_PROPERTY = "spcifiedPrecisionProperty";
-
-
- Integer getScale();
-
- Integer getDefaultScale();
- Integer DEFAULT_SCALE = Integer.valueOf(0);
- String DEFAULT_SCALE_PROPERTY = "defaultScaleProperty";
-
- Integer getSpecifiedScale();
- void setSpecifiedScale(Integer newSpecifiedScale);
- String SPECIFIED_SCALE_PROPERTY = "spcifiedScaleProperty";
-
- /**
- * Return whether the column is found on the datasource
- */
- boolean isResolved();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java
deleted file mode 100644
index a96ad2248c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ColumnMapping extends JpaContextNode, Column.Owner
-{
- Column getColumn();
-
- TemporalType getTemporal();
- void setTemporal(TemporalType value);
- String TEMPORAL_PROPERTY = "temporalProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java
deleted file mode 100644
index 07be31c89b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DiscriminatorColumn extends NamedColumn
-{
- String DEFAULT_NAME = "DTYPE";
-
- DiscriminatorType getDiscriminatorType();
-
- DiscriminatorType getDefaultDiscriminatorType();
- String DEFAULT_DISCRIMINATOR_TYPE_PROPERTY = "defaultDiscriminatorTypeProperty";
- DiscriminatorType DEFAULT_DISCRIMINATOR_TYPE = DiscriminatorType.STRING;
-
- DiscriminatorType getSpecifiedDiscriminatorType();
- void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType);
- String SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY = "specifiedDiscriminatorTypeProperty";
-
-
- Integer getLength();
-
- Integer getDefaultLength();
- Integer DEFAULT_LENGTH = Integer.valueOf(31);
- String DEFAULT_LENGTH_PROPERTY = "defaultLengthProperty";
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer value);
- String SPECIFIED_LENGTH_PROPERTY = "spcifiedLengthProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java
deleted file mode 100644
index ee146f5c98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum DiscriminatorType {
-
- STRING,
- CHAR,
- INTEGER;
-
-
- public static DiscriminatorType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType) {
- if (javaDiscriminatorType == null) {
- return null;
- }
- switch (javaDiscriminatorType) {
- case STRING:
- return STRING;
- case CHAR:
- return CHAR;
- case INTEGER:
- return INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + javaDiscriminatorType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.DiscriminatorType toJavaResourceModel(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.STRING;
- case CHAR:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR;
- case INTEGER:
- return org.eclipse.jpt.core.resource.java.DiscriminatorType.INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-
- public static DiscriminatorType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType) {
- if (ormDiscriminatorType == null) {
- return null;
- }
- switch (ormDiscriminatorType) {
- case STRING:
- return STRING;
- case CHAR:
- return CHAR;
- case INTEGER:
- return INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + ormDiscriminatorType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.DiscriminatorType toOrmResourceModel(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING;
- case CHAR:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.CHAR;
- case INTEGER:
- return org.eclipse.jpt.core.resource.orm.DiscriminatorType.INTEGER;
- default:
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java
deleted file mode 100644
index e5f4d18328..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Embeddable extends TypeMapping {
- // nothing yet
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java
deleted file mode 100644
index ec12f077bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddedIdMapping extends AttributeMapping, AttributeOverride.Owner
-{
-
- /**
- * Return a list iterator of the attribute overrides whether specified or default.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> attributeOverrides();
-
- /**
- * Return the number of attribute overrides, both specified and default.
- */
- int attributeOverridesSize();
-
- /**
- * Return a list iterator of the specified attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> specifiedAttributeOverrides();
- String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST = "specifiedAttributeOverridesList";
-
- /**
- * Return the number of specified attribute overrides.
- */
- int specifiedAttributeOverridesSize();
-
- /**
- * Return a list iterator of the default attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> defaultAttributeOverrides();
- String DEFAULT_ATTRIBUTE_OVERRIDES_LIST = "defaultAttributeOverridesList";
-
- /**
- * Return the number of default attribute overrides.
- */
- int defaultAttributeOverridesSize();
-
- /**
- * Add a specified attribute override to the entity return the object
- * representing it.
- */
- AttributeOverride addSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override from the entity.
- */
- void removeSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override at the index from the entity.
- */
- void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride);
-
- /**
- * Move the specified attribute override from the source index to the target index.
- */
- void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java
deleted file mode 100644
index ed51c23ce4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddedMapping extends AttributeMapping, AttributeOverride.Owner
-{
-
- /**
- * Return a list iterator of the attribute overrides whether specified or default.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> attributeOverrides();
-
- /**
- * Return the number of attribute overrides, both specified and default.
- */
- int attributeOverridesSize();
-
- /**
- * Return a list iterator of the specified attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> specifiedAttributeOverrides();
- String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST = "specifiedAttributeOverridesList";
-
- /**
- * Return the number of specified attribute overrides.
- */
- int specifiedAttributeOverridesSize();
-
- /**
- * Return a list iterator of the default attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> defaultAttributeOverrides();
- String DEFAULT_ATTRIBUTE_OVERRIDES_LIST = "defaultAttributeOverridesList";
-
- /**
- * Return the number of default attribute overrides.
- */
- int defaultAttributeOverridesSize();
-
- /**
- * Add a specified attribute override to the entity return the object
- * representing it.
- */
- AttributeOverride addSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override from the entity.
- */
- void removeSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override at the index from the entity.
- */
- void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride);
-
- /**
- * Move the specified attribute override from the source index to the target index.
- */
- void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java
deleted file mode 100644
index 2da1325058..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Entity extends TypeMapping
-{
- // **************** name **************************************
-
- /**
- * Return the name, specified or default if not specified.
- */
- String getName();
-
- /**
- * Return the specified name.
- */
- String getSpecifiedName();
-
- /**
- * Set the specified name on the entity.
- */
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedNameProperty";
-
- /**
- * Return the default name, based on the class name.
- */
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultNameProperty";
-
-
- // **************** table **************************************
-
- /**
- * Return the table for this entity, either specified or default.
- * This will not be null.
- */
- Table getTable();
-
-
- // **************** secondary tables **************************************
-
- /**
- * Return a list iterator of the secondary tables whether specified or default.
- * This will not be null.
- */
- <T extends SecondaryTable> ListIterator<T> secondaryTables();
-
- /**
- * Return the number of secondary tables, both specified and default.
- */
- int secondaryTablesSize();
-
- /**
- * Return a list iterator of the specified secondary tables.
- * This will not be null.
- */
- <T extends SecondaryTable> ListIterator<T> specifiedSecondaryTables();
-
- /**
- * Return the number of specified secondary tables.
- */
- int specifiedSecondaryTablesSize();
-
- /**
- * Add a specified secondary table to the entity return the object
- * representing it.
- */
- SecondaryTable addSpecifiedSecondaryTable(int index);
-
- /**
- * Remove the specified secondary table from the entity.
- */
- void removeSpecifiedSecondaryTable(int index);
-
- /**
- * Remove the specified secondary table at the index from the entity.
- */
- void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable);
-
- /**
- * Move the specified secondary table from the source index to the target index.
- */
- void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex);
- String SPECIFIED_SECONDARY_TABLES_LIST = "specifiedSecondaryTablesList";
-
-
- // **************** inheritance strategy **************************************
-
- InheritanceType getInheritanceStrategy();
-
- InheritanceType getDefaultInheritanceStrategy();
- String DEFAULT_INHERITANCE_STRATEGY_PROPERTY = "defaultInheritanceStrategyProperty";
-
- InheritanceType getSpecifiedInheritanceStrategy();
- void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType);
- String SPECIFIED_INHERITANCE_STRATEGY_PROPERTY = "specifiedInheritanceStrategyProperty";
-
-
- // **************** discriminator column **************************************
-
- DiscriminatorColumn getDiscriminatorColumn();
-
-
- // **************** discriminator value **************************************
-
- String getDiscriminatorValue();
-
- String getDefaultDiscriminatorValue();
- String DEFAULT_DISCRIMINATOR_VALUE_PROPERTY = "defaultDiscriminatorValueProperty";
-
- String getSpecifiedDiscriminatorValue();
- void setSpecifiedDiscriminatorValue(String value);
- String SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY = "specifiedDiscriminatorValueProperty";
-
- /**
- * Return whether a DiscriminatorValue is allowed for this Entity
- * It is allowed if the IType is concrete (not abstract)
- */
- //TODO add tests in java and xml for this
- boolean isDiscriminatorValueAllowed();
- String DISCRIMINATOR_VALUE_ALLOWED_PROPERTY = "discriminatorValueAllowedProperty";
-
-
- // **************** table generator **************************************
-
- TableGenerator getTableGenerator();
- TableGenerator addTableGenerator();
- void removeTableGenerator();
- String TABLE_GENERATOR_PROPERTY = "tableGeneratorProperty";
-
-
- // **************** sequence generator **************************************
-
- SequenceGenerator getSequenceGenerator();
- SequenceGenerator addSequenceGenerator();
- void removeSequenceGenerator();
- String SEQUENCE_GENERATOR_PROPERTY = "sequenceGeneratorProperty";
-
-
- // **************** primary key join columns **************************************
-
- <T extends PrimaryKeyJoinColumn> ListIterator<T> primaryKeyJoinColumns();
-
- int primaryKeyJoinColumnsSize();
-
- <T extends PrimaryKeyJoinColumn> ListIterator<T> specifiedPrimaryKeyJoinColumns();
- String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST = "specifiedPrimaryKeyJoinColumnsList";
-
- int specifiedPrimaryKeyJoinColumnsSize();
-
- PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- String DEFAULT_PRIMARY_KEY_JOIN_COLUMN = "defaultPrimaryKeyJoinColumn";
-
- PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- void removeSpecifiedPrimaryKeyJoinColumn(int index);
-
- void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn);
-
- void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex);
-
-
- // **************** attribute overrides **************************************
-
- /**
- * Return a list iterator of the attribute overrides whether specified or default.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> attributeOverrides();
-
- /**
- * Return the number of attribute overrides, both specified and default.
- */
- int attributeOverridesSize();
-
- /**
- * Return a list iterator of the specified attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> specifiedAttributeOverrides();
-
- /**
- * Return the number of specified attribute overrides.
- */
- int specifiedAttributeOverridesSize();
-
- /**
- * Return a list iterator of the default attribute overrides.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> defaultAttributeOverrides();
-
- /**
- * Return the number of default attribute overrides.
- */
- int defaultAttributeOverridesSize();
-
- /**
- * Add a specified attribute override to the entity return the object
- * representing it.
- */
- AttributeOverride addSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override from the entity.
- */
- void removeSpecifiedAttributeOverride(int index);
-
- /**
- * Remove the specified attribute override at the index from the entity.
- */
- void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride);
-
- /**
- * Move the specified attribute override from the source index to the target index.
- */
- void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex);
- String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST = "specifiedAttributeOverridesList";
- String DEFAULT_ATTRIBUTE_OVERRIDES_LIST = "defaultAttributeOverridesList";
-
- // **************** association overrides **************************************
-
- /**
- * Return a list iterator of the association overrides whether specified or default.
- * This will not be null.
- */
- <T extends AssociationOverride> ListIterator<T> associationOverrides();
-
- /**
- * Return the number of association overrides, both specified and default.
- */
- int associationOverridesSize();
-
- /**
- * Return a list iterator of the specified association overrides.
- * This will not be null.
- */
- <T extends AssociationOverride> ListIterator<T> specifiedAssociationOverrides();
-
- /**
- * Return the number of specified association overrides.
- */
- int specifiedAssociationOverridesSize();
-
- /**
- * Return the number of default association overrides.
- */
- <T extends AssociationOverride> ListIterator<T> defaultAssociationOverrides();
-
- /**
- * Return the number of default association overrides.
- */
- int defaultAssociationOverridesSize();
-
- /**
- * Add a specified association override to the entity return the object
- * representing it.
- */
- AssociationOverride addSpecifiedAssociationOverride(int index);
-
- /**
- * Remove the specified association override at the index from the entity.
- */
- void removeSpecifiedAssociationOverride(int index);
-
- /**
- * Remove the specified association override from the entity.
- */
- void removeSpecifiedAssociationOverride(AssociationOverride associationOverride);
-
- /**
- * Move the specified association override from the source index to the target index.
- */
- void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex);
- String SPECIFIED_ASSOCIATION_OVERRIDES_LIST = "specifiedAssociationOverridesList";
- String DEFAULT_ASSOCIATION_OVERRIDES_LIST = "defaulAssociationOverridesList";
-
-
- // **************** named queries **************************************
-
- /**
- * Return a list iterator of the named queries.
- * This will not be null.
- */
- <T extends NamedQuery> ListIterator<T> namedQueries();
-
- /**
- * Return the number of named queries.
- */
- int namedQueriesSize();
-
- /**
- * Add a named query to the entity return the object representing it.
- */
- NamedQuery addNamedQuery(int index);
-
- /**
- * Remove the named query at the index from the entity.
- */
- void removeNamedQuery(int index);
-
- /**
- * Remove the named query at from the entity.
- */
- void removeNamedQuery(NamedQuery namedQuery);
-
- /**
- * Move the named query from the source index to the target index.
- */
- void moveNamedQuery(int targetIndex, int sourceIndex);
- String NAMED_QUERIES_LIST = "namedQueriesList";
-
-
- // **************** named native queries **************************************
-
- /**
- * Return a list iterator of the specified named native queries.
- * This will not be null.
- */
- <T extends NamedNativeQuery> ListIterator<T> namedNativeQueries();
-
- /**
- * Return the number of named native queries.
- */
- int namedNativeQueriesSize();
-
- /**
- * Add a named native query to the entity return the object representing it.
- */
- NamedNativeQuery addNamedNativeQuery(int index);
-
- /**
- * Remove the named native query at the index from the entity.
- */
- void removeNamedNativeQuery(int index);
-
- /**
- * Remove the named native query at from the entity.
- */
- void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery);
-
- /**
- * Move the named native query from the source index to the target index.
- */
- void moveNamedNativeQuery(int targetIndex, int sourceIndex);
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueriesList";
-
-
- // **************** id class **************************************
-
- String getIdClass();
- void setIdClass(String value);
- String ID_CLASS_PROPERTY = "idClassProperty";
-
- /**
- * Return the ultimate top of the inheritance hierarchy
- * This method should never return null. The root
- * is defined as the persistent type in the inheritance hierarchy
- * that has no parent. The root should be an entity
- *
- * Non-entities in the hierarchy should be ignored, ie skip
- * over them in the search for the root.
- */
- Entity rootEntity();
-
- /**
- * The first parent in the class hierarchy that is an entity.
- * This is the parent in the entity (persistent) inheritance hierarchy
- * (vs class inheritance hierarchy)
- */
- Entity parentEntity();
-
- /**
- * Return the name of the entity's primary key column.
- * Return null if the entity's primary key is "compound"
- * (i.e. the primary key is composed of multiple columns).
- */
- String primaryKeyColumnName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java
deleted file mode 100644
index 09fab0ab60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum EnumType {
-
- ORDINAL,
- STRING;
-
-
- public static EnumType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.EnumType javaEnumType) {
- if (javaEnumType == null) {
- return null;
- }
- switch (javaEnumType) {
- case ORDINAL:
- return ORDINAL;
- case STRING:
- return STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + javaEnumType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.EnumType toJavaResourceModel(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL:
- return org.eclipse.jpt.core.resource.java.EnumType.ORDINAL;
- case STRING:
- return org.eclipse.jpt.core.resource.java.EnumType.STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-
-
- public static EnumType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.EnumType ormEnumType) {
- if (ormEnumType == null) {
- return null;
- }
- switch (ormEnumType) {
- case ORDINAL:
- return ORDINAL;
- case STRING:
- return STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + ormEnumType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.EnumType toOrmResourceModel(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL:
- return org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL;
- case STRING:
- return org.eclipse.jpt.core.resource.orm.EnumType.STRING;
- default:
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java
deleted file mode 100644
index 86aadee6d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum FetchType {
-
- EAGER,
- LAZY;
-
-
- public static FetchType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.FetchType javaFetchType) {
- if (javaFetchType == null) {
- return null;
- }
- switch (javaFetchType) {
- case EAGER:
- return EAGER;
- case LAZY:
- return LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + javaFetchType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.FetchType toJavaResourceModel(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER:
- return org.eclipse.jpt.core.resource.java.FetchType.EAGER;
- case LAZY:
- return org.eclipse.jpt.core.resource.java.FetchType.LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-
-
- public static FetchType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.FetchType ormFetchType) {
- if (ormFetchType == null) {
- return null;
- }
- switch (ormFetchType) {
- case EAGER:
- return EAGER;
- case LAZY:
- return LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + ormFetchType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.FetchType toOrmResourceModel(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER:
- return org.eclipse.jpt.core.resource.orm.FetchType.EAGER;
- case LAZY:
- return org.eclipse.jpt.core.resource.orm.FetchType.LAZY;
- default:
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java
deleted file mode 100644
index 87e3d2adfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Fetchable extends AttributeMapping
-{
- FetchType getFetch();
-
- FetchType getDefaultFetch();
- String DEFAULT_FETCH_PROPERTY = "defaultFetchProperty";
-
- FetchType getSpecifiedFetch();
- void setSpecifiedFetch(FetchType newSpecifiedFetch);
- String SPECIFIED_FETCH_PROPERTY = "specifiedFetchProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java
deleted file mode 100644
index bfd873f0f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface GeneratedValue extends JpaContextNode
-{
-
- GenerationType getStrategy();
- GenerationType getDefaultStrategy();
- GenerationType getSpecifiedStrategy();
- void setSpecifiedStrategy(GenerationType value);
- String SPECIFIED_STRATEGY_PROPERTY = "specifiedStrategyProperty";
- String DEFAULT_STRATEGY_PROPERTY = "defaultStrategyProperty";
-
- String getGenerator();
- String getDefaultGenerator();
- GenerationType DEFAULT_STRATEGY = GenerationType.AUTO;
- String getSpecifiedGenerator();
- void setSpecifiedGenerator(String value);
- String SPECIFIED_GENERATOR_PROPERTY = "specifiedGeneratorProperty";
- String DEFAULT_GENERATOR_PROPERTY = "defaultGeneratorProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java
deleted file mode 100644
index d46990d054..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum GenerationType {
-
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO;
-
-
- public static GenerationType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType) {
- if (javaGenerationType == null) {
- return null;
- }
- switch (javaGenerationType) {
- case TABLE:
- return TABLE;
- case SEQUENCE:
- return SEQUENCE;
- case IDENTITY:
- return IDENTITY;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + javaGenerationType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.GenerationType toJavaResourceModel(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE:
- return org.eclipse.jpt.core.resource.java.GenerationType.TABLE;
- case SEQUENCE:
- return org.eclipse.jpt.core.resource.java.GenerationType.SEQUENCE;
- case IDENTITY:
- return org.eclipse.jpt.core.resource.java.GenerationType.IDENTITY;
- case AUTO:
- return org.eclipse.jpt.core.resource.java.GenerationType.AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-
- public static GenerationType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType) {
- if (ormGenerationType == null) {
- return null;
- }
- switch (ormGenerationType) {
- case TABLE:
- return TABLE;
- case SEQUENCE:
- return SEQUENCE;
- case IDENTITY:
- return IDENTITY;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + ormGenerationType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.GenerationType toOrmResourceModel(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE:
- return org.eclipse.jpt.core.resource.orm.GenerationType.TABLE;
- case SEQUENCE:
- return org.eclipse.jpt.core.resource.orm.GenerationType.SEQUENCE;
- case IDENTITY:
- return org.eclipse.jpt.core.resource.orm.GenerationType.IDENTITY;
- case AUTO:
- return org.eclipse.jpt.core.resource.orm.GenerationType.AUTO;
- default:
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java
deleted file mode 100644
index 019ab38500..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Generator extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- Integer getInitialValue();
-
- Integer getDefaultInitialValue();
- String DEFAULT_INITIAL_VALUE_PROPERTY = "defaultInitialValueProperty";
-
- Integer getSpecifiedInitialValue();
- void setSpecifiedInitialValue(Integer value);
- String SPECIFIED_INITIAL_VALUE_PROPERTY = "specifiedInitialValueProperty";
-
-
- Integer getAllocationSize();
-
- Integer getDefaultAllocationSize();
- Integer DEFAULT_ALLOCATION_SIZE = Integer.valueOf(50);
- String DEFAULT_ALLOCATION_SIZE_PROPERTY = "defaultAllocationSizeProperty";
-
- Integer getSpecifiedAllocationSize();
- void setSpecifiedAllocationSize(Integer value);
- String SPECIFIED_ALLOCATION_SIZE_PROPERTY = "specifiedAllocationSizeProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java
deleted file mode 100644
index 29f83d9477..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface IdMapping extends AttributeMapping, ColumnMapping
-{
- GeneratedValue getGeneratedValue();
- GeneratedValue addGeneratedValue();
- void removeGeneratedValue();
- String GENERATED_VALUE_PROPERTY = "generatedValueProperty";
-
- TableGenerator getTableGenerator();
- TableGenerator addTableGenerator();
- void removeTableGenerator();
- String TABLE_GENERATOR_PROPERTY = "tableGeneratorProperty";
-
- SequenceGenerator getSequenceGenerator();
- SequenceGenerator addSequenceGenerator();
- void removeSequenceGenerator();
- String SEQUENCE_GENERATOR_PROPERTY = "sequenceGeneratorProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java
deleted file mode 100644
index a84b805c12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum InheritanceType {
-
-
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS;
-
-
- public static InheritanceType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType) {
- if (javaInheritanceType == null) {
- return null;
- }
- switch (javaInheritanceType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case JOINED:
- return JOINED;
- case TABLE_PER_CLASS:
- return TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + javaInheritanceType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.InheritanceType toJavaResourceModel(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.core.resource.java.InheritanceType.SINGLE_TABLE;
- case JOINED:
- return org.eclipse.jpt.core.resource.java.InheritanceType.JOINED;
- case TABLE_PER_CLASS:
- return org.eclipse.jpt.core.resource.java.InheritanceType.TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-
-
- public static InheritanceType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType) {
- if (ormInheritanceType == null) {
- return null;
- }
- switch (ormInheritanceType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case JOINED:
- return JOINED;
- case TABLE_PER_CLASS:
- return TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + ormInheritanceType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.InheritanceType toOrmResourceModel(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.SINGLE_TABLE;
- case JOINED:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.JOINED;
- case TABLE_PER_CLASS:
- return org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS;
- default:
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java
deleted file mode 100644
index 24695e2453..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinColumn extends AbstractColumn, AbstractJoinColumn
-{
- JoinColumn.Owner owner();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends AbstractJoinColumn.Owner, AbstractColumn.Owner
- {
- /**
- * return whether the specified table cannot be explicitly specified
- * in the join column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * return whether the join column's table can be specified explicitly
- */
- boolean tableIsAllowed();
-
- /**
- * return the entity referenced by the join column
- */
- Entity targetEntity();
-
- /**
- * return the join column's attribute name
- */
- String attributeName();
-
- /**
- * return the relationship mapping for this join column
- */
- RelationshipMapping relationshipMapping();
-
- /**
- * return the size of the joinColumns collection this join column is a part of
- */
- int joinColumnsSize();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java
deleted file mode 100644
index 0405df1710..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinTable extends Table
-{
-
- RelationshipMapping parent();
-
- // **************** join columns **************************************
-
- /**
- * Return a list iterator of the join columns whether specified or default.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> joinColumns();
-
- /**
- * Return the number of join columns, both specified and default.
- */
- int joinColumnsSize();
-
- /**
- * Return a list iterator of the specified join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
-
- /**
- * Return the number of specified join columns.
- */
- int specifiedJoinColumnsSize();
-
- /**
- * Return the default join column or null. A default join column
- * only exists if there are no specified join columns.
- */
- JoinColumn getDefaultJoinColumn();
- String DEFAULT_JOIN_COLUMN = "defaultJoinColumn";
-
- /**
- * Add a specified join column to the join table return the object
- * representing it.
- */
- JoinColumn addSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column from the join table.
- */
- void removeSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column at the index from the join table.
- */
- void removeSpecifiedJoinColumn(JoinColumn joinColumn);
-
- /**
- * Move the specified join column from the source index to the target index.
- */
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
-
- boolean containsSpecifiedJoinColumns();
-
-
- // **************** inverse join columns **************************************
-
- /**
- * Return a list iterator of the inverse join columns whether specified or default.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> inverseJoinColumns();
-
- /**
- * Return the number of inverse join columns, both specified and default.
- */
- int inverseJoinColumnsSize();
-
- /**
- * Return a list iterator of the specified inverse join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedInverseJoinColumns();
- String SPECIFIED_INVERSE_JOIN_COLUMNS_LIST = "specifiedInverseJoinColumnsList";
-
- /**
- * Return the number of specified inverse join columns.
- */
- int specifiedInverseJoinColumnsSize();
-
- /**
- * Return the default inverse join column or null. A default inverse join column
- * only exists if there are no specified inverse join columns.
- */
- JoinColumn getDefaultInverseJoinColumn();
- String DEFAULT_INVERSE_JOIN_COLUMN = "defaultInverseJoinColumn";
-
- /**
- * Add a specified inverse join column to the join table return the object
- * representing it.
- */
- JoinColumn addSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the specified inverse join column from the join table.
- */
- void removeSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the specified inverse join column at the index from the join table.
- */
- void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn);
-
-
- /**
- * Move the specified inverse join column from the source index to the target index.
- */
- void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex);
-
- boolean containsSpecifiedInverseJoinColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java
deleted file mode 100644
index 7f70ae9532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaContextNode extends JpaNode
-{
- PersistenceUnit persistenceUnit();
-
- /**
- * Return the EntityMappings if this contextNode is within an orm.xml context
- * Return null otherwise.
- */
- EntityMappings entityMappings();
-
- OrmPersistentType ormPersistentType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java
deleted file mode 100644
index 7fac7a8a83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ManyToManyMapping extends MultiRelationshipMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java
deleted file mode 100644
index c28576c1a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ManyToOneMapping extends SingleRelationshipMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java
deleted file mode 100644
index 1b569f3c84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappedSuperclass extends TypeMapping
-{
- String getIdClass();
- void setIdClass(String value);
- String ID_CLASS_PROPERTY = "idClassProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
deleted file mode 100644
index dd1141aff4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MultiRelationshipMapping extends NonOwningMapping
-{
- FetchType DEFAULT_FETCH_TYPE = FetchType.LAZY;
-
- String getOrderBy();
- void setOrderBy(String value);
- String ORDER_BY_PROPERTY = "orderByProperty";
-
-
- boolean isNoOrdering();
- void setNoOrdering(boolean newNoOrdering);
- String NO_ORDERING_PROPERTY = "noOrderingProperty";
-
- boolean isPkOrdering();
- void setPkOrdering(boolean newPkOrdering);
- String PK_ORDERING_PROPERTY = "pkOrderingProperty";
-
- boolean isCustomOrdering();
- void setCustomOrdering(boolean newCustomOrdering);
- String CUSTOM_ORDERING_PROPERTY = "customOrderingProperty";
-
-
- JoinTable getJoinTable();
-
- boolean isJoinTableSpecified();
-
-
- String getMapKey();
- void setMapKey(String value);
- String MAP_KEY_PROPERTY = "mapKeyProperty";
-
- Iterator<String> candidateMapKeyNames();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java
deleted file mode 100644
index 6f86b28f62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedColumn extends JpaContextNode
-{
- String getName();
-
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultNameProperty";
-
- String getSpecifiedName();
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedNameProperty";
-
-
- String getColumnDefinition();
-
- void setColumnDefinition(String value);
- String COLUMN_DEFINITION_PROPERTY = "columnDefinitionProperty";
-
-
- /**
- * Return the wrapper for the datasource column
- */
- Column dbColumn();
-
- /**
- * Return the wrapper for the datasource table
- */
- Table dbTable();
-
- /**
- * Return whether the column is found on the datasource.
- */
- boolean isResolved();
-
- Owner owner();
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner
- {
- /**
- * Return the type mapping that contains the column.
- */
- TypeMapping typeMapping();
-
- /**
- * Return the wrapper for the datasource table for the given table name
- */
- Table dbTable(String tableName);
-
- /**
- * Return the default column name
- */
- String defaultColumnName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java
deleted file mode 100644
index f93e9ee565..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedNativeQuery extends Query
-{
- String getResultClass();
- void setResultClass(String value);
- String RESULT_CLASS_PROPERTY = "resultClassProperty";
-
- String getResultSetMapping();
- void setResultSetMapping(String value);
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMappingProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java
deleted file mode 100644
index 8e9520c307..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedQuery extends Query {
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java
deleted file mode 100644
index e83031bd0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NonOwningMapping.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.Iterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NonOwningMapping extends RelationshipMapping
-{
- String getMappedBy();
- void setMappedBy(String value);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- Iterator<String> candidateMappedByAttributeNames();
-
- boolean mappedByIsValid(AttributeMapping mappedByMapping);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java
deleted file mode 100644
index cc292f61a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-
-/**
- * This interface is used for mappings that support the optional element.
- * From the JPA spec:
- * Whether the value of the field or property may be null. This is a hint
- * and is disregarded for primitive types; it may be used in schema generation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Nullable extends AttributeMapping
-{
- Boolean getOptional();
-
- Boolean getDefaultOptional();
- String DEFAULT_OPTIONAL_PROPERTY = "defaultOptionalProperty";
- Boolean DEFAULT_OPTIONAL = Boolean.TRUE;
-
- Boolean getSpecifiedOptional();
- void setSpecifiedOptional(Boolean newSpecifiedOptional);
- String SPECIFIED_OPTIONAL_PROPERTY = "specifiedOptionalProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java
deleted file mode 100644
index 339f2b8e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OneToManyMapping extends MultiRelationshipMapping {
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java
deleted file mode 100644
index 0906cc80a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OneToOneMapping
- extends SingleRelationshipMapping, NonOwningMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java
deleted file mode 100644
index 832812237b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistentAttribute extends JpaContextNode, JpaStructureNode
-{
- String getName();
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the key for the attribute's mapping.
- * The key may be for either the "specified" mapping or, if the "specified"
- * mapping is missing, the "default" mapping.
- */
- String mappingKey();
-
- /**
- * Return the key for the attribute's "default" mapping.
- */
- String defaultMappingKey();
-
- /**
- * Return the attribute's "specified" mapping, or if it is null
- * return the "default" mapping. WIll not return null.
- */
- AttributeMapping getMapping();
-
- /**
- * Return the attribute's "specified" mapping, could be null
- */
- AttributeMapping getSpecifiedMapping();
-
- /**
- * Clients should call this method to set the attribute's mapping.
- * Passing in a null key will cause the "specified" mapping to be
- * cleared and the attribute's mapping to be its "default" mapping.
- */
- void setSpecifiedMappingKey(String key);
- String SPECIFIED_MAPPING_PROPERTY = "specifiedMappingProperty";
- String DEFAULT_MAPPING_PROPERTY = "defaultMappingProperty";
-
- TypeMapping typeMapping();
-
- PersistentType persistentType();
-
- /**
- * If the attribute is mapped to a primary key column, return the
- * column's name, otherwise return null.
- */
- String primaryKeyColumnName();
-
- /**
- * Return whether the attribute's "attribute" mapping can be overridden.
- */
- boolean isOverridableAttribute();
-
- /**
- * Return whether the attribute's "association" mapping can be overridden.
- */
- boolean isOverridableAssociation();
-
- /**
- * Return whether the attribute's "attribute" mapping is for an ID.
- */
- boolean isIdAttribute();
-
- /**
- * Return whether this attribute actually has a textual representation
- * in its underlying resource (false = no)
- */
- boolean isVirtual();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java
deleted file mode 100644
index e978f58f73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistentType extends JpaContextNode, JpaStructureNode
-{
- String getName();
- String NAME_PROPERTY = "nameProperty";
-
- AccessType access();
- String ACCESS_PROPERTY = "accessProperty";
-
- TypeMapping getMapping();
- String mappingKey();
- void setMappingKey(String key);
- String MAPPING_PROPERTY = "mappingProperty";
-
- boolean isMapped();
-
-
- /**
- * Return the parent {@link PersistentType} from the inheritance hierarchy.
- * If the java inheritance parent is not a {@link PersistentType} then continue
- * up the hierarchy(the JPA spec allows non-persistent types to be part of the hierarchy.)
- * Return null if this persistentType is the root persistent type.
- * Example:
- * <pre>
- * &#64;Entity
- * public abstract class Model {}
- * <a>
- * public abstract class Animal extends Model {}
- * <a>
- * &#64;Entity
- * public class Cat extends Animal {}
- * </pre>
- *
- * If this is the Cat JavaPersistentType then parentPersistentType is the Model JavaPersistentType
- * The parentPersistentType could be found in java or xml.
- */
- PersistentType parentPersistentType();
-
- /**
- * Return a read-only iterator of the contained {@link PersistentAttribute}
- */
- <T extends PersistentAttribute> ListIterator<T> attributes();
-
- /**
- * Return the size of {@link PersistentAttribute}s list
- * @return
- */
- int attributesSize();
- String SPECIFIED_ATTRIBUTES_LIST = "specifiedAttributesList";
-
- Iterator<String> attributeNames();
-
- /**
- * Return a read-only iterator of the all the {@link PersistentAttribute}s
- * in the hierarchy
- */
- Iterator<PersistentAttribute> allAttributes();
-
- Iterator<String> allAttributeNames();
-
- /**
- * Return the attribute named <code>attributeName</code> if
- * it exists locally on this type
- */
- PersistentAttribute attributeNamed(String attributeName);
-
- /**
- * Resolve and return the attribute named <code>attributeName</code> if it
- * is distinct and exists within the context of this type
- */
- PersistentAttribute resolveAttribute(String attributeName);
-
- Iterator<PersistentType> inheritanceHierarchy();
-
-
- // **************** validation **************************************
-
- /**
- * Add to the list of current validation messages
- */
- void addToMessages(List<IMessage> messages);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java
deleted file mode 100644
index 0550f9cc68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PrimaryKeyJoinColumn
- extends AbstractJoinColumn
-{
- // nothing yet
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
deleted file mode 100644
index 851e1157e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Query extends JpaContextNode
-{
-
- //************************ name ***********************
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- //************************ query ***********************
-
- String getQuery();
- void setQuery(String value);
- String QUERY_PROPERTY = "queryProperty";
-
-
- //************************ hints ***********************
- /**
- * Return a list iterator of the hints. This will not be null.
- */
- <T extends QueryHint> ListIterator<T> hints();
-
- /**
- * Return the number of hints.
- */
- int hintsSize();
-
- /**
- * Add a hint to the query and return the object representing it.
- */
- QueryHint addHint(int index);
-
- /**
- * Remove the hint from the query.
- */
- void removeHint(int index);
-
- /**
- * Remove the hint at the index from the query.
- */
- void removeHint(QueryHint queryHint);
-
- /**
- * Move the hint from the source index to the target index.
- */
- void moveHint(int targetIndex, int sourceIndex);
- String HINTS_LIST = "hintsList";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java
deleted file mode 100644
index a4f51c808e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface QueryHint extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "nameProperty";
-
- String getValue();
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java
deleted file mode 100644
index e4164dddb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface RelationshipMapping extends AttributeMapping, Fetchable
-{
-
- // **************** target entity **************************************
-
- String getTargetEntity();
-
- String getSpecifiedTargetEntity();
- void setSpecifiedTargetEntity(String value);
- String SPECIFIED_TARGET_ENTITY_PROPERTY = "specifiedTargetEntityProperty";
-
- String getDefaultTargetEntity();
- String DEFAULT_TARGET_ENTITY_PROPERTY = "defaultTargetEntityProperty";
-
- Entity getResolvedTargetEntity();
- String RESOLVED_TARGET_ENTITY_PROPERTY = "resolvedTargetEntityProperty";
-
- /**
- * Return whether the specified 'targetEntity' is valid.
- */
- boolean targetEntityIsValid(String targetEntity);
-
-
- // **************** cascade **************************************
-
- Cascade getCascade();
-
-
- /**
- * Return the Entity that owns this relationship mapping
- * @return
- */
- Entity getEntity();
-
- /**
- * Return whether this mapping is the owning side of the relationship.
- * Either this is a unidirectional mapping or it is the owning side of a bidirectional
- * relationship. If bidirectional, the owning side is the side that doesn't specify
- * mappedBy. This is the side where a join table would be specified
- */
- boolean isRelationshipOwner();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java
deleted file mode 100644
index 2d2ecd3593..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SecondaryTable extends Table
-{
-
- public Entity parent();
-
- /**
- * Return a list iterator of the primary key join columns whether specified or default.
- * This will not be null.
- */
- <T extends PrimaryKeyJoinColumn> ListIterator<T> primaryKeyJoinColumns();
- String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST = "specifiedPrimaryKeyJoinColumnsList";
-
- /**
- * Return the number of primary key join columns, both specified and default.
- */
- int primaryKeyJoinColumnsSize();
-
- /**
- * Return a list iterator of the specified primary key join columns.
- * This will not be null.
- */
- <T extends PrimaryKeyJoinColumn> ListIterator<T> specifiedPrimaryKeyJoinColumns();
-
- /**
- * Return the number of specified primary key join columns.
- */
- int specifiedPrimaryKeyJoinColumnsSize();
-
- /**
- * Return the default primary key join column or null. A default primary key join column
- * only exists if there are no specified primary key join columns.
- */
- PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- String DEFAULT_PRIMARY_KEY_JOIN_COLUMN = "defaultPrimaryKeyJoinColumn";
-
- /**
- * Add a specified primary key join column to the secondary table return the object
- * representing it.
- */
- PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified primary key join column from the secondary table.
- */
- void removeSpecifiedPrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified primary key join column at the index from the secondary table.
- */
- void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn);
-
- /**
- * Move the specified primary key join column from the source index to the target index.
- */
- void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex);
-
-
-// boolean containsSpecifiedPrimaryKeyJoinColumns();
-//
-// boolean isVirtual();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java
deleted file mode 100644
index 2c0a252b2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SequenceGenerator extends Generator
-{
- Integer DEFAULT_INITIAL_VALUE = Integer.valueOf(1);
-
- String getSequenceName();
-
- String getDefaultSequenceName();
- String DEFAULT_SEQUENCE_NAME_PROPERTY = "defaultSequenceNameProperty";
- String getSpecifiedSequenceName();
- void setSpecifiedSequenceName(String value);
- String SPECIFIED_SEQUENCE_NAME_PROPERTY = "specifiedSequenceNameProperty";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java
deleted file mode 100644
index 4b0962e396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SingleRelationshipMapping extends RelationshipMapping, Nullable
-{
-
- // **************** fetch type **************************************
-
- FetchType DEFAULT_FETCH_TYPE = FetchType.EAGER;
-
- // **************** join columns **************************************
-
- /**
- * Return a list iterator of the join columns whether specified or default.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> joinColumns();
-
- /**
- * Return the number of join columns, both specified and default.
- */
- int joinColumnsSize();
-
- /**
- * Return a list iterator of the specified join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumnsList";
-
- /**
- * Return the number of specified join columns.
- */
- int specifiedJoinColumnsSize();
-
- /**
- * Return the default join column or null. A default join column
- * only exists if there are no specified join columns.
- */
- JoinColumn getDefaultJoinColumn();
- String DEFAULT_JOIN_COLUMN = "defaultJoinColumn";
-
- /**
- * Add a specified join column to the join table return the object
- * representing it.
- */
- JoinColumn addSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column from the join table.
- */
- void removeSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column at the index from the join table.
- */
- void removeSpecifiedJoinColumn(JoinColumn joinColumn);
-
- /**
- * Move the specified join column from the source index to the target index.
- */
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
-
- boolean containsSpecifiedJoinColumns();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java
deleted file mode 100644
index 1003445466..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.db.internal.Schema;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Table extends JpaContextNode
-{
- String getName();
-
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultNameProperty";
-
- String getSpecifiedName();
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedNameProperty";
-
- String getCatalog();
-
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalogProperty";
-
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalogProperty";
-
-
- String getSchema();
-
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchemaProperty";
-
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchemaProperty";
-
-
-// EList<IUniqueConstraint> getUniqueConstraints();
-// IUniqueConstraint createUniqueConstraint(int index);
-
- org.eclipse.jpt.db.internal.Table dbTable();
-
- Schema dbSchema();
-
- /**
- * Return true if this table is connected to a datasource
- */
- boolean isConnected();
-
- /**
- * Return true if this table's schema can be resolved to a schema on the active connection
- */
- boolean hasResolvedSchema();
-
- /**
- * Return true if this can be resolved to a table on the active connection
- */
- boolean isResolved();
-
-
-//
-// class UniqueConstraintOwner implements IUniqueConstraint.Owner
-// {
-// private final ITable table;
-//
-// public UniqueConstraintOwner(ITable table) {
-// super();
-// this.table = table;
-// }
-//
-// public Iterator<String> candidateUniqueConstraintColumnNames() {
-// return this.table.dbTable().columnNames();
-// }
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java
deleted file mode 100644
index 7533761114..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TableGenerator extends Generator
-{
- Integer DEFAULT_INITIAL_VALUE = Integer.valueOf(0);
-
- String getTable();
-
- String getDefaultTable();
- String DEFAULT_TABLE_PROPERTY = "defaultTableProperty";
- String getSpecifiedTable();
- void setSpecifiedTable(String value);
- String SPECIFIED_TABLE_PROPERTY = "specifiedTableProperty";
-
-
-
- String getCatalog();
-
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalogProperty";
-
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalogProperty";
-
-
-
- String getSchema();
-
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchemaProperty";
-
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchemaProperty";
-
-
-
- String getPkColumnName();
-
- String getDefaultPkColumnName();
- String DEFAULT_PK_COLUMN_NAME_PROPERTY = "defaultPkColumnNameProperty";
-
- String getSpecifiedPkColumnName();
- void setSpecifiedPkColumnName(String value);
- String SPECIFIED_PK_COLUMN_NAME_PROPERTY = "specifiedPkColumnNameProperty";
-
-
- String getValueColumnName();
-
- String getDefaultValueColumnName();
- String DEFAULT_VALUE_COLUMN_NAME_PROPERTY = "defaultValueColumnNameProperty";
-
- String getSpecifiedValueColumnName();
- void setSpecifiedValueColumnName(String value);
- String SPECIFIED_VALUE_COLUMN_NAME_PROPERTY = "specifiedValueColumnNameProperty";
-
-
- String getPkColumnValue();
-
- String getDefaultPkColumnValue();
- String DEFAULT_PK_COLUMN_VALUE_PROPERTY = "defaultPkColummValueProperty";
-
- String getSpecifiedPkColumnValue();
- void setSpecifiedPkColumnValue(String value);
- String SPECIFIED_PK_COLUMN_VALUE_PROPERTY = "specifiedPkColummValueProperty";
-
-
-// EList<IUniqueConstraint> getUniqueConstraints();
-
-// IUniqueConstraint createUniqueConstraint(int index);
-
- /**
- * Return a db Schema object with the specified/default schema name.
- * This can return null if no Schema exists on the database with that name.
- */
- Schema dbSchema();
-
- /**
- * Return a db Table object with the specified/default table name.
- * This can return null if no Table exists on the database with that name.
- */
- Table dbTable();
-
-
-// class UniqueConstraintOwner implements IUniqueConstraint.Owner
-// {
-// private final ITableGenerator tableGenerator;
-//
-// public UniqueConstraintOwner(ITableGenerator tableGenerator) {
-// super();
-// this.tableGenerator = tableGenerator;
-// }
-//
-// public Iterator<String> candidateUniqueConstraintColumnNames() {
-// return this.tableGenerator.dbTable().columnNames();
-// }
-// }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java
deleted file mode 100644
index bc10bbb5f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum TemporalType {
-
- DATE,
- TIME,
- TIMESTAMP;
-
-
- public static TemporalType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType) {
- if (javaTemporalType == null) {
- return null;
- }
- switch (javaTemporalType) {
- case DATE:
- return DATE;
- case TIME:
- return TIME;
- case TIMESTAMP:
- return TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + javaTemporalType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.java.TemporalType toJavaResourceModel(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE:
- return org.eclipse.jpt.core.resource.java.TemporalType.DATE;
- case TIME:
- return org.eclipse.jpt.core.resource.java.TemporalType.TIME;
- case TIMESTAMP:
- return org.eclipse.jpt.core.resource.java.TemporalType.TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-
-
- public static TemporalType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType) {
- if (ormTemporalType == null) {
- return null;
- }
- switch (ormTemporalType) {
- case DATE:
- return DATE;
- case TIME:
- return TIME;
- case TIMESTAMP:
- return TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + ormTemporalType);
- }
- }
-
- public static org.eclipse.jpt.core.resource.orm.TemporalType toOrmResourceModel(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE:
- return org.eclipse.jpt.core.resource.orm.TemporalType.DATE;
- case TIME:
- return org.eclipse.jpt.core.resource.orm.TemporalType.TIME;
- case TIMESTAMP:
- return org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP;
- default:
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java
deleted file mode 100644
index 3ebd4cf788..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TransientMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java
deleted file mode 100644
index f8ae516647..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.db.internal.Schema;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TypeMapping extends JpaContextNode
-{
- /**
- * Return a unique key for the ITypeMapping. If this is defined in
- * an extension they should be equal.
- * @return
- */
- String getKey();
-
- PersistentType persistentType();
-
- boolean isMapped();
-
- /**
- * Return the type mapping's primary table name, null if a primary table does not apply
- */
- String tableName();
-
- /**
- * Return the type mapping's "associated" tables, which includes the
- * primary table and the collection of secondary tables.
- */
- Iterator<Table> associatedTables();
-
- /**
- * Return the type mapping's "associated" tables, which includes the
- * primary table and the collection of secondary tables, as well as all
- * inherited "associated" tables.
- */
- Iterator<Table> associatedTablesIncludingInherited();
-
- /**
- * Return the names of the type mapping's "associated" tables,
- * which includes the primary table and the collection of secondary
- * tables, as well as the names of all the inherited "associated" tables.
- */
- Iterator<String> associatedTableNamesIncludingInherited();
-
- /**
- * return the resolved primary db table
- */
- org.eclipse.jpt.db.internal.Table primaryDbTable();
-
- Schema dbSchema();
-
- /**
- * return the resolved associated db table with the passed in name
- */
- org.eclipse.jpt.db.internal.Table dbTable(String tableName);
-
- /**
- * Return whether the specified table is invalid for any annotations
- * associated with the type mapping.
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * Return an Iterator of attribute names. The attributes must be BasicMappings or IdMappings
- * found in any MappedSuperclass in the inheritance hierarchy
- */
- Iterator<String> overridableAttributeNames();
-
- /**
- * Return an Iterator of attribute names. The attributes must be OneToOneMappings or ManyToOneMappings
- * found in any MappedSuperclass in the inheritance hierarchy
- */
- Iterator<String> overridableAssociationNames();
-
- Iterator<String> allOverridableAttributeNames();
-
- Iterator<String> allOverridableAssociationNames();
-
- /**
- * Return whether the given attribute mapping key is valid for this particular
- * type mapping
- * (for example, id's are not valid for an embeddable type mapping)
- */
- boolean attributeMappingKeyAllowed(String attributeMappingKey);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java
deleted file mode 100644
index 333d0de0e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface VersionMapping
- extends AttributeMapping, ColumnMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java
deleted file mode 100644
index 43f3700ba4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/DefaultJavaAttributeMappingProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation adapter.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DefaultJavaAttributeMappingProvider extends JavaAttributeMappingProvider {
-
- /**
- * Given the IJavaPersistentAttribute return whether the default mapping applies.
- * This will be used to determine the default mapping in the case where no
- * mapping has been specified.
- */
- boolean defaultApplies(JavaPersistentAttribute persistentAttribute);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractColumn.java
deleted file mode 100644
index 2d10d5d19a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractColumn.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractColumn;
-
-
-public interface JavaAbstractColumn extends AbstractColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange tableTextRange(CompilationUnit astRoot);
-
- Owner owner();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends JavaNamedColumn.Owner, AbstractColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractJoinColumn.java
deleted file mode 100644
index 5fe2a25c33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAbstractJoinColumn.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-
-public interface JavaAbstractJoinColumn extends AbstractJoinColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange referencedColumnNameTextRange(CompilationUnit astRoot);
-
-
- Owner owner();
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends AbstractJoinColumn.Owner, JavaNamedColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java
deleted file mode 100644
index 8e015b48de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaAssociationOverride extends AssociationOverride, JavaJpaContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> defaultJoinColumns();
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
- void initializeFromResource(AssociationOverrideAnnotation associationOverride);
-
- void update(AssociationOverrideAnnotation associationOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java
deleted file mode 100644
index 3fa33ad649..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaAttributeMapping extends AttributeMapping, JavaJpaContextNode
-{
- JavaPersistentAttribute persistentAttribute();
-
- void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource);
-
- void update(JavaResourcePersistentAttribute persistentAttributeResource);
-
- String annotationName();
-
- /**
- * Return all fully qualfied annotation names that are supported with this mapping type.
- * This includes all possible annotations, not just the ones that currently exist on the attribute.
- */
- Iterator<String> correspondingAnnotationNames();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java
deleted file mode 100644
index 02b7c97d86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- * Map a string key to a type mapping and its corresponding
- * Java annotation adapter.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaAttributeMappingProvider {
-
- /**
- * A unique String that corresponds to the IJavaAttributeMapping key
- */
- String key();
-
- String annotationName();
-
- /**
- * Create an {@link JavaAttributeMapping} for the given attribute. Use the {@link JpaFactory}
- * for creation so that extenders can create their own {@link JpaFactory} instead of
- * creating their own {@link JavaAttributeMappingProvider}.
- */
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java
deleted file mode 100644
index de69eb701a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaAttributeOverride extends AttributeOverride, JavaJpaContextNode, JavaColumn.Owner
-{
- JavaColumn getColumn();
-
- void initializeFromResource(AttributeOverrideAnnotation attributeOverride);
-
- void update(AttributeOverrideAnnotation attributeOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java
deleted file mode 100644
index 1c68a451c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaBasicMapping
- extends JavaAttributeMapping, BasicMapping, JavaColumnMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java
deleted file mode 100644
index b14088a0c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaColumn extends Column, JavaAbstractColumn
-{
- void initializeFromResource(ColumnAnnotation columnResource);
-
- void update(ColumnAnnotation columnResource);
-
- boolean isConnected();
-
- Owner owner();
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends JavaAbstractColumn.Owner
- {
- ColumnAnnotation columnResource();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java
deleted file mode 100644
index 99d1248b1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.ColumnMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaColumnMapping extends JavaJpaContextNode, ColumnMapping, JavaColumn.Owner
-{
- JavaColumn getColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java
deleted file mode 100644
index a31f1c8c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaDiscriminatorColumn extends JavaNamedColumn, DiscriminatorColumn
-{
- void initializeFromResource(JavaResourcePersistentMember persistentResource);
-
- void update(JavaResourcePersistentMember persistentResource);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
deleted file mode 100644
index 44583157b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.Embeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEmbeddable
- extends JavaTypeMapping, Embeddable
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java
deleted file mode 100644
index d6b0e0ba41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEmbeddedIdMapping extends JavaAttributeMapping, EmbeddedIdMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> defaultAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
- JavaAttributeOverride addSpecifiedAttributeOverride(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java
deleted file mode 100644
index 19369bf176..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEmbeddedMapping extends JavaAttributeMapping, EmbeddedMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> defaultAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
- JavaAttributeOverride addSpecifiedAttributeOverride(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java
deleted file mode 100644
index 7c4aefeb7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Entity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEntity extends JavaTypeMapping, Entity
-{
- JavaTable getTable();
-
- JavaDiscriminatorColumn getDiscriminatorColumn();
-
- JavaTableGenerator getTableGenerator();
- JavaTableGenerator addTableGenerator();
-
- JavaSequenceGenerator getSequenceGenerator();
- JavaSequenceGenerator addSequenceGenerator();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaSecondaryTable> secondaryTables();
- @SuppressWarnings("unchecked")
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables();
- JavaSecondaryTable addSpecifiedSecondaryTable(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
- JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> defaultAttributeOverrides();
- JavaAttributeOverride addSpecifiedAttributeOverride(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> associationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> defaultAssociationOverrides();
- JavaAssociationOverride addSpecifiedAssociationOverride(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedQuery> namedQueries();
- JavaNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedNativeQuery> namedNativeQueries();
- JavaNamedNativeQuery addNamedNativeQuery(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java
deleted file mode 100644
index 11447a95b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaGeneratedValue extends GeneratedValue, JavaJpaContextNode
-{
-
- /**
- * Return the (best guess) text location of the generator.
- */
- TextRange generatorTextRange(CompilationUnit astRoot);
-
- void initializeFromResource(GeneratedValueAnnotation generatedValue);
-
- void update(GeneratedValueAnnotation generatedValue);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java
deleted file mode 100644
index 7f2e3cc015..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.Generator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaGenerator extends Generator, JavaJpaContextNode
-{
- // nothing yet
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java
deleted file mode 100644
index fbb47ceeaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.IdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaIdMapping extends JavaAttributeMapping, IdMapping, JavaColumnMapping
-{
- JavaGeneratedValue getGeneratedValue();
- JavaGeneratedValue addGeneratedValue();
-
- JavaSequenceGenerator getSequenceGenerator();
- JavaSequenceGenerator addSequenceGenerator();
-
- JavaTableGenerator getTableGenerator();
- JavaTableGenerator addTableGenerator();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java
deleted file mode 100644
index 74fa41669e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaJoinColumn extends JoinColumn, JavaAbstractJoinColumn, JavaAbstractColumn
-{
- void initializeFromResource(JoinColumnAnnotation joinColumn);
-
- boolean isConnected();
-
- void update(JoinColumnAnnotation joinColumn);
-
- Owner owner();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends JoinColumn.Owner, JavaAbstractJoinColumn.Owner, JavaAbstractColumn.Owner
- {
- // nothing yet
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
deleted file mode 100644
index 271a65cc6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaJoinTable extends JoinTable, JavaJpaContextNode
-{
- void initializeFromResource(JavaResourcePersistentAttribute attributeResource);
-
- void update(JavaResourcePersistentAttribute attributeResource);
-
- boolean isSpecified();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> inverseJoinColumns();
-
- JavaJoinColumn getDefaultInverseJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedInverseJoinColumns();
-
- JavaJoinColumn addSpecifiedInverseJoinColumn(int index);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
deleted file mode 100644
index 5714b11467..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaJpaContextNode extends JpaContextNode
-{
-
- /**
- * Return the Java code-completion proposals for the specified position
- * in the source code.
- */
- Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot);
-
-
- // ******************** validation ***************************8
-
- /**
- * Adds to the list of current validation messages
- */
- void addToMessages(List<IMessage> messages, CompilationUnit astRoot);
-
- TextRange validationTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java
deleted file mode 100644
index c9c6e68e3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaManyToManyMapping
- extends JavaMultiRelationshipMapping, ManyToManyMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java
deleted file mode 100644
index 09d0a9ff82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaManyToOneMapping
- extends JavaSingleRelationshipMapping, ManyToOneMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java
deleted file mode 100644
index 2b17ab697a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.MappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaMappedSuperclass
- extends JavaTypeMapping, MappedSuperclass
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java
deleted file mode 100644
index fb47f8886b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaMultiRelationshipMapping extends JavaRelationshipMapping, MultiRelationshipMapping
-{
-
- JavaJoinTable getJoinTable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java
deleted file mode 100644
index bb765cf41a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.NamedColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaNamedColumn extends NamedColumn, JavaJpaContextNode
-{
-
- Owner owner();
-
- /**
- * Return the (best guess) text location of the column's name.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the column owner's text range. This can be returned by the
- * column when its annotation is not present.
- */
- TextRange validationTextRange(CompilationUnit astRoot);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java
deleted file mode 100644
index 1fb5b8ae22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaNamedNativeQuery
- extends NamedNativeQuery, JavaQuery
-{
-
- ListIterator<JavaQueryHint> hints();
-
- void initializeFromResource(NamedNativeQueryAnnotation queryResource);
-
- void update(NamedNativeQueryAnnotation queryResource);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java
deleted file mode 100644
index 33f05873ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaNamedQuery
- extends NamedQuery, JavaQuery
-{
-
- ListIterator<JavaQueryHint> hints();
-
- void initializeFromResource(NamedQueryAnnotation queryResource);
-
- void update(NamedQueryAnnotation queryResource);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java
deleted file mode 100644
index 1bdb12383f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaOneToManyMapping
- extends JavaMultiRelationshipMapping, OneToManyMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java
deleted file mode 100644
index 8c78956dbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaOneToOneMapping
- extends JavaSingleRelationshipMapping, OneToOneMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java
deleted file mode 100644
index 4c2e495020..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaPersistentAttribute extends PersistentAttribute, JavaJpaContextNode
-{
-
- JavaAttributeMapping getMapping();
-
- JavaAttributeMapping getSpecifiedMapping();
-
- JavaTypeMapping typeMapping();
-
- JavaPersistentType persistentType();
-
- void initializeFromResource(JavaResourcePersistentAttribute resourcePersistentAttribute);
-
- void update(JavaResourcePersistentAttribute resourcePersistentAttribute);
-
- JavaResourcePersistentAttribute getResourcePersistentAttribute();
-
- /**
- * Return whether the attribute contains the given offset into the text file.
- */
- boolean contains(int offset, CompilationUnit astRoot);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java
deleted file mode 100644
index 9253e79655..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaPersistentType extends PersistentType, JavaJpaContextNode
-{
- JavaTypeMapping getMapping();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPersistentAttribute> attributes();
-
- JavaPersistentAttribute attributeNamed(String attributeName);
-
- /**
- * Resolve and return the attribute named <code>attributeName</code> if it
- * is distinct and exists within the context of this type
- */
- PersistentAttribute resolveAttribute(String attributeName);
-
- /**
- * Return whether any attribute in this persistent type contains a mapping annotation
- * @return
- */
- boolean hasAnyAttributeMappingAnnotations();
-
-
- void update(JavaResourcePersistentType persistentTypeResource);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java
deleted file mode 100644
index c381d39a7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaPrimaryKeyJoinColumn extends PrimaryKeyJoinColumn, JavaAbstractJoinColumn
-{
- void initializeFromResource(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumn);
-
- void update(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumn);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
deleted file mode 100644
index af0123c859..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Query;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaQuery extends Query, JavaJpaContextNode
-{
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaQueryHint> hints();
-
- JavaQueryHint addHint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
deleted file mode 100644
index 21018d6703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaQueryHint extends QueryHint, JavaJpaContextNode
-{
- void initializeFromResource(QueryHintAnnotation queryHint);
-
- void update(QueryHintAnnotation queryHint);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
deleted file mode 100644
index 1d791e8e41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.RelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaRelationshipMapping
- extends JavaAttributeMapping, RelationshipMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java
deleted file mode 100644
index 9fd8eb9398..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaSecondaryTable extends SecondaryTable, JavaJpaContextNode
-{
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
-
- JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- void initializeFromResource(SecondaryTableAnnotation secondaryTable);
-
- void update(SecondaryTableAnnotation secondaryTable);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java
deleted file mode 100644
index 7867b9eaab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaSequenceGenerator
- extends JavaGenerator, SequenceGenerator
-{
-
- void initializeFromResource(SequenceGeneratorAnnotation generator);
-
- void update(SequenceGeneratorAnnotation generator);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java
deleted file mode 100644
index 2c929644cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaSingleRelationshipMapping extends JavaRelationshipMapping, SingleRelationshipMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java
deleted file mode 100644
index 534de78258..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaStructureNodes
-{
- String COMPILATION_UNIT_ID =
- JptCorePlugin.PLUGIN_ID + ".java.compilationUnit";
-
- String PERSISTENT_TYPE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentType";
-
- String PERSISTENT_ATTRIBUTE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentAttribute";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java
deleted file mode 100644
index b45b1c984c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTable extends Table, JavaJpaContextNode
-{
- void initializeFromResource(JavaResourcePersistentMember persistentResource);
-
- void update(JavaResourcePersistentMember persistentResource);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java
deleted file mode 100644
index b0c9fbcfd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTableGenerator
- extends JavaGenerator, TableGenerator
-{
- void initializeFromResource(TableGeneratorAnnotation generator);
-
- void update(TableGeneratorAnnotation generator);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java
deleted file mode 100644
index 9accaaa6a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.TransientMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTransientMapping
- extends JavaAttributeMapping, TransientMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java
deleted file mode 100644
index 24dad954dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTypeMapping extends TypeMapping, JavaJpaContextNode
-{
- JavaPersistentType persistentType();
-
- void initializeFromResource(JavaResourcePersistentType persistentTypeResource);
-
- void update(JavaResourcePersistentType persistentTypeResource);
-
- String annotationName();
-
- Iterator<String> correspondingAnnotationNames();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java
deleted file mode 100644
index c29aa323ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- * Map a string key to a type mapping and its corresponding
- * Java annotation adapter.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTypeMappingProvider {
-
- /**
- * A unique String that corresponds to the IJavaTypeMapping key
- */
- String key();
-
- String annotationName();
-
- /**
- * Create an IJavaTypeMapping for the given attribute. Use the IJpaFactory
- * for creation so that extenders can create their own IJpaFactory instead of
- * creating their own typeMappingProvider.
- * @param type
- * @param jpaFactory
- */
- public JavaTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java
deleted file mode 100644
index 1077b1f7ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.context.VersionMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaVersionMapping
- extends JavaAttributeMapping, VersionMapping, JavaColumnMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java
deleted file mode 100644
index a40f4d1e8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EntityMappings extends OrmJpaContextNode, JpaStructureNode
-{
-
- String getVersion();
-
- String getDescription();
- void setDescription(String newDescription);
- String DESCRIPTION_PROPERTY = "descriptionProperty";
-
- String getPackage();
- void setPackage(String newPackage);
- String PACKAGE_PROPERTY = "packageProperty";
-
- /**
- * Return the specifiedSchema if not null, otherwise return the defaultSchema.
- */
- String getSchema();
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchemaProperty";
- String getSpecifiedSchema();
- void setSpecifiedSchema(String newSpecifiedSchema);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchemaProperty";
-
- /**
- * Return the specifiedCatalog if not null, otherwise return the defaultCatalog.
- */
- String getCatalog();
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalogProperty";
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String newSpecifiedCatalog);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalogProperty";
-
- /**
- * Return the specifiedAccess if not null, otherwise return the defaultAccess.
- */
- AccessType getAccess();
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccessProperty";
- AccessType getSpecifiedAccess();
- void setSpecifiedAccess(AccessType newSpecifiedAccess);
- String SPECIFIED_ACCESS_PROPERTY = "specifiedAccessProperty";
-
-
- PersistenceUnitMetadata getPersistenceUnitMetadata();
-
-
- ListIterator<OrmPersistentType> ormPersistentTypes();
- int ormPersistentTypesSize();
- OrmPersistentType addOrmPersistentType(String mappingKey, String className);
- void removeOrmPersistentType(int index);
- void removeOrmPersistentType(OrmPersistentType ormPersistentType);
- //void moveOrmPersistentType(int targetIndex, int sourceIndex);
- boolean containsPersistentType(String className);
- String PERSISTENT_TYPES_LIST = "persistentTypes";
-
-
- <T extends SequenceGenerator> ListIterator<T> sequenceGenerators();
- int sequenceGeneratorsSize();
- SequenceGenerator addSequenceGenerator(int index);
- void removeSequenceGenerator(int index);
- void removeSequenceGenerator(SequenceGenerator sequenceGenerator);
- void moveSequenceGenerator(int targetIndex, int sourceIndex);
- String SEQUENCE_GENERATORS_LIST = "sequenceGeneratorsList";
-
- <T extends TableGenerator> ListIterator<T> tableGenerators();
- int tableGeneratorsSize();
- TableGenerator addTableGenerator(int index);
- void removeTableGenerator(int index);
- void removeTableGenerator(TableGenerator tableGenerator);
- void moveTableGenerator(int targetIndex, int sourceIndex);
- String TABLE_GENERATORS_LIST = "tableGeneratorsList";
-
- ListIterator<OrmNamedQuery> namedQueries();
- int namedQueriesSize();
- OrmNamedQuery addNamedQuery(int index);
- void removeNamedQuery(int index);
- void removeNamedQuery(OrmNamedQuery namedQuery);
- void moveNamedQuery(int targetIndex, int sourceIndex);
- String NAMED_QUERIES_LIST = "namedQueriesList";
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries();
- int namedNativeQueriesSize();
- OrmNamedNativeQuery addNamedNativeQuery(int index);
- void removeNamedNativeQuery(int index);
- void removeNamedNativeQuery(OrmNamedNativeQuery namedNativeQuery);
- void moveNamedNativeQuery(int targetIndex, int sourceIndex);
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueriesList";
-
-
-
- PersistenceUnitDefaults persistenceUnitDefaults();
-
- /**
- * Return the {@link OrmPersistentType) listed in this mapping file
- * with the given fullyQualifiedTypeName. Return null if none exists.
- */
- OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName);
-
- void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping);
-
- // **************** updating ***********************************************
-
- void update(XmlEntityMappings entityMappings);
-
- // *************************************************************************
-
- boolean containsOffset(int textOffset);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractColumn.java
deleted file mode 100644
index 96724c26c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractColumn.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractColumn;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAbstractColumn extends AbstractColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange tableTextRange();
-
- Owner owner();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends OrmNamedColumn.Owner, AbstractColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractJoinColumn.java
deleted file mode 100644
index 9ba11e4efd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAbstractJoinColumn.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAbstractJoinColumn extends AbstractJoinColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange referencedColumnNameTextRange();
-
-
- Owner owner();
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends AbstractJoinColumn.Owner, OrmNamedColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
deleted file mode 100644
index 322aef911d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAssociationOverride extends AssociationOverride, OrmJpaContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> defaultJoinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- void update(XmlAssociationOverride associationOverride);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
deleted file mode 100644
index 2f9e2b9823..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAttributeMapping extends AttributeMapping, OrmJpaContextNode
-{
- OrmPersistentAttribute persistentAttribute();
-
- String getName();
- void setName(String newName);
- String NAME_PROPERTY = "nameProperty";
-
-
- JavaPersistentAttribute getJavaPersistentAttribute();
- String JAVA_PERSISTENT_ATTRIBUTE_PROPERTY = "javaPersistentAttributeProperty";
-
- /**
- * Attributes are a sequence in the orm schema. We must keep
- * the list of attributes in the appropriate order so the wtp xml
- * translators will write them to the xml in that order and they
- * will adhere to the schema.
- *
- * Each concrete subclass of XmlAttributeMapping must implement this
- * method and return an int that matches it's order in the schema
- * @return
- */
- int xmlSequence();
-
- void removeFromResourceModel(AbstractXmlTypeMapping typeMapping);
-
- XmlAttributeMapping addToResourceModel(AbstractXmlTypeMapping typeMapping);
-
-
- void initializeOn(OrmAttributeMapping newMapping);
-
- void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping);
-
- void initializeFromOrmBasicMapping(OrmBasicMapping oldMapping);
-
- void initializeFromOrmIdMapping(OrmIdMapping oldMapping);
-
- void initializeFromOrmTransientMapping(OrmTransientMapping oldMapping);
-
- void initializeFromOrmEmbeddedMapping(OrmEmbeddedMapping oldMapping);
-
- void initializeFromOrmEmbeddedIdMapping(OrmEmbeddedIdMapping oldMapping);
-
- void initializeFromOrmVersionMapping(OrmVersionMapping oldMapping);
-
- void initializeFromOrmOneToManyMapping(OrmOneToManyMapping oldMapping);
-
- void initializeFromOrmManyToOneMapping(OrmManyToOneMapping oldMapping);
-
- void initializeFromOrmOneToOneMapping(OrmOneToOneMapping oldMapping);
-
- void initializeFromOrmManyToManyMapping(OrmManyToManyMapping oldMapping);
-
- boolean contains(int textOffset);
-
- TextRange selectionTextRange();
-
-// void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource);
-//
-// void update(JavaResourcePersistentAttribute persistentAttributeResource);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java
deleted file mode 100644
index 3e09b8e311..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAttributeMappingProvider
-{
- String key();
-
- OrmAttributeMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
deleted file mode 100644
index 81646f55d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAttributeOverride extends AttributeOverride, OrmJpaContextNode
-{
- OrmColumn getColumn();
-
- void update(XmlAttributeOverride attributeOverride);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java
deleted file mode 100644
index 13f90b1bae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmBasicMapping extends BasicMapping, OrmAttributeMapping, OrmColumnMapping
-{
- void initialize(XmlBasic basic);
-
- void update(XmlBasic basic);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java
deleted file mode 100644
index aa068b2a3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmColumn extends Column, OrmAbstractColumn
-{
-
- Owner owner();
-
- void initializeFrom(Column oldColumn);
- void initialize(XmlColumn column);
- void update(XmlColumn column);
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends OrmAbstractColumn.Owner
- {
- XmlColumn columnResource();
-
- void addColumnResource();
-
- void removeColumnResource();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java
deleted file mode 100644
index b3ba8d0359..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.ColumnMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmColumnMapping extends ColumnMapping, OrmColumn.Owner
-{
-
- OrmColumn getColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java
deleted file mode 100644
index a600159205..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmDiscriminatorColumn extends DiscriminatorColumn, OrmNamedColumn
-{
- void initialize(XmlEntity entity);
-
- void update(XmlEntity entity);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java
deleted file mode 100644
index 061c16b1c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEmbeddable extends Embeddable, OrmTypeMapping
-{
- void initialize(XmlEmbeddable mappedSuperclass);
-
- void update(XmlEmbeddable mappedSuperclass);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java
deleted file mode 100644
index c21ab2b96c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEmbeddedIdMapping extends EmbeddedIdMapping, OrmAttributeMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> defaultAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
- OrmAttributeOverride addSpecifiedAttributeOverride(int index);
-
- void initialize(XmlEmbeddedId embeddedId);
-
- void update(XmlEmbeddedId embeddedId);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java
deleted file mode 100644
index 996ec637ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEmbeddedMapping extends EmbeddedMapping, OrmAttributeMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> defaultAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
- OrmAttributeOverride addSpecifiedAttributeOverride(int index);
-
- void initialize(XmlEmbedded embedded);
-
- void update(XmlEmbedded embedded);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java
deleted file mode 100644
index eb7c75a4ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEntity extends Entity, OrmTypeMapping
-{
- OrmTable getTable();
-
- OrmDiscriminatorColumn getDiscriminatorColumn();
-
- OrmTableGenerator getTableGenerator();
- OrmTableGenerator addTableGenerator();
-
- OrmSequenceGenerator getSequenceGenerator();
- OrmSequenceGenerator addSequenceGenerator();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmSecondaryTable> secondaryTables();
- @SuppressWarnings("unchecked")
- ListIterator<OrmSecondaryTable> specifiedSecondaryTables();
- OrmSecondaryTable addSpecifiedSecondaryTable(int index);
-
- ListIterator<OrmSecondaryTable> virtualSecondaryTables();
- int virtualSecondaryTablesSize();
- boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable);
- //TODO this might need to move to IEntity, for the UI
- String VIRTUAL_SECONDARY_TABLES_LIST = "virtualSecondaryTablesList";
-
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns();
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> defaultAttributeOverrides();
- OrmAttributeOverride addSpecifiedAttributeOverride(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> associationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides();
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> defaultAssociationOverrides();
- OrmAssociationOverride addSpecifiedAssociationOverride(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedQuery> namedQueries();
- OrmNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedNativeQuery> namedNativeQueries();
- OrmNamedNativeQuery addNamedNativeQuery(int index);
-
- JavaEntity javaEntity();
-
- void initialize(XmlEntity entity);
-
- void update(XmlEntity entity);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java
deleted file mode 100644
index e8a730fc9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmGeneratedValue extends GeneratedValue, OrmJpaContextNode
-{
- void initialize(XmlGeneratedValue generatedValue);
-
- void update(XmlGeneratedValue generatedValue);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java
deleted file mode 100644
index 91aa595ecb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmIdMapping extends IdMapping, OrmColumnMapping, OrmAttributeMapping
-{
- OrmGeneratedValue getGeneratedValue();
- OrmGeneratedValue addGeneratedValue();
-
- OrmSequenceGenerator getSequenceGenerator();
- OrmSequenceGenerator addSequenceGenerator();
-
- OrmTableGenerator getTableGenerator();
- OrmTableGenerator addTableGenerator();
-
- void initialize(XmlId id);
-
- void update(XmlId id);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java
deleted file mode 100644
index ff10287d0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmJoinColumn extends JoinColumn, OrmAbstractJoinColumn, OrmAbstractColumn
-{
- void initializeFrom(JoinColumn oldColumn);
-
- void initialize(XmlJoinColumn column);
-
- void update(XmlJoinColumn column);
-
- Owner owner();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends JoinColumn.Owner, OrmAbstractJoinColumn.Owner, OrmAbstractColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java
deleted file mode 100644
index e6b3ebab80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmJoinTable extends JoinTable, OrmJpaContextNode
-{
- OrmRelationshipMapping parent();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- ListIterator<OrmJoinColumn> defaultJoinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> inverseJoinColumns();
-
- ListIterator<OrmJoinColumn> defaultInverseJoinColumns();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedInverseJoinColumns();
-
- OrmJoinColumn addSpecifiedInverseJoinColumn(int index);
-
- void initialize(XmlRelationshipMapping relationshipMapping);
-
- void update(XmlRelationshipMapping relationshipMapping);
-
- boolean isSpecified();
-
- void initializeFrom(JoinTable oldJoinTable);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJpaContextNode.java
deleted file mode 100644
index 96b6398e3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJpaContextNode.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmJpaContextNode extends JpaContextNode
-{
- // **************** validation **************************************
-
- /**
- * Add to the list of current validation messages
- */
- void addToMessages(List<IMessage> messages);
-
- TextRange validationTextRange();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
deleted file mode 100644
index 3d0fa79d34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmManyToManyMapping extends ManyToManyMapping, OrmMultiRelationshipMapping
-{
-
- void initialize(XmlManyToMany xmlManyToMany);
-
- void update(XmlManyToMany xmlManyToMany);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java
deleted file mode 100644
index 9b33b8974f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmManyToOneMapping extends ManyToOneMapping, OrmSingleRelationshipMapping
-{
- ListIterator<OrmJoinColumn> joinColumns();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- void initialize(XmlManyToOne xmlManyToOne);
-
- void update(XmlManyToOne xmlManyToOne);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java
deleted file mode 100644
index efdfea6649..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmMappedSuperclass extends MappedSuperclass, OrmTypeMapping
-{
- void initialize(XmlMappedSuperclass mappedSuperclass);
-
- void update(XmlMappedSuperclass mappedSuperclass);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
deleted file mode 100644
index a65523a338..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmMultiRelationshipMapping extends OrmRelationshipMapping, MultiRelationshipMapping
-{
-
- OrmJoinTable getJoinTable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java
deleted file mode 100644
index cb5ea068c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.NamedColumn;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmNamedColumn extends NamedColumn, OrmJpaContextNode
-{
-
- Owner owner();
-
- /**
- * Return the (best guess) text location of the column's name.
- */
- TextRange nameTextRange();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the column owner's text range. This can be returned by the
- * column when its annotation is not present.
- */
- TextRange validationTextRange();
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java
deleted file mode 100644
index d80e1138ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmNamedNativeQuery extends OrmQuery, NamedNativeQuery
-{
- ListIterator<OrmQueryHint> hints();
-
- void initialize(XmlNamedNativeQuery queryResource);
-
- void update(XmlNamedNativeQuery queryResource);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java
deleted file mode 100644
index 8d37ba5722..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmNamedQuery extends OrmQuery, NamedQuery
-{
- ListIterator<OrmQueryHint> hints();
-
- void initialize(XmlNamedQuery queryResource);
-
- void update(XmlNamedQuery queryResource);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java
deleted file mode 100644
index bb0560abf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmOneToManyMapping extends OneToManyMapping, OrmMultiRelationshipMapping
-{
-
- void initialize(XmlOneToMany xmlOneToMany);
-
- void update(XmlOneToMany xmlOneToMany);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java
deleted file mode 100644
index d06e7115c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmOneToOneMapping extends OneToOneMapping, OrmSingleRelationshipMapping
-{
- ListIterator<OrmJoinColumn> joinColumns();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- void initialize(XmlOneToOne oneToOne);
-
- void update(XmlOneToOne oneToOne);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
deleted file mode 100644
index 52d7c5bcd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmPersistentAttribute extends PersistentAttribute, OrmJpaContextNode
-{
-
- /**
- * Overriden to return {@link OrmAttributeMapping}s
- */
- OrmAttributeMapping getMapping();
-
- /**
- * Overriden to return {@link OrmAttributeMapping}s
- */
- OrmAttributeMapping getSpecifiedMapping();
-
- /**
- * Overriden to return {@link OrmTypeMapping}s
- */
- OrmTypeMapping typeMapping();
-
- /**
- * Overriden to return {@link OrmPersistentType}s
- */
- OrmPersistentType persistentType();
-
- boolean contains(int textOffset);
-
- /**
- * Set the persistent attribute to virtual. If true, the attribute will
- * be removed from the list of specified persistent attributes on {@link OrmPersistentType}
- * and removed from the orm.xml file.
- * If false, the attribute will be added to the list of specified persistent attributes.
- */
- void setVirtual(boolean virtual);
-
- void nameChanged(String oldName, String newName);
-
-
- //******************* initialization/updating *******************
-
- void initialize(XmlBasic basic);
-
- void initialize(XmlEmbedded embedded);
-
- void initialize(XmlVersion version);
-
- void initialize(XmlManyToOne manyToOne);
-
- void initialize(XmlOneToMany oneToMany);
-
- void initialize(XmlOneToOne oneToOne);
-
- void initialize(XmlManyToMany manyToMany);
-
- void initialize(XmlId id);
-
- void initialize(XmlEmbeddedId embeddedId);
-
- void initialize(XmlTransient transientResource);
-
- void update(XmlId id);
-
- void update(XmlEmbeddedId embeddedId);
-
- void update(XmlBasic basic);
-
- void update(XmlVersion version);
-
- void update(XmlManyToOne manyToOne);
-
- void update(XmlOneToMany oneToMany);
-
- void update(XmlOneToOne oneToOne);
-
- void update(XmlManyToMany manyToMany);
-
- void update(XmlEmbedded embedded);
-
- void update(XmlTransient transientResource);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java
deleted file mode 100644
index 7250b2a4b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmPersistentType extends PersistentType, OrmJpaContextNode
-{
- /**
- * Overriden to return {@link OrmPersistentAttribute}s
- */
- @SuppressWarnings("unchecked")
- ListIterator<OrmPersistentAttribute> attributes();
-
- /**
- * Overriden to return an {@link OrmPersistentAttribute}
- */
- OrmPersistentAttribute attributeNamed(String attributeName);
-
- /**
- * Overriden to return an {@link OrmTypeMapping}
- */
- OrmTypeMapping getMapping();
-
- //******************* specified attributes *******************
-
- /**
- * Return a read only iterator of the specified {@link OrmPersistentAttribute}s.
- */
- ListIterator<OrmPersistentAttribute> specifiedAttributes();
-
- /**
- * Return the number of specified {@link OrmPersistentAttribute}s.
- */
- int specifiedAttributesSize();
-
- //TODO these are currently only used by tests, possibly remove them. OrmPersistenAttributes.setVirtual(boolean) is used by the UI
- OrmPersistentAttribute addSpecifiedPersistentAttribute(String mappingKey, String attributeName);
- void removeSpecifiedPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute);
-
-
- //******************* vritual attributes *******************
- String VIRTUAL_ATTRIBUTES_LIST = "virtualAttributesList";
-
- /**
- * Return a read only iterator of the virtual orm persistent attributes. These
- * are attributes that exist in the underyling java class, but are not specified
- * in the orm.xml
- */
- ListIterator<OrmPersistentAttribute> virtualAttributes();
-
- /**
- * Return the number of virtual orm persistent attributes. These are attributes that
- * exist in the underyling java class, but are not specified in the orm.xml
- */
- int virtualAttributesSize();
-
- /**
- * Return whether this persistent type contains the given virtual persistent attribute.
- */
- boolean containsVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute);
-
- /**
- * Add/Remove the given orm persistent attribute to/from the orm.xml. If the virtual
- * flag is set to true, the attribute will be removed from the orm.xml and moved from the
- * list of specifed attributes to the list of virtual attributes.
- */
- void setPersistentAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute, boolean virtual);
-
- //******************* mapping morphing *******************
- void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping);
-
-
- //******************* initialization/updating *******************
-
- void initialize(XmlEntity entity);
-
- void initialize(XmlMappedSuperclass mappedSuperclass);
-
- void initialize(XmlEmbeddable embeddable);
-
- void update(XmlEntity entity);
-
- void update(XmlMappedSuperclass mappedSuperclass);
-
- void update(XmlEmbeddable embeddable);
-
-
-
- boolean contains(int textOffset);
-
- /**
- * Return whether this {@link OrmPersistentType) applies to the
- * given fullyQualifiedTypeName.
- */
- boolean isFor(String fullyQualifiedTypeName);
-
- void classChanged(String oldClass, String newClass);
-
- /**
- * Return the Java persistent type that is referred to by this orm.xml persistent type.
- * If there is no underlying java persistent type, then null is returned.
- * @return
- */
- JavaPersistentType javaPersistentType();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java
deleted file mode 100644
index 67eb42f65a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmPrimaryKeyJoinColumn extends PrimaryKeyJoinColumn, OrmAbstractJoinColumn
-{
- void initialize(XmlPrimaryKeyJoinColumn column);
-
- void update(XmlPrimaryKeyJoinColumn column);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java
deleted file mode 100644
index 1817c005e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Query;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmQuery extends Query, OrmJpaContextNode
-{
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmQueryHint> hints();
-
- OrmQueryHint addHint(int index);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java
deleted file mode 100644
index 3031ff6f63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmQueryHint extends QueryHint, OrmJpaContextNode
-{
- void initialize(XmlQueryHint queryHint);
-
- void update(XmlQueryHint queryHint);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java
deleted file mode 100644
index 6e35ea582e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.RelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmRelationshipMapping
- extends OrmAttributeMapping, RelationshipMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java
deleted file mode 100644
index 6b960551ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmSecondaryTable extends SecondaryTable, OrmJpaContextNode
-{
- OrmEntity parent();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- void initialize(XmlSecondaryTable secondaryTable);
-
- void update(XmlSecondaryTable secondaryTable);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java
deleted file mode 100644
index 83ccc19136..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmSequenceGenerator extends SequenceGenerator, OrmJpaContextNode
-{
- void initialize(XmlSequenceGenerator sequenceGenerator);
-
- void update(XmlSequenceGenerator sequenceGenerator);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java
deleted file mode 100644
index bfced13c1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmSingleRelationshipMapping extends OrmRelationshipMapping, SingleRelationshipMapping
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java
deleted file mode 100644
index f6e5dba9db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmStructureNodes
-{
-
- String ENTITY_MAPPINGS_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.entityMappings";
-
- String PERSISTENT_TYPE_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.persistentType";
-
- String PERSISTENT_ATTRIBUTE_ID =
- JptCorePlugin.PLUGIN_ID + ".orm.persistentAttribute";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java
deleted file mode 100644
index e66f68f282..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTable extends Table, OrmJpaContextNode
-{
- void initialize(XmlEntity entity);
-
- void update(XmlEntity entity);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java
deleted file mode 100644
index 88f912eb80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTableGenerator extends TableGenerator, OrmJpaContextNode
-{
- void initialize(XmlTableGenerator tableGenerator);
-
- void update(XmlTableGenerator tableGenerator);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java
deleted file mode 100644
index 48ffec4f57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTransientMapping extends TransientMapping, OrmAttributeMapping
-{
- void initialize(XmlTransient transientResource);
-
- void update(XmlTransient transientResource);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java
deleted file mode 100644
index 359e06cb9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTypeMapping extends TypeMapping, OrmJpaContextNode
-{
- String JAVA_PERSISTENT_TYPE_PROPERTY = "javaPersistentTypeProperty";
-
- String getClass_();
- void setClass(String newClass);
- String CLASS_PROPERTY = "classProperty";
-
- AccessType getAccess();
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccessProperty";
-
- AccessType getSpecifiedAccess();
- void setSpecifiedAccess(AccessType newSpecifiedAccess);
- String SPECIFIED_ACCESS_PROPERTY = "specifiedAccessProperty";
-
-
- boolean isMetadataComplete();
- Boolean getSpecifiedMetadataComplete();
- void setSpecifiedMetadataComplete(Boolean newSpecifiedMetadataComplete);
- String SPECIFIED_METADATA_COMPLETE_PROPERTY = "specifiedMetadataCompleteProperty";
-
- boolean isDefaultMetadataComplete();
- String DEFAULT_METADATA_COMPLETE_PROPERTY = "defaultMetadataCompleteProperty";
-
-
- /**
- * type mappings are a sequence in the orm schema. We must keep
- * the list of type mappings in the appropriate order so the wtp xml
- * translators will write them to the xml in that order and they
- * will adhere to the schema.
- *
- * Each concrete subclass of XmlTypeMapping must implement this
- * method and return an int that matches it's order in the schema
- * @return
- */
- int xmlSequence();
-
- void removeFromResourceModel(XmlEntityMappings entityMappings);
-
- AbstractXmlTypeMapping addToResourceModel(XmlEntityMappings entityMappings);
-
- void initializeFrom(OrmTypeMapping oldMapping);
-
- AbstractXmlTypeMapping typeMappingResource();
-
- JavaPersistentType getJavaPersistentType();
-
- TextRange selectionTextRange();
-
- TextRange attributesTextRange();
-
- boolean containsOffset(int textOffset);
-
- OrmPersistentType persistentType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java
deleted file mode 100644
index f6be187182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTypeMappingProvider
-{
- String key();
-
- OrmTypeMapping buildTypeMapping(JpaFactory factory, OrmPersistentType parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java
deleted file mode 100644
index 36192c804f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmVersionMapping extends VersionMapping, OrmColumnMapping, OrmAttributeMapping
-{
- void initialize(XmlVersion version);
-
- void update(XmlVersion version);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java
deleted file mode 100644
index 54003bd308..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmXml extends OrmJpaContextNode, JpaStructureNode
-{
- // **************** persistence *******************************************
-
- /**
- * String constant associated with changes to the entity-mappings property
- */
- public final static String ENTITY_MAPPINGS_PROPERTY = "entityMappingsProperty";
-
- /**
- * Return the content represented by the root of the orm.xml file.
- * This may be null.
- */
- EntityMappings getEntityMappings();
-
- /**
- * Add a entity-mappings node to the orm.xml file and return the object
- * representing it.
- * Throws {@link IllegalStateException} if a entity-mappings node already exists.
- */
- EntityMappings addEntityMappings();
-
- /**
- * Remove the entity-mappings node from the orm.xml file.
- * Throws {@link IllegalStateException} if a persistence node does not exist.
- */
- void removeEntityMappings();
-
- PersistenceUnitDefaults persistenceUnitDefaults();
-
- /**
- * Return the OrmPersistentType listed in this mapping file
- * with the given fullyQualifiedTypeName. Return null if non exists.
- */
- OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName);
-
- // **************** updating **********************************************
-
- void update(OrmResource ormResource);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitDefaults.java
deleted file mode 100644
index 12d1238e5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitDefaults.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceUnitDefaults extends OrmJpaContextNode
-{
-
- String getSchema();
- void setSchema(String value);
- String SCHEMA_PROPERTY = "schemaProperty";
-
- String getCatalog();
- void setCatalog(String value);
- String CATALOG_PROPERTY = "catalogProperty";
-
- AccessType getAccess();
- void setAccess(AccessType value);
- String ACCESS_PROPERTY = "accessProperty";
-
- boolean isCascadePersist();
-
- void setCascadePersist(boolean value);
- String CASCADE_PERSIST_PROPERTY = "cascadePersistProperty";
-
-
- void update(XmlEntityMappings entityMappings);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
deleted file mode 100644
index 4b00f0561f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceUnitMetadata extends OrmJpaContextNode
-{
- boolean isXmlMappingMetadataComplete();
- void setXmlMappingMetadataComplete(boolean value);
- String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataCompleteProperty";
-
- PersistenceUnitDefaults getPersistenceUnitDefaults();
-
- void update(XmlEntityMappings entityMappings);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
deleted file mode 100644
index 5340a0bd83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ClassRef extends PersistenceJpaContextNode, JpaStructureNode
-{
- /**
- * Return true if the IClassRef matches the fullyQualfiedTypeName
- */
- boolean isFor(String fullyQualifiedTypeName);
-
- /**
- * Return whether this mapping file ref is represented by an entry in the
- * persistence.xml (false) or if it is instead virtual
- */
- boolean isVirtual();
-
-
- // **************** class name *********************************************
-
- /**
- * String constant associated with changes to the class name
- */
- final static String CLASS_NAME_PROPERTY = "className";
-
- /**
- * Return the class name of the class ref.
- */
- String getClassName();
-
- /**
- * Set the class name of the class ref.
- */
- void setClassName(String className);
-
-
- // **************** java persistent type ***********************************
-
- /**
- * String constant associated with changes to the java persistent type
- */
- final static String JAVA_PERSISTENT_TYPE_PROPERTY = "javaPersistentType";
-
- /**
- * Return the JavaPersistentType that corresponds to this IClassRef.
- * This can be null.
- * This is not settable by users of this API.
- */
- JavaPersistentType getJavaPersistentType();
-
-
- // **************** update **************************************
-
- void update(XmlJavaClassRef classRef);
-
- void update(String className);
-
-
- // *************************************************************************
-
- /**
- * Return whether the text representation of this persistence unit contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
deleted file mode 100644
index 9b26283709..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappingFileRef extends PersistenceJpaContextNode, JpaStructureNode
-{
- /**
- * Return whether this mapping file ref is represented by an entry in the
- * persistence.xml (false) or if it is instead virtual
- */
- boolean isVirtual();
-
-
- // **************** file name **********************************************
-
- /**
- * String constant associated with changes to the file name
- */
- String FILE_NAME_PROPERTY = "fileNameProperty";
-
- /**
- * Return the file name of the mapping file ref.
- */
- String getFileName();
-
- /**
- * Set the file name of the mapping file ref.
- */
- void setFileName(String fileName);
-
-
- // **************** orm xml ************************************************
-
- String ORM_XML_PROPERTY = "ormXmlProperty";
-
- OrmXml getOrmXml();
-
-
- // **************** udpating ***********************************************
-
- void update(XmlMappingFileRef mappingFileRef);
-
-
- // *************************************************************************
-
- PersistenceUnitDefaults persistenceUnitDefaults();
-
- /**
- * Return the OrmPersistentType listed in this mapping file
- * with the given fullyQualifiedTypeName. Return null if non exists.
- */
- OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName);
-
- /**
- * Return whether the text representation of this persistence unit contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
deleted file mode 100644
index a421f0976a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Persistence extends PersistenceJpaContextNode, JpaStructureNode
-{
- // **************** persistence units **************************************
-
- /**
- * String constant associated with changes to the persistence units list
- */
- public final static String PERSISTENCE_UNITS_LIST = "persistenceUnits";
-
- /**
- * Return an iterator on the list of persistence units.
- * This will not be null.
- */
- ListIterator<PersistenceUnit> persistenceUnits();
-
- /**
- * Return the size of the persistence unit list.
- * @return
- */
- int persistenceUnitsSize();
-
- /**
- * Add a persistence unit to the persistence node and return the object
- * representing it.
- */
- PersistenceUnit addPersistenceUnit();
-
- /**
- * Add a persistence unit to the persistence node at the specified index and
- * return the object representing it.
- */
- PersistenceUnit addPersistenceUnit(int index);
-
- /**
- * Remove the persistence unit from the persistence node.
- */
- void removePersistenceUnit(PersistenceUnit persistenceUnit);
-
- /**
- * Remove the persistence unit at the specified index from the persistence node.
- */
- void removePersistenceUnit(int index);
-
-
- // **************** updating ***********************************************
-
- void update(XmlPersistence persistence);
-
-
- // **************** text range *********************************************
-
- /**
- * Return whether the text representation of this persistence contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceJpaContextNode.java
deleted file mode 100644
index d887b39c08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceJpaContextNode.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import java.util.List;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public interface PersistenceJpaContextNode extends JpaContextNode
-{
- // **************** validation **************************************
-
- /**
- * Add to the list of current validation messages
- */
- void addToMessages(List<IMessage> messages);
-
- TextRange validationTextRange();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java
deleted file mode 100644
index 1a7eefe923..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceStructureNodes
-{
-
- String PERSISTENCE_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.persistence";
-
- String PERSISTENCE_UNIT_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.persistenceUnit";
-
- String CLASS_REF_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.classRef";
-
- String MAPPING_FILE_REF_ID =
- JptCorePlugin.PLUGIN_ID + ".persistence.mappingFileRef";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java
deleted file mode 100644
index 9ebe576375..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceUnit extends PersistenceJpaContextNode, JpaStructureNode
-{
- // **************** parent *************************************************
-
- Persistence parent();
-
-
- // **************** name ***************************************************
-
- /**
- * String constant associated with changes to the persistence unit's name
- */
- final static String NAME_PROPERTY = "name";
-
- /**
- * Return the name of the persistence unit.
- */
- String getName();
-
- /**
- * Set the name of the persistence unit.
- */
- void setName(String name);
-
-
- // **************** transaction type ***************************************
-
- /**
- * String constant associated with changes to the persistence unit's
- * transaction type
- */
- final static String TRANSACTION_TYPE_PROPERTY = "transactionType";
-
- /**
- * Return the transaction type of the persistence unit, one of the values of
- * {@link PersistenceUnitTransactionType}
- */
- PersistenceUnitTransactionType getTransactionType();
-
- /**
- * Set the transaction type of the persistence unit, one of the values of
- * {@link PersistenceUnitTransactionType}
- */
- void setTransactionType(PersistenceUnitTransactionType transactionType);
-
- /**
- * Return true if the transaction type is default rather than overridden
- * (corresponds to missing tag in persistence.xml)
- */
- boolean isTransactionTypeDefault();
-
- /**
- * Set the transaction type of the persistence unit to the default
- */
- void setTransactionTypeToDefault();
-
- /**
- * String constant associated with changes to the persistence unit's
- * default transaction type (not typically changed)
- */
- final static String DEFAULT_TRANSACTION_TYPE_PROPERTY = "defaultTransactionType";
-
- /**
- * Return the default transaction type
- */
- PersistenceUnitTransactionType getDefaultTransactionType();
-
-
-
- // **************** description ********************************************
-
- /**
- * String constant associated with changes to the persistence unit's description
- */
- final static String DESCRIPTION_PROPERTY = "description";
-
- /**
- * Return the description of the persistence unit.
- */
- String getDescription();
-
- /**
- * Set the description of the persistence unit.
- */
- void setDescription(String description);
-
-
- // **************** provider ********************************************
-
- /**
- * String constant associated with changes to the persistence unit's provider
- */
- final static String PROVIDER_PROPERTY = "provider";
-
- /**
- * Return the provider of the persistence unit.
- */
- String getProvider();
-
- /**
- * Set the provider of the persistence unit.
- */
- void setProvider(String provider);
-
-
- // **************** jta data source ****************************************
-
- /**
- * String constant associated with changes to the persistence unit's JTA data source
- */
- final static String JTA_DATA_SOURCE_PROPERTY = "jtaDataSource";
-
- /**
- * Return the JTA data source of the persistence unit.
- */
- String getJtaDataSource();
-
- /**
- * Set the JTA data source of the persistence unit.
- */
- void setJtaDataSource(String jtaDataSource);
-
-
- // **************** non-jta data source ************************************
-
- /**
- * String constant associated with changes to the persistence unit's non-JTA data source
- */
- final static String NON_JTA_DATA_SOURCE_PROPERTY = "nonJtaDataSource";
-
- /**
- * Return the non-JTA data source of the persistence unit.
- */
- String getNonJtaDataSource();
-
- /**
- * Set the non-JTA data source of the persistence unit.
- */
- void setNonJtaDataSource(String nonJtaDataSource);
-
-
- // **************** mapping file refs **************************************
-
- /**
- * Return an iterator on the list of mapping file refs, whether specified or
- * implied.
- * This will not be null.
- */
- ListIterator<MappingFileRef> mappingFileRefs();
-
- /**
- * Return of mapping file refs, specified and implied.
- */
- int mappingFileRefsSize();
-
- // **************** specified mapping file refs ****************************
-
- /**
- * String constant associated with changes to the specified mapping file refs list
- */
- final static String SPECIFIED_MAPPING_FILE_REF_LIST = "specifiedMappingFileRefs";
-
- /**
- * Return an iterator on the list of specified mapping file refs.
- * This will not be null.
- */
- ListIterator<MappingFileRef> specifiedMappingFileRefs();
-
- /**
- * Return of specified mapping file refs.
- */
- int specifiedMappingFileRefsSize();
-
- /**
- * Add a specified mapping file ref to the persistence unit and return the object
- * representing it.
- */
- MappingFileRef addSpecifiedMappingFileRef();
-
- /**
- * Add a specified mapping file ref to the persistence unit at the specified index and
- * return the object representing it.
- */
- MappingFileRef addSpecifiedMappingFileRef(int index);
-
- /**
- * Remove the specified mapping file ref from the persistence unit.
- */
- void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef);
-
- /**
- * Remove the specified mapping file ref at the specified index from the persistence unit.
- */
- void removeSpecifiedMappingFileRef(int index);
-
-
- // **************** implied mapping file ref *******************************
-
- /**
- * String constant associated with changes to the implied mapping file ref
- */
- final static String IMPLIED_MAPPING_FILE_REF_PROPERTY = "impliedMappingFileRef";
-
- /**
- * Return the current implied mapping file ref.
- * This may be null.
- */
- MappingFileRef getImpliedMappingFileRef();
-
- /**
- * Adds the implied mapping file ref
- */
- MappingFileRef setImpliedMappingFileRef();
-
- /**
- * Removes the implied mapping file ref
- */
- void unsetImpliedMappingFileRef();
-
-
- // **************** class refs *********************************************
-
- /**
- * Return an iterator on the list of class refs, whether specified or implied.
- * This will not be null.
- */
- ListIterator<ClassRef> classRefs();
-
- /**
- * Return the number of specified and implied class refs.
- */
- int classRefsSize();
-
- // **************** specified class refs ***********************************
-
- /**
- * String constant associated with changes to the specified class refs list
- */
- final static String SPECIFIED_CLASS_REF_LIST = "specifiedClassRefs";
-
- /**
- * Return an iterator on the list of specified class refs.
- * This will not be null.
- */
- ListIterator<ClassRef> specifiedClassRefs();
-
- /**
- * Return the number of specified class refs.
- */
- int specifiedClassRefsSize();
-
- /**
- * Add a specified class ref to the persistence unit and return the object
- * representing it.
- */
- ClassRef addSpecifiedClassRef();
-
- /**
- * Add a specified class ref to the persistence unit at the specified index and
- * return the object representing it.
- */
- ClassRef addSpecifiedClassRef(int index);
-
- /**
- * Remove the specified class ref from the persistence unit.
- */
- void removeSpecifiedClassRef(ClassRef classRef);
-
- /**
- * Remove the specified class ref at the specified index from the persistence unit.
- */
- void removeSpecifiedClassRef(int index);
-
-
- // **************** implied class refs *************************************
-
- /**
- * String constant associated with changes to the implied class refs list
- */
- final static String IMPLIED_CLASS_REF_LIST = "impliedClassRefs";
-
- /**
- * Return an iterator on the list of implied class refs.
- * This will not be null.
- */
- ListIterator<ClassRef> impliedClassRefs();
-
- /**
- * Return the number of implied class refs.
- */
- int impliedClassRefsSize();
-
- /**
- * Add an implied class ref to the persistence unit and return the object
- * representing it.
- */
- ClassRef addImpliedClassRef(String className);
-
- /**
- * Add an implied class ref to the persistence unit at the specified index and
- * return the object representing it.
- */
- ClassRef addImpliedClassRef(int index, String className);
-
- /**
- * Remove the implied class ref from the persistence unit.
- */
- void removeImpliedClassRef(ClassRef classRef);
-
- /**
- * Remove the implied class ref at the specified index from the persistence unit.
- */
- void removeImpliedClassRef(int index);
-
-
- // **************** exclude unlisted classes *******************************
-
- /**
- * String constant associated with changes to the persistence unit's
- * "exclude unlisted classes" setting
- */
- final static String EXCLUDE_UNLISTED_CLASSED_PROPERTY = "excludeUnlistedClasses";
-
- /**
- * Return the "exclude unlisted classes" setting of the persistence unit.
- */
- boolean getExcludeUnlistedClasses();
-
- /**
- * Set the "exclude unlisted classes" setting of the persistence unit.
- */
- void setExcludeUnlistedClasses(boolean excludeUnlistedClasses);
-
- /**
- * Return true if the "exclude unlisted classes" setting is default rather
- * than overridden
- * (corresponds to missing tag in persistence.xml)
- */
- boolean isExcludeUnlistedClassesDefault();
-
- /**
- * Set the "exclude unlisted classes" setting of the persistence unit to the
- * default
- */
- void setExcludeUnlistedClassesToDefault();
-
- /**
- * String constant associated with changes to the persistence unit's
- * default "exclude unlisted classes" setting (not typically changed)
- */
- final static String DEFAULT_EXCLUDE_UNLISTED_CLASSED_PROPERTY = "defaultExcludeUnlistedClasses";
-
- /**
- * Return the default "exclude unlisted classes" setting
- */
- boolean getDefaultExcludeUnlistedClasses();
-
-
- // **************** properties *********************************************
-
- /**
- * String constant associated with changes to the properties list
- */
- final static String PROPERTIES_LIST = "properties";
-
- /**
- * Return an iterator on the list of properties.
- * This will not be null.
- */
- ListIterator<Property> properties();
-
- int propertiesSize();
-
- /**
- * Add a property to the persistence unit and return the object
- * representing it.
- */
- Property addProperty();
-
- Property getProperty(String key);
-
- Property getProperty(String key, String value);
-
- void putProperty(String key, String value, boolean allowDuplicates);
-
- void replacePropertyValue(String key, String oldValue, String newValue);
-
- boolean containsProperty(String key);
-
- /**
- * Remove the property from the persistence unit.
- */
- void removeProperty(Property property);
-
- /**
- * Remove the property with the given key from the persistence unit.
- */
- void removeProperty(String key);
-
- /**
- * Remove the property with the given key and valuefrom the persistence unit.
- */
- void removeProperty(String key, String value);
-
-
- // **************** PersistenceUnitDefaults ********************************
-
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema";
-
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog";
-
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccess";
-
- boolean getDefaultCascadePersist();
- String DEFAULT_CASCADE_PERSIST_PROPERTY = "defaultCascadePersist";
-
-
- // **************** updating ***********************************************
-
- void update(XmlPersistenceUnit persistenceUnit);
-
-
- // *************************************************************************
-
- /**
- * Return the IPersistentType specified in this PersistenceUnit with the given
- * fully qualified type name
- */
- PersistentType persistentType(String fullyQualifiedTypeName);
-
- /**
- * Return whether the text representation of this persistence unit contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
deleted file mode 100644
index b8426d6c19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum PersistenceUnitTransactionType
-{
- /** Corresponds to JTA transaction type **/
- JTA,
-
- /** Corresponds to RESOURCE_LOCAL transaction type **/
- RESOURCE_LOCAL,
-
- /** Corresponds to default transaction type **/
- DEFAULT;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java
deleted file mode 100644
index c0cbcdbc58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceXml extends PersistenceJpaContextNode, JpaStructureNode
-{
- // **************** persistence *******************************************
-
- /**
- * String constant associated with changes to the persistence property
- */
- public final static String PERSISTENCE_PROPERTY = "persistence";
-
- /**
- * Return the content represented by the root of the persistence.xml file.
- * This may be null.
- */
- Persistence getPersistence();
-
- /**
- * Add a persistence node to the persistence.xml file and return the object
- * representing it.
- * Throws {@link IllegalStateException} if a persistence node already exists.
- */
- Persistence addPersistence();
-
- /**
- * Remove the persistence node from the persistence.xml file.
- * Throws {@link IllegalStateException} if a persistence node does not exist.
- */
- void removePersistence();
-
-
- // **************** updating **********************************************
-
- void update(PersistenceResource persistenceResource);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java
deleted file mode 100644
index 272e0a3d27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Property.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.context.persistence;
-
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Property extends PersistenceJpaContextNode
-{
- // **************** name ***************************************************
-
- final static String NAME_PROPERTY = "name";
-
- String getName();
-
- void setName(String name);
-
-
- // **************** value **************************************************
-
- final static String VALUE_PROPERTY = "value";
-
- void setValue(String value);
-
- String getValue();
-
-
- // **************** updating ***********************************************
-
- void update(XmlProperty property);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java
deleted file mode 100644
index 8065fd183b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-
-/**
- *
- */
-public abstract class AbstractJpaNode
- extends AbstractNode
- implements JpaNode
-{
-
-
- // ********** constructor **********
-
- protected AbstractJpaNode(JpaNode parent) {
- super(parent);
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
-
- // ********** IJpaNodeModel implementation **********
-
- public IResource resource() {
- return parent().resource();
- }
-
- public JpaProject jpaProject() {
- return this.root();
- }
-
- public String displayString() {
- return this.toString();
- }
-
-
- // ********** overrides **********
-
- @Override
- public JpaNode parent() {
- return (JpaNode) super.parent();
- }
-
- @Override
- public JpaProject root() {
- return (JpaProject) super.root();
- }
-
- // ********** convenience methods **********
-
- public Iterator<JpaNode> jpaChildren() {
- return new TransformationIterator<Node, JpaNode>(this.children()) {
- @Override
- protected JpaNode transform(Node next) {
- return (JpaNode) next;
- }
- };
- }
-
- protected JpaPlatform jpaPlatform() {
- return this.jpaProject().jpaPlatform();
- }
-
- protected JpaFactory jpaFactory() {
- return this.jpaPlatform().jpaFactory();
- }
-
- protected ConnectionProfile connectionProfile() {
- return this.jpaProject().connectionProfile();
- }
-
- protected Database database() {
- return this.connectionProfile().getDatabase();
- }
-
- public boolean isConnected() {
- return this.connectionProfile().isConnected();
- }
-
- // ********** update model **********
-
- private static final HashMap<Class<? extends AbstractNode>, HashSet<String>> nonUpdateAspectNameSets = new HashMap<Class<? extends AbstractNode>, HashSet<String>>();
-
- @Override
- protected void aspectChanged(String aspectName) {
- super.aspectChanged(aspectName);
- if (this.aspectTriggersUpdate(aspectName)) {
- // System.out.println(Thread.currentThread() + " \"update\" change: " + this + ": " + aspectName);
- this.jpaProject().update();
- }
- }
-
- private boolean aspectTriggersUpdate(String aspectName) {
- return ! this.aspectDoesNotTriggerUpdate(aspectName);
- }
-
- private boolean aspectDoesNotTriggerUpdate(String aspectName) {
- return this.nonUpdateAspectNames().contains(aspectName);
- }
-
- protected final Set<String> nonUpdateAspectNames() {
- synchronized (nonUpdateAspectNameSets) {
- HashSet<String> nonUpdateAspectNames = nonUpdateAspectNameSets.get(this.getClass());
- if (nonUpdateAspectNames == null) {
- nonUpdateAspectNames = new HashSet<String>();
- this.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNameSets.put(this.getClass(), nonUpdateAspectNames);
- }
- return nonUpdateAspectNames;
- }
- }
-
- protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
- nonUpdateAspectNames.add(COMMENT_PROPERTY);
- nonUpdateAspectNames.add(DIRTY_BRANCH_PROPERTY);
- nonUpdateAspectNames.add(BRANCH_PROBLEMS_LIST);
- nonUpdateAspectNames.add(HAS_BRANCH_PROBLEMS_PROPERTY);
- // when you override this method, don't forget to include:
- // super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractResourceModel.java
deleted file mode 100644
index 3cda959917..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractResourceModel.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-public abstract class AbstractResourceModel
- extends AbstractModel
- implements ResourceModel
-{
- private final List<JpaStructureNode> rootStructureNodes;
-
-
- protected AbstractResourceModel() {
- this.rootStructureNodes = new ArrayList<JpaStructureNode>();
- }
-
- public abstract Object resource();
-
- public ListIterator<JpaStructureNode> rootStructureNodes() {
- return new CloneListIterator<JpaStructureNode>(this.rootStructureNodes);
- }
-
- public int rootStructureNodesSize() {
- return this.rootStructureNodes.size();
- }
-
- /**
- * Add the new node to the end of the list.
- */
- public void addRootStructureNode(JpaStructureNode structureNode) {
- this.addRootStructureNode(this.rootStructureNodes.size(), structureNode);
- }
-
- public void addRootStructureNode(int index, JpaStructureNode structureNode) {
- if ( ! this.rootStructureNodes.contains(structureNode)) {
- this.addItemToList(index, structureNode, this.rootStructureNodes, ROOT_STRUCTURE_NODES_LIST);
- }
- }
-
- public void removeRootStructureNode(JpaStructureNode structureNode) {
- this.removeItemFromList(structureNode, this.rootStructureNodes, ROOT_STRUCTURE_NODES_LIST);
- }
-
- public void removeRootStructureNode(int index) {
- this.removeItemFromList(index, this.rootStructureNodes, ROOT_STRUCTURE_NODES_LIST);
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- synchronized (this.rootStructureNodes) {
- for (JpaStructureNode rootNode : this.rootStructureNodes) {
- JpaStructureNode node = rootNode.structureNode(textOffset);
- if (node != null) {
- return node;
- }
- }
- }
- return null;
- }
-
- public void dispose() {
- this.clearList(this.rootStructureNodes, ROOT_STRUCTURE_NODES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
deleted file mode 100644
index d2cb9d50b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This updater will update the project in a job that executes in a separate
- * thread and allows calls to #update() to return immediately.
- */
-public class AsynchronousJpaProjectUpdater implements JpaProject.Updater {
- protected final JpaProject jpaProject;
- protected final UpdateJob job;
-
- public AsynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.job = this.buildJob();
- }
-
- protected UpdateJob buildJob() {
- return new UpdateJob();
- }
-
- /**
- * Let the job run to completion (i.e. do not cancel it).
- * This should reduce the number of times the job is re-scheduled.
- */
- public void update() {
- this.job.schedule();
- }
-
- /**
- * prevent the job from running again and wait for the current
- * execution, if there is any, to end before returning
- */
- public void dispose() {
- this.job.setShouldSchedule(false);
- this.job.cancel(); // this will cancel the job if it is currently WAITING
- try {
- this.job.join();
- } catch (InterruptedException ex) {
- // the job thread was interrupted while waiting - ignore
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.jpaProject);
- }
-
-
- /**
- * This is the job that gets scheduled by the asynchronous updater.
- * When the job is run it tells the JPA project to "update".
- * Only a single instance of this job per project can run at a time.
- */
- protected class UpdateJob extends Job {
- protected boolean shouldSchedule;
-
- protected UpdateJob() {
- super("Update JPA project: " + AsynchronousJpaProjectUpdater.this.jpaProject.name()); // TODO i18n
- this.shouldSchedule = true;
- this.setRule(AsynchronousJpaProjectUpdater.this.jpaProject.project());
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return AsynchronousJpaProjectUpdater.this.jpaProject.update(monitor);
- }
-
- /**
- * When setting to false, the job does not stop immediately;
- * but it won't run again, even if it is scheduled.
- */
- public void setShouldSchedule(boolean shouldSchedule) {
- this.shouldSchedule = shouldSchedule;
- }
-
- @Override
- public boolean shouldSchedule() {
- return this.shouldSchedule;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
deleted file mode 100644
index 5d910d77b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaDataSource.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaProject;
-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.ProfileListener;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- *
- */
-public class GenericJpaDataSource
- extends AbstractJpaNode
- implements JpaDataSource
-{
- /**
- * cache the connection profile name so we can detect when
- * it changes and notify listeners
- */
- protected String connectionProfileName;
-
- /**
- * this should never be null; if we do not have a connection, this will be
- * a "null" connection profile
- */
- protected transient ConnectionProfile connectionProfile;
-
- /**
- * listen for the connection to be added or removed or its name changed
- */
- protected final ProfileListener profileListener;
-
- /**
- * listen for the connection to be opened or closed
- */
- protected final ConnectionListener connectionListener;
-
-
- // ********** constructor/initialization **********
-
- public GenericJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
- super(jpaProject);
-
- this.profileListener = this.buildProfileListener();
- ConnectionProfileRepository.instance().addProfileListener(this.profileListener);
-
- this.connectionListener = this.buildConnectionListener();
- this.connectionProfileName = connectionProfileName;
- this.connectionProfile = this.connectionProfileNamed(connectionProfileName);
- this.connectionProfile.addConnectionListener(this.connectionListener);
- }
-
- protected ProfileListener buildProfileListener() {
- return new LocalProfileListener();
- }
-
- protected ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
-
- // ********** IJpaDataSource implementation **********
-
- public String connectionProfileName() {
- return this.connectionProfileName;
- }
-
- public void setConnectionProfileName(String connectionProfileName) {
- String old = this.connectionProfileName;
- this.connectionProfileName = connectionProfileName;
- this.firePropertyChanged(CONNECTION_PROFILE_NAME_PROPERTY, old, connectionProfileName);
- // synch the connection profile when the name changes
- this.setConnectionProfile(this.connectionProfileNamed(connectionProfileName));
- }
-
- @Override
- public ConnectionProfile connectionProfile() {
- return this.connectionProfile;
- }
-
- public boolean hasAConnection() {
- return ! this.connectionProfile.isNull();
- }
-
- public void dispose() {
- this.connectionProfile.removeConnectionListener(this.connectionListener);
- ConnectionProfileRepository.instance().removeProfileListener(this.profileListener);
- }
-
-
- // ********** internal methods **********
-
- private ConnectionProfile connectionProfileNamed(String name) {
- return ConnectionProfileRepository.instance().profileNamed(name);
- }
-
- protected void setConnectionProfile(ConnectionProfile connectionProfile) {
- ConnectionProfile old = this.connectionProfile;
- this.connectionProfile.removeConnectionListener(this.connectionListener);
- this.connectionProfile = connectionProfile;
- this.connectionProfile.addConnectionListener(this.connectionListener);
- this.firePropertyChanged(CONNECTION_PROFILE_PROPERTY, old, connectionProfile);
- }
-
-
- // ********** overrides **********
-
- @Override
- public boolean isConnected() {
- return this.connectionProfile.isConnected();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.connectionProfileName);
- }
-
-
- // ********** member classes **********
-
- /**
- * Listen for a connection profile with our name being added or removed.
- * Also listen for our connection's name being changed.
- */
- protected class LocalProfileListener implements ProfileListener {
- protected LocalProfileListener() {
- super();
- }
-
- // possible name change
- public void profileChanged(ConnectionProfile profile) {
- if (profile == GenericJpaDataSource.this.connectionProfile) {
- GenericJpaDataSource.this.setConnectionProfileName(profile.getName());
- }
- }
-
- // profile added or removed
- public void profileReplaced(ConnectionProfile oldProfile, ConnectionProfile newProfile) {
- if (oldProfile == GenericJpaDataSource.this.connectionProfile) {
- GenericJpaDataSource.this.setConnectionProfile(newProfile);
- }
- }
-
- }
-
-
- /**
- * Whenever the connection is opened or closed trigger a project update.
- */
- protected class LocalConnectionListener implements ConnectionListener {
-
- protected LocalConnectionListener() {
- super();
- }
-
- public void opened(ConnectionProfile profile) {
- GenericJpaDataSource.this.jpaProject().update();
- }
-
- public void aboutToClose(ConnectionProfile profile) {
- // do nothing
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- return true;
- }
-
- public void closed(ConnectionProfile profile) {
- GenericJpaDataSource.this.jpaProject().update();
- }
-
- public void modified(ConnectionProfile profile) {
- // do nothing
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- // do nothing
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- // do nothing
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- // do nothing
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaFile.java
deleted file mode 100644
index 6b9ae61a56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaFile.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-
-public class GenericJpaFile extends AbstractJpaNode implements JpaFile
-{
- /**
- * The IFile associated with this JPA file
- */
- protected final IFile file;
-
- /**
- * The resource model represented by this JPA file
- */
- protected final ResourceModel resourceModel;
-
-
- public GenericJpaFile(JpaProject jpaProject, IFile file, ResourceModel resourceModel) {
- super(jpaProject);
- this.file = file;
- this.resourceModel = resourceModel;
- }
-
- public IFile getFile() {
- return file;
- }
-
- public ResourceModel getResourceModel() {
- return resourceModel;
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- return resourceModel.structureNode(textOffset);
- }
-
- public String getResourceType() {
- return getResourceModel().getResourceType();
- }
-
- public void dispose() {
- getResourceModel().dispose();
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- getResourceModel().javaElementChanged(event);
- }
-
- public void fileAdded(JpaFile jpaFile) {
- getResourceModel().resolveTypes();
- }
-
- public void fileRemoved(JpaFile jpaFile) {
- getResourceModel().resolveTypes();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getFile().toString());
- sb.append(" (resourceType: ");
- sb.append(getResourceType());
- sb.append(")");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java
deleted file mode 100644
index 6f86685e63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaModel.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.JpaProject.Config;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.OrmArtifactEdit;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceArtifactEdit;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-
-/**
- * The JPA model is synchronized so all changes to the list of JPA projects
- * are thread-safe.
- *
- * The JPA model holds on to a list of JPA project configs and only instantiates
- * their associated JPA projects when necessary. Other than performance,
- * this should be transparent to clients.
- */
-public class GenericJpaModel
- extends AbstractModel
- implements JpaModel
-{
-
- /** maintain a list of all the current JPA projects */
- private final ArrayList<JpaProjectHolder> jpaProjectHolders = new ArrayList<JpaProjectHolder>();
-
-
- // ********** constructor **********
-
- /**
- * Construct a JPA model and populate it with JPA projects for all the
- * current Eclipse projects with JPA facets.
- * The JPA model can only be instantiated by the JPA model manager.
- */
- GenericJpaModel() throws CoreException {
- super();
- ResourcesPlugin.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
-
- // ********** IJpaModel implementation **********
-
- /**
- * This will trigger the instantiation of the JPA project associated with the
- * specified Eclipse project.
- */
- public synchronized JpaProject jpaProject(IProject project) throws CoreException {
- return this.jpaProjectHolder(project).jpaProject();
- }
-
- /**
- * We can answer this question without instantiating the
- * associated JPA project.
- */
- public synchronized boolean containsJpaProject(IProject project) {
- return this.jpaProjectHolder(project).holdsJpaProjectFor(project);
- }
-
- /**
- * This will trigger the instantiation of all the JPA projects.
- */
- public synchronized Iterator<JpaProject> jpaProjects() throws CoreException {
- // force the CoreException to occur here (instead of later, in Iterator#next())
- ArrayList<JpaProject> jpaProjects = new ArrayList<JpaProject>(this.jpaProjectHolders.size());
- for (JpaProjectHolder holder : this.jpaProjectHolders) {
- jpaProjects.add(holder.jpaProject());
- }
- return jpaProjects.iterator();
- }
-
- /**
- * We can answer this question without instantiating any JPA projects.
- */
- public synchronized int jpaProjectsSize() {
- return this.jpaProjectHolders.size();
- }
-
- /**
- * This will trigger the instantiation of the JPA project associated with the
- * specified file.
- */
- public synchronized JpaFile jpaFile(IFile file) throws CoreException {
- JpaProject jpaProject = this.jpaProject(file.getProject());
- return (jpaProject == null) ? null : jpaProject.jpaFile(file);
- }
-
-
- // ********** internal methods **********
-
- /**
- * never return null
- */
- private JpaProjectHolder jpaProjectHolder(IProject project) {
- for (JpaProjectHolder holder : this.jpaProjectHolders) {
- if (holder.holdsJpaProjectFor(project)) {
- return holder;
- }
- }
- return NullJpaProjectHolder.instance();
- }
-
- private JpaProject.Config buildJpaProjectConfig(IProject project) {
- SimpleJpaProjectConfig config = new SimpleJpaProjectConfig();
- config.setProject(project);
- config.setJpaPlatform(JptCorePlugin.jpaPlatform(project));
- config.setConnectionProfileName(JptCorePlugin.connectionProfileName(project));
- config.setDiscoverAnnotatedClasses(JptCorePlugin.discoverAnnotatedClasses(project));
- return config;
- }
-
- /* private */ void addJpaProject(IProject project) {
- this.addJpaProject(this.buildJpaProjectConfig(project));
- }
-
- /**
- * Add a JPA project to the JPA model for the specified Eclipse project.
- * JPA projects can only be added by the JPA model manager.
- * The JPA project will only be instantiated later, on demand.
- */
- private void addJpaProject(JpaProject.Config config) {
- dumpStackTrace(); // figure out exactly when JPA projects are added
- this.jpaProjectHolders.add(this.jpaProjectHolder(config.project()).buildJpaProjectHolder(this, config));
- }
-
- /**
- * Remove the JPA project corresponding to the specified Eclipse project
- * from the JPA model. Return whether the removal actually happened.
- * JPA projects can only be removed by the JPA model manager.
- */
- private void removeJpaProject(IProject project) {
- dumpStackTrace(); // figure out exactly when JPA projects are removed
- this.jpaProjectHolder(project).remove();
- }
-
-
- // ********** Resource events **********
-
- /**
- * A project is being deleted. Remove its corresponding
- * JPA project if appropriate.
- */
- synchronized void projectPreDelete(IProject project) {
- this.removeJpaProject(project);
- }
-
- /**
- * Forward the specified resource delta to the JPA project corresponding
- * to the specified Eclipse project.
- */
- synchronized void synchronizeFiles(IProject project, IResourceDelta delta) throws CoreException {
- this.jpaProjectHolder(project).synchronizeJpaFiles(delta);
- }
-
-
- // ********** Resource and/or Facet events **********
-
- /**
- * Check whether the JPA facet has been added or removed.
- */
- synchronized void checkForTransition(IProject project) {
- boolean jpaFacet = JptCorePlugin.projectHasJpaFacet(project);
- boolean jpaProject = this.containsJpaProject(project);
-
- if (jpaFacet) {
- if ( ! jpaProject) { // JPA facet added
- this.addJpaProject(project);
- }
- } else {
- if (jpaProject) { // JPA facet removed
- this.removeJpaProject(project);
- }
- }
- }
-
-
- // ********** Facet events **********
-
- // create persistence.xml and orm.xml in jobs so we don't deadlock
- // with the Resource Change Event that comes in from another
- // thread after the Eclipse project is created by the project facet
- // wizard (which happens before the wizard notifies us); the Artifact
- // Edits will hang during #save(), waiting for the workspace lock held
- // by the Resource Change Notification loop
- synchronized void jpaFacetedProjectPostInstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- IDataModel dataModel = (IDataModel) event.getActionConfig();
-
- boolean buildOrmXml = dataModel.getBooleanProperty(JpaFacetDataModelProperties.CREATE_ORM_XML);
- this.buildProjectXmlJob(project, buildOrmXml).schedule();
-
- // assume(?) this is the first event to indicate we need to add the JPA project to the JPA model
- this.addJpaProject(project);
- }
-
- private Job buildProjectXmlJob(final IProject project, final boolean buildOrmXml) {
- Job job = new Job("Create Project XML files") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- GenericJpaModel.this.createProjectXml(project, buildOrmXml);
- return Status.OK_STATUS;
- }
- };
- job.setRule(ResourcesPlugin.getWorkspace().getRoot());
- return job;
- }
-
- /* private */ void createProjectXml(IProject project, boolean buildOrmXml) {
- this.createPersistenceXml(project);
-
- if (buildOrmXml) {
- this.createOrmXml(project);
- }
-
- }
-
- private void createPersistenceXml(IProject project) {
- PersistenceArtifactEdit pae = PersistenceArtifactEdit.getArtifactEditForWrite(project);
-
- // 202811 - do not add content if it is already present
- PersistenceResource resource = pae.getResource();
- if (! resource.getFile().exists()) {
- pae.createDefaultResource();
- }
-
- pae.dispose();
- }
-
- private void createOrmXml(IProject project) {
- OrmArtifactEdit oae = OrmArtifactEdit.getArtifactEditForWrite(project);
- OrmResource resource = oae.getResource(JptCorePlugin.ormXmlDeploymentURI(project));
-
- // 202811 - do not add content if it is already present
- if (resource.getEntityMappings() == null) {
- XmlEntityMappings entityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion("1.0");
- this.resourceContents(resource).add(entityMappings);
- oae.save(null);
- }
-
- oae.dispose();
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- private EList<EObject> resourceContents(OrmResource resource) {
- return resource.getContents();
- }
-
- // TODO remove classpath items? persistence.xml? orm.xml?
- synchronized void jpaFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- // assume(?) this is the first event to indicate we need to remove the JPA project to the JPA model
- this.removeJpaProject(event.getProject().getProject());
- }
-
-
- // ********** Java events **********
-
- /**
- * Forward the Java element changed event to all the JPA projects
- * because the event could affect multiple projects.
- */
- synchronized void javaElementChanged(ElementChangedEvent event) {
- for (JpaProjectHolder jpaProjectHolder : this.jpaProjectHolders) {
- jpaProjectHolder.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- /**
- * The JPA settings associated with the specified Eclipse project
- * have changed in such a way as to require the associated
- * JPA project to be completely rebuilt
- * (e.g. when the user changes a project's JPA platform).
- */
- synchronized void rebuildJpaProject(IProject project) {
- this.removeJpaProject(project);
- this.addJpaProject(project);
- }
-
- /**
- * Dispose the JPA model by disposing and removing all its JPA projects.
- * The JPA model can only be disposed by the JPA model manager.
- */
- synchronized void dispose() {
- // clone the list to prevent concurrent modification exceptions
- JpaProjectHolder[] holders = this.jpaProjectHolders.toArray(new JpaProjectHolder[this.jpaProjectHolders.size()]);
- for (JpaProjectHolder holder : holders) {
- holder.remove();
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("JPA projects size: " + this.jpaProjectsSize());
- }
-
-
- // ********** holder callbacks **********
-
- /**
- * called by the JPA project holder when the JPA project is actually
- * instantiated
- */
- /* private */ void jpaProjectBuilt(JpaProject jpaProject) {
- this.fireItemAdded(JPA_PROJECTS_COLLECTION, jpaProject);
- }
-
- /**
- * called by the JPA project holder if the JPA project has been
- * instantiated and we need to remove it
- */
- /* private */ void jpaProjectRemoved(JpaProject jpaProject) {
- this.fireItemRemoved(JPA_PROJECTS_COLLECTION, jpaProject);
- }
-
- /**
- * called by the JPA project holder
- */
- /* private */ void removeJpaProjectHolder(JpaProjectHolder jpaProjectHolder) {
- this.jpaProjectHolders.remove(jpaProjectHolder);
- }
-
-
- // ********** JPA project holders **********
-
- private interface JpaProjectHolder {
-
- boolean holdsJpaProjectFor(IProject project);
-
- JpaProject jpaProject() throws CoreException;
-
- void synchronizeJpaFiles(IResourceDelta delta) throws CoreException;
-
- void javaElementChanged(ElementChangedEvent event);
-
- JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jpaModel, JpaProject.Config config);
-
- void remove();
-
- }
-
- private static class NullJpaProjectHolder implements JpaProjectHolder {
- private static final JpaProjectHolder INSTANCE = new NullJpaProjectHolder();
-
- static JpaProjectHolder instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private NullJpaProjectHolder() {
- super();
- }
-
- public boolean holdsJpaProjectFor(IProject project) {
- return false;
- }
-
- public JpaProject jpaProject() throws CoreException {
- return null;
- }
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- // do nothing
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- // do nothing
- }
-
- public JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jpaModel, Config config) {
- return new DefaultJpaProjectHolder(jpaModel, config);
- }
-
- public void remove() {
- // do nothing
- }
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
- }
-
- /**
- * Pair a JPA project config with its lazily-initialized JPA project.
- */
- private static class DefaultJpaProjectHolder implements JpaProjectHolder {
- private final GenericJpaModel jpaModel;
- private final JpaProject.Config config;
- private JpaProject jpaProject;
-
- DefaultJpaProjectHolder(GenericJpaModel jpaModel, JpaProject.Config config) {
- super();
- this.jpaModel = jpaModel;
- this.config = config;
- }
-
- public boolean holdsJpaProjectFor(IProject project) {
- return this.config.project().equals(project);
- }
-
- public JpaProject jpaProject() throws CoreException {
- if (this.jpaProject == null) {
- this.jpaProject = this.buildJpaProject();
- // notify listeners of the JPA model
- this.jpaModel.jpaProjectBuilt(this.jpaProject);
- }
- return this.jpaProject;
- }
-
- private JpaProject buildJpaProject() throws CoreException {
- return this.config.jpaPlatform().jpaFactory().buildJpaProject(this.config);
- }
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- if (this.jpaProject != null) {
- this.jpaProject.synchronizeJpaFiles(delta);
- }
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- if (this.jpaProject != null) {
- this.jpaProject.javaElementChanged(event);
- }
- }
-
- public JpaProjectHolder buildJpaProjectHolder(GenericJpaModel jm, Config c) {
- throw new IllegalArgumentException(c.project().getName());
- }
-
- public void remove() {
- this.jpaModel.removeJpaProjectHolder(this);
- if (this.jpaProject != null) {
- this.jpaModel.jpaProjectRemoved(this.jpaProject);
- this.jpaProject.dispose();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.config.project().getName());
- }
-
- }
-
-
- // ********** resource proxy visitor **********
-
- /**
- * Visit the workspace resource tree, adding a JPA project to the
- * JPA model for each open Eclipse project that has a JPA facet.
- */
- private class ResourceProxyVisitor implements IResourceProxyVisitor {
-
- ResourceProxyVisitor() {
- super();
- }
-
- public boolean visit(IResourceProxy resourceProxy) throws CoreException {
- switch (resourceProxy.getType()) {
- case IResource.ROOT :
- return true; // all projects are in the "root"
- case IResource.PROJECT :
- this.checkProject(resourceProxy);
- return false; // no nested projects
- default :
- return false;
- }
- }
-
- private void checkProject(IResourceProxy resourceProxy) {
- if (resourceProxy.isAccessible()) { // the project exists and is open
- IProject project = (IProject) resourceProxy.requestResource();
- if (JptCorePlugin.projectHasJpaFacet(project)) {
- GenericJpaModel.this.addJpaProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** DEBUG **********
-
- // @see JpaModelTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- private static void dumpStackTrace() {
- if (DEBUG) {
- // lock System.out so the stack elements are printed out contiguously
- synchronized (System.out) {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- // skip the first 3 elements - those are this method and 2 methods in Thread
- for (int i = 3; i < stackTrace.length; i++) {
- StackTraceElement element = stackTrace[i];
- if (element.getMethodName().equals("invoke0")) {
- break; // skip all elements outside of the JUnit test
- }
- System.out.println("\t" + element);
- }
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java
deleted file mode 100644
index 95e3e8ab37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaProject.java
+++ /dev/null
@@ -1,679 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.ContextModel;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.core.internal.resource.java.JpaCompilationUnitResource;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- */
-public class GenericJpaProject extends AbstractJpaNode implements JpaProject {
-
- /**
- * The Eclipse project corresponding to the JPA project.
- */
- protected final IProject project;
-
- /**
- * The vendor-specific JPA platform that builds the JPA project
- * and all its contents.
- */
- protected final JpaPlatform jpaPlatform;
-
- /**
- * The data source that wraps the DTP model.
- */
- protected final JpaDataSource dataSource;
-
- /**
- * Flag indicating whether the project should "discover" annotated
- * classes automatically, as opposed to requiring the classes to be
- * listed in persistence.xml.
- */
- protected boolean discoversAnnotatedClasses;
-
- /**
- * The JPA files associated with the JPA project.
- */
- protected final Vector<JpaFile> jpaFiles;
-
- /**
- * The model representing the collated resources associated
- * with the JPA project.
- */
- protected ContextModel contextModel;
-
- /**
- * The visitor passed to resource deltas.
- */
- protected final IResourceDeltaVisitor resourceDeltaVisitor;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocal<CommandExecutor> threadLocalModifySharedDocumentCommandExecutor;
- protected final CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- /**
- * A pluggable updater that can be used to "update" the project either
- * synchronously or asynchronously (or not at all). An asynchronous
- * updater is the default and is used when the project is being manipulated
- * by the UI. A synchronous updater is used when the project is being
- * manipulated by a "batch" (or non-UI) client (e.g. when testing the
- * "update" behavior). A null updater is used during tests that
- * do not care whether "updates" occur. Clients will need to explicitly
- * configure the updater if they require something other than an
- * asynchronous updater.
- */
- protected Updater updater;
-
- /**
- * Resource models notify this listener when they change. A project update
- * should occur any time a resource model changes.
- */
- protected ResourceModelListener resourceModelListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * The project and JPA platform are required.
- */
- public GenericJpaProject(JpaProject.Config config) throws CoreException {
- super(null); // JPA project is the root of the containment tree
- if ((config.project() == null) || (config.jpaPlatform() == null)) {
- throw new NullPointerException();
- }
- this.project = config.project();
- this.jpaPlatform = config.jpaPlatform();
- this.dataSource = this.jpaFactory().buildJpaDataSource(this, config.connectionProfileName());
- this.discoversAnnotatedClasses = config.discoverAnnotatedClasses();
- this.jpaFiles = this.buildEmptyJpaFiles();
-
- this.resourceDeltaVisitor = this.buildResourceDeltaVisitor();
- this.threadLocalModifySharedDocumentCommandExecutor = this.buildThreadLocalModifySharedDocumentCommandExecutor();
- this.modifySharedDocumentCommandExecutorProvider = this.buildModifySharedDocumentCommandExecutorProvider();
-
- this.updater = this.buildUpdater();
-
- this.resourceModelListener = this.buildResourceModelListener();
- // build the JPA files corresponding to the Eclipse project's files
- this.project.accept(this.buildInitialResourceProxyVisitor(), IResource.NONE);
-
- this.contextModel = this.buildContextModel();
-
- this.update();
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- if (parentNode != null) {
- throw new IllegalArgumentException("The parent node must be null");
- }
- }
-
- @Override
- public IResource resource() {
- return project();
- }
-
- protected Vector<JpaFile> buildEmptyJpaFiles() {
- return new Vector<JpaFile>();
- }
-
- protected IResourceDeltaVisitor buildResourceDeltaVisitor() {
- return new ResourceDeltaVisitor();
- }
-
- protected ThreadLocal<CommandExecutor> buildThreadLocalModifySharedDocumentCommandExecutor() {
- return new ThreadLocal<CommandExecutor>();
- }
-
- protected CommandExecutorProvider buildModifySharedDocumentCommandExecutorProvider() {
- return new ModifySharedDocumentCommandExecutorProvider();
- }
-
- protected Updater buildUpdater() {
- return new AsynchronousJpaProjectUpdater(this);
- }
-
- protected ResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected IResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-
- protected ContextModel buildContextModel() {
- return this.jpaFactory().buildContextModel(this);
- }
-
- // ***** inner class
- protected class InitialResourceProxyVisitor implements IResourceProxyVisitor {
- protected InitialResourceProxyVisitor() {
- super();
- }
- // add a JPA file for every [appropriate] file encountered by the visitor
- public boolean visit(IResourceProxy resource) throws CoreException {
- switch (resource.getType()) {
- case IResource.ROOT : // shouldn't happen
- case IResource.PROJECT :
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- GenericJpaProject.this.addJpaFileInternal((IFile) resource.requestResource());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
- // ********** general queries **********
-
- @Override
- public JpaProject root() {
- return this;
- }
-
- public String name() {
- return this.project.getName();
- }
-
- public IProject project() {
- return this.project;
- }
-
- public IJavaProject javaProject() {
- return JavaCore.create(this.project);
- }
-
- @Override
- public JpaPlatform jpaPlatform() {
- return this.jpaPlatform;
- }
-
- public JpaDataSource dataSource() {
- return this.dataSource;
- }
-
- @Override
- public ConnectionProfile connectionProfile() {
- return this.dataSource.connectionProfile();
- }
-
- public Schema defaultSchema() {
- return connectionProfile().defaultSchema();
- }
-
- @Override
- public Validator validator() {
- return NULL_VALIDATOR;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name());
- }
-
-
- // **************** discover annotated classes *****************************
-
- public boolean discoversAnnotatedClasses() {
- return this.discoversAnnotatedClasses;
- }
-
- public void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses) {
- boolean old = this.discoversAnnotatedClasses;
- this.discoversAnnotatedClasses = discoversAnnotatedClasses;
- this.firePropertyChanged(DISCOVERS_ANNOTATED_CLASSES_PROPERTY, old, discoversAnnotatedClasses);
- }
-
-
- // **************** JPA files **********************************************
-
- public Iterator<JpaFile> jpaFiles() {
- return new CloneIterator<JpaFile>(this.jpaFiles); // read-only
- }
-
- public int jpaFilesSize() {
- return this.jpaFiles.size();
- }
-
- public JpaFile jpaFile(IFile file) {
- synchronized (this.jpaFiles) {
- for (JpaFile jpaFile : this.jpaFiles) {
- if (jpaFile.getFile().equals(file)) {
- return jpaFile;
- }
- }
- }
- return null;
- }
-
- public Iterator<JpaFile> jpaFiles(final String resourceType) {
- return new FilteringIterator<JpaFile, JpaFile>(this.jpaFiles()) {
- @Override
- protected boolean accept(JpaFile o) {
- return o.getResourceType().equals(resourceType);
- }
- };
- }
-
- /**
- * Add a JPA file for the specified file, if appropriate.
- */
- protected void addJpaFile(IFile file) {
- JpaFile jpaFile = this.addJpaFileInternal(file);
- if (jpaFile != null) {
- this.fireItemAdded(JPA_FILES_COLLECTION, jpaFile);
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- stream.next().fileAdded(jpaFile);
- }
- }
- }
-
- /**
- * Add a JPA file for the specified file, if appropriate, without firing
- * an event; useful during construction.
- * Return the new JPA file, null if it was not created.
- */
- protected JpaFile addJpaFileInternal(IFile file) {
- JpaFile jpaFile = this.jpaPlatform.buildJpaFile(this, file);
- if (jpaFile == null) {
- return null;
- }
- this.jpaFiles.add(jpaFile);
- jpaFile.getResourceModel().addResourceModelChangeListener(this.resourceModelListener);
- return jpaFile;
- }
-
- /**
- * Remove the specified JPA file and dispose it.
- */
- protected void removeJpaFile(JpaFile jpaFile) {
- jpaFile.getResourceModel().removeResourceModelChangeListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jpaFile, this.jpaFiles, JPA_FILES_COLLECTION)) {
- throw new IllegalArgumentException("JPA file: " + jpaFile.getFile().getName());
- }
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- stream.next().fileRemoved(jpaFile);
- }
- jpaFile.dispose();
- }
-
- protected boolean containsJpaFile(IFile file) {
- return (this.jpaFile(file) != null);
- }
-
-
- // ********** context model **********
-
- public ContextModel contextModel() {
- return this.contextModel;
- }
-
-
- // ********** more queries **********
-
- public Iterator<IType> annotatedClasses() {
- return new FilteringIterator<IType, IType>(
- new TransformationIterator<JavaResourcePersistentType, IType>(annotatedJavaPersistentTypes()) {
- @Override
- protected IType transform(JavaResourcePersistentType next) {
- try {
- return javaProject().findType(next.getQualifiedName(), new NullProgressMonitor());
- }
- catch (JavaModelException jme) {
- return null;
- }
- }
- }) {
- @Override
- protected boolean accept(IType o) {
- return o != null;
- }
- };
- }
-
- protected Iterator<JavaResourcePersistentType> annotatedJavaPersistentTypes() {
- return new FilteringIterator<JavaResourcePersistentType, JavaResourcePersistentType>(
- new TransformationIterator<JpaCompilationUnitResource, JavaResourcePersistentType>(jpaCompilationUnitResources()) {
- @Override
- protected JavaResourcePersistentType transform(JpaCompilationUnitResource next) {
- return next.getPersistentType();
- }
- }) {
- @Override
- protected boolean accept(JavaResourcePersistentType persistentType) {
- return persistentType == null ? false : persistentType.isPersisted();
- }
- };
- }
-
- public Iterator<JpaFile> javaJpaFiles() {
- return this.jpaFiles(ResourceModel.JAVA_RESOURCE_TYPE);
- }
-
- protected Iterator<JpaCompilationUnitResource> jpaCompilationUnitResources() {
- return new TransformationIterator<JpaFile, JpaCompilationUnitResource>(this.javaJpaFiles()) {
- @Override
- protected JpaCompilationUnitResource transform(JpaFile jpaFile) {
- return ((JavaResourceModel) jpaFile.getResourceModel()).resource();
- }
- };
- }
-
- // look for binary stuff here...
- public JavaResourcePersistentType javaPersistentTypeResource(String typeName) {
- for (JpaCompilationUnitResource jpCompilationUnitResource : CollectionTools.iterable(this.jpaCompilationUnitResources())) {
- JavaResourcePersistentType jptr = jpCompilationUnitResource.javaPersistentTypeResource(typeName);
- if (jptr != null) {
- return jptr;
- }
- }
-// this.javaProject().findType(typeName);
- return null;
- }
-
-
- // ********** Java change **********
-
- public void javaElementChanged(ElementChangedEvent event) {
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- stream.next().javaElementChanged(event);
- }
- }
-
-
- // ********** validation **********
-
- public Iterator<IMessage> validationMessages() {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.jpaPlatform.addToMessages(this, messages);
- return messages.iterator();
- }
-
- /* If this is true, it may be assumed that all the requirements are valid
- * for further validation. For example, if this is true at the point we
- * are validating persistence units, it may be assumed that there is a
- * single persistence.xml and that it has valid content down to the
- * persistence unit level. */
- private boolean okToContinueValidation = true;
-
- public void addToMessages(List<IMessage> messages) {
- //start with the project - then down
- //project validation
- addProjectLevelMessages(messages);
-
- //context model validation
- contextModel().addToMessages(messages);
- }
-
- protected void addProjectLevelMessages(List<IMessage> messages) {
- addConnectionMessages(messages);
- addMultiplePersistenceXmlMessage(messages);
- }
-
- protected void addConnectionMessages(List<IMessage> messages) {
- addNoConnectionMessage(messages);
- addInactiveConnectionMessage(messages);
- }
-
- protected boolean okToProceedForConnectionValidation = true;
-
- protected void addNoConnectionMessage(List<IMessage> messages) {
- if (! this.dataSource().hasAConnection()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PROJECT_NO_CONNECTION,
- this)
- );
- okToProceedForConnectionValidation = false;
- }
- }
-
- protected void addInactiveConnectionMessage(List<IMessage> messages) {
- if (okToProceedForConnectionValidation && ! this.dataSource().isConnected()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PROJECT_INACTIVE_CONNECTION,
- new String[] {this.dataSource().connectionProfileName()},
- this)
- );
- }
- okToProceedForConnectionValidation = true;
- }
-
- protected void addMultiplePersistenceXmlMessage(List<IMessage> messages) {
-// if (validPersistenceXmlFiles.size() > 1) {
-// messages.add(
-// JpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// IJpaValidationMessages.PROJECT_MULTIPLE_PERSISTENCE_XML,
-// jpaProject)
-// );
-// okToContinueValidation = false;
-// }
- }
-
-
- // ********** root deploy location **********
-
- protected static final String WEB_PROJECT_ROOT_DEPLOY_LOCATION = J2EEConstants.WEB_INF_CLASSES;
-
- public String rootDeployLocation() {
- return this.isWebProject() ? WEB_PROJECT_ROOT_DEPLOY_LOCATION : "";
- }
-
- protected static final String JST_WEB_MODULE = IModuleConstants.JST_WEB_MODULE;
-
- protected boolean isWebProject() {
- return JptCorePlugin.projectHasWebFacet(this.project);
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.updater.dispose();
- // use clone iterator while deleting JPA files
- for (Iterator<JpaFile> stream = this.jpaFiles(); stream.hasNext(); ) {
- this.removeJpaFile(stream.next());
- }
- this.dataSource.dispose();
- }
-
-
- // ********** resource model listener **********
-
- protected class DefaultResourceModelListener implements ResourceModelListener {
- protected DefaultResourceModelListener() {
- super();
- }
- public void resourceModelChanged() {
- GenericJpaProject.this.update();
- }
- }
-
-
- // ********** handling resource deltas **********
-
- public void synchronizeJpaFiles(IResourceDelta delta) throws CoreException {
- delta.accept(this.resourceDeltaVisitor);
- }
-
- /**
- * resource delta visitor callback
- */
- protected void synchronizeJpaFiles(IFile file, int deltaKind) {
- switch (deltaKind) {
- case IResourceDelta.ADDED :
- if ( ! this.containsJpaFile(file)) {
- this.addJpaFile(file);
- }
- break;
- case IResourceDelta.REMOVED :
- JpaFile jpaFile = this.jpaFile(file);
- if (jpaFile != null) {
- this.removeJpaFile(jpaFile);
- }
- break;
- case IResourceDelta.CHANGED :
- case IResourceDelta.ADDED_PHANTOM :
- case IResourceDelta.REMOVED_PHANTOM :
- default :
- break; // only worried about added and removed files
- }
- }
-
- // ***** inner class
- /**
- * add a JPA file for every [appropriate] file encountered by the visitor
- */
- protected class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceDeltaVisitor() {
- super();
- }
- public boolean visit(IResourceDelta delta) throws CoreException {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- case IResource.PROJECT :
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- GenericJpaProject.this.synchronizeJpaFiles((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
- // ********** support for modifying documents shared with the UI **********
-
- /**
- * If there is no thread-specific command executor, use the default
- * implementation, which simply executes the command directly.
- */
- protected CommandExecutor threadLocalModifySharedDocumentCommandExecutor() {
- CommandExecutor ce = this.threadLocalModifySharedDocumentCommandExecutor.get();
- return (ce != null) ? ce : CommandExecutor.Default.instance();
- }
-
- public void setThreadLocalModifySharedDocumentCommandExecutor(CommandExecutor commandExecutor) {
- this.threadLocalModifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public CommandExecutorProvider modifySharedDocumentCommandExecutorProvider() {
- return this.modifySharedDocumentCommandExecutorProvider;
- }
-
- // ***** inner class
- protected class ModifySharedDocumentCommandExecutorProvider implements CommandExecutorProvider {
- protected ModifySharedDocumentCommandExecutorProvider() {
- super();
- }
- public CommandExecutor commandExecutor() {
- return GenericJpaProject.this.threadLocalModifySharedDocumentCommandExecutor();
- }
- }
-
-
- // ********** project "update" **********
-
- public Updater updater() {
- return this.updater;
- }
-
- public void setUpdater(Updater updater) {
- this.updater = updater;
- }
-
- /**
- * Delegate to the updater so clients can configure how updates occur.
- */
- public void update() {
- this.updater.update();
- }
-
- /**
- * Called by the updater.
- */
- public IStatus update(IProgressMonitor monitor) {
- try {
- this.contextModel.update(monitor);
- } catch (OperationCanceledException ex) {
- return Status.CANCEL_STATUS;
- } catch (Throwable ex) {
- // Exceptions can occur when the update is running and changes are
- // made concurrently to the Java source. When that happens, our
- // model might be in an inconsistent state because it is not yet in
- // sync with the changed Java source.
- // Log these exceptions and assume they won't happen when the
- // update runs again as a result of the concurrent Java source changes.
- JptCorePlugin.log(ex);
- }
- return Status.OK_STATUS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java
deleted file mode 100644
index 302688d20b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaModelManager.java
+++ /dev/null
@@ -1,551 +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.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IOpenable;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
-import org.eclipse.jpt.utility.internal.BitTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-
-/**
- * "Internal" global stuff.
- * Provide access via a singleton.
- * Hold and manage the JPA model (which holds all the JPA projects)
- * and the various global listeners. We attempt to determine whether events
- * are relevant before forwarding them to the JPA model.
- *
- * Various things that cause us to add or remove a JPA project:
- * - Startup of the Dali plug-in will trigger all the JPA projects to be added
- *
- * - Project created and facet installed
- * facet POST_INSTALL
- * - Project facet uninstalled
- * facet PRE_UNINSTALL
- *
- * - Project opened
- * facet PROJECT_MODIFIED
- * - Project closed
- * facet PROJECT_MODIFIED
- *
- * - Pre-existing project imported (created and opened)
- * resource POST_CHANGE -> PROJECT -> CHANGED -> OPEN
- * - Project deleted
- * resource PRE_DELETE
- *
- * - Project facet installed by editing the facets settings file directly
- * facet PROJECT_MODIFIED
- * - Project facet uninstalled by editing the facets settings file directly
- * facet PROJECT_MODIFIED
- */
-public class JpaModelManager {
-
- /**
- * The JPA model - null until the plug-in is started.
- */
- private GenericJpaModel jpaModel;
-
- /**
- * Listen for changes to projects and files.
- */
- private final IResourceChangeListener resourceChangeListener;
-
- /**
- * Listen for the JPA facet being added or removed from a project.
- */
- private final IFacetedProjectListener facetedProjectListener;
-
- /**
- * Listen for Java changes and forward them to the JPA model,
- * which will forward them to the JPA projects.
- */
- private final IElementChangedListener javaElementChangeListener;
-
- /**
- * Listen for changes to the "Default JPA Lib" preference
- * so we can update the corresponding classpath variable.
- */
- private final IPropertyChangeListener preferencesListener;
-
-
- // ********** singleton **********
-
- private static final JpaModelManager INSTANCE = new JpaModelManager();
-
- /**
- * Return the singleton JPA model manager.
- */
- public static JpaModelManager instance() {
- return INSTANCE;
- }
-
-
- // ********** constructor **********
-
- /**
- * Private - ensure single instance.
- */
- private JpaModelManager() {
- super();
- this.resourceChangeListener = new ResourceChangeListener();
- this.facetedProjectListener = new FacetedProjectListener();
- this.javaElementChangeListener = new JavaElementChangeListener();
- this.preferencesListener = new PreferencesListener();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * internal - called by JptCorePlugin
- */
- public synchronized void start() throws Exception {
- debug("*** START JPA model manager ***");
- try {
- this.jpaModel = new GenericJpaModel();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- FacetedProjectFramework.addListener(this.facetedProjectListener, IFacetedProjectEvent.Type.values());
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- JptCorePlugin.instance().getPluginPreferences().addPropertyChangeListener(this.preferencesListener);
- } catch (RuntimeException ex) {
- this.log(ex);
- this.stop();
- }
- }
-
- /**
- * internal - called by JptCorePlugin
- */
- public synchronized void stop() throws Exception {
- debug("*** STOP JPA model manager ***");
- JptCorePlugin.instance().getPluginPreferences().removePropertyChangeListener(this.preferencesListener);
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- this.jpaModel.dispose();
- this.jpaModel = null;
- }
-
-
- // ********** API **********
-
- /**
- * Return the workspace-wide JPA model.
- */
- public JpaModel jpaModel() {
- return this.jpaModel;
- }
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project,
- * or null if unable to associate the specified project with a
- * JPA project.
- */
- public JpaProject jpaProject(IProject project) throws CoreException {
- return this.jpaModel.jpaProject(project);
- }
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- public JpaFile jpaFile(IFile file) throws CoreException {
- return this.jpaModel.jpaFile(file);
- }
-
- /**
- * The JPA settings associated with the specified Eclipse project
- * have changed in such a way as to require the associated
- * JPA project to be completely rebuilt
- * (e.g. when the user changes a project's JPA platform).
- */
- public void rebuildJpaProject(IProject project) {
- this.jpaModel.rebuildJpaProject(project);
- }
-
- /**
- * Log the specified status.
- */
- public void log(IStatus status) {
- JptCorePlugin.log(status);
- }
-
- /**
- * Log the specified message.
- */
- public void log(String msg) {
- JptCorePlugin.log(msg);
- }
-
- /**
- * Log the specified exception or error.
- */
- public void log(Throwable throwable) {
- JptCorePlugin.log(throwable);
- }
-
-
- // ********** resource changed **********
-
- /**
- * Check for:
- * - project close/delete
- * - file add/remove
- */
- /* private */ void resourceChanged(IResourceChangeEvent event) {
- if (! (event.getSource() instanceof IWorkspace)) {
- return; // this probably shouldn't happen...
- }
- switch (event.getType()){
- case IResourceChangeEvent.PRE_DELETE : // project-only event
- this.resourcePreDelete(event);
- break;
- case IResourceChangeEvent.POST_CHANGE :
- this.resourcePostChange(event);
- break;
- case IResourceChangeEvent.PRE_CLOSE : // project-only event
- case IResourceChangeEvent.PRE_BUILD :
- case IResourceChangeEvent.POST_BUILD :
- default :
- break;
- }
- }
-
- /**
- * A project is being deleted. Remove its corresponding
- * JPA project if appropriate.
- */
- private void resourcePreDelete(IResourceChangeEvent event) {
- debug("Resource (Project) PRE_DELETE: " + event.getResource());
- this.jpaModel.projectPreDelete((IProject) event.getResource());
- }
-
- /**
- * A resource has changed somehow.
- * Check for files being added or removed.
- * (The JPA project only handles added and removed files here, ignoring
- * changed files.)
- */
- private void resourcePostChange(IResourceChangeEvent event) {
- debug("Resource POST_CHANGE");
- this.synchronizeFiles(event.getDelta());
- this.checkForOpenedProjects(event.getDelta());
- }
-
- private void synchronizeFiles(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.synchronizeFiles(delta.getAffectedChildren()); // recurse
- break;
- case IResource.PROJECT :
- this.synchronizeFiles((IProject) resource, delta);
- break;
- case IResource.FILE :
- case IResource.FOLDER :
- default :
- break;
- }
- }
-
- private void synchronizeFiles(IResourceDelta[] deltas) {
- for (int i = 0; i < deltas.length; i++) {
- this.synchronizeFiles(deltas[i]); // recurse
- }
- }
-
- /**
- * Checked exceptions bite.
- */
- private void synchronizeFiles(IProject project, IResourceDelta delta) {
- try {
- this.jpaModel.synchronizeFiles(project, delta);
- } catch (CoreException ex) {
- this.log(ex); // problem traversing the project's resources - not much we can do
- }
- }
-
- /**
- * Crawl the specified delta, looking for projects being opened.
- * Projects being deleted are handled in IResourceChangeEvent.PRE_DELETE.
- * Projects being closed are handled in IFacetedProjectEvent.Type.PROJECT_MODIFIED.
- */
- private void checkForOpenedProjects(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.checkForOpenedProjects(delta.getAffectedChildren()); // recurse
- break;
- case IResource.PROJECT :
- this.checkForOpenedProject((IProject) resource, delta);
- break;
- case IResource.FILE :
- case IResource.FOLDER :
- default :
- break;
- }
- }
-
- private void checkForOpenedProjects(IResourceDelta[] deltas) {
- for (int i = 0; i < deltas.length; i++) {
- this.checkForOpenedProjects(deltas[i]); // recurse
- }
- }
-
- private void checkForOpenedProject(IProject project, IResourceDelta delta) {
- switch (delta.getKind()) {
- case IResourceDelta.CHANGED :
- this.checkDeltaFlagsForOpenedProject(project, delta);
- break;
- case IResourceDelta.REMOVED : // already handled with the PRE_DELETE event
- case IResourceDelta.ADDED : // already handled with the facet POST_INSTALL event
- case IResourceDelta.ADDED_PHANTOM : // ignore
- case IResourceDelta.REMOVED_PHANTOM : // ignore
- default :
- break;
- }
- }
-
- /**
- * We don't get any events from the Facets Framework when a pre-existing
- * project is imported, so we need to check for the newly imported project here.
- *
- * This event also occurs when a project is simply opened. Project opening
- * also triggers a Facet PROJECT_MODIFIED event and that is where we add
- * the JPA project, not here
- */
- private void checkDeltaFlagsForOpenedProject(IProject project, IResourceDelta delta) {
- if (BitTools.flagIsSet(delta.getFlags(), IResourceDelta.OPEN) && project.isOpen()) {
- debug("\tProject CHANGED - OPEN: " + project.getName());
- this.jpaModel.checkForTransition(project);
- }
- }
-
-
- // ********** faceted project changed **********
-
- /**
- * Check for:
- * - install of JPA facet
- * - un-install of JPA facet
- * - any other appearance or disappearance of the JPA facet
- */
- /* private */ void facetedProjectChanged(IFacetedProjectEvent event) {
- switch (event.getType()) {
- case POST_INSTALL :
- this.facetedProjectPostInstall((IProjectFacetActionEvent) event);
- break;
- case PRE_UNINSTALL :
- this.facetedProjectPreUninstall((IProjectFacetActionEvent) event);
- break;
- case PROJECT_MODIFIED :
- this.facetedProjectModified(event.getProject().getProject());
- break;
- default :
- break;
- }
- }
-
- private void facetedProjectPostInstall(IProjectFacetActionEvent event) {
- debug("Facet POST_INSTALL: " + event.getProjectFacet());
- if (event.getProjectFacet().getId().equals(JptCorePlugin.FACET_ID)) {
- this.jpaModel.jpaFacetedProjectPostInstall(event);
- }
- }
-
- private void facetedProjectPreUninstall(IProjectFacetActionEvent event) {
- debug("Facet PRE_UNINSTALL: " + event.getProjectFacet());
- if (event.getProjectFacet().getId().equals(JptCorePlugin.FACET_ID)) {
- this.jpaModel.jpaFacetedProjectPreUninstall(event);
- }
- }
-
- /**
- * This event is triggered for any change to a faceted project.
- * We use the event to watch for the following:
- * - an open project is closed
- * - a closed project is opened
- * - one of a project's (facet) metadata files is edited directly
- */
- private void facetedProjectModified(IProject project) {
- debug("Facet PROJECT_MODIFIED: " + project.getName());
- this.jpaModel.checkForTransition(project);
- }
-
-
- // ********** Java element changed **********
-
- /**
- * Forward the event to the JPA model.
- */
- /* private */ void javaElementChanged(ElementChangedEvent event) {
- if (this.eventIndicatesProjectAddedButNotOpen(event)) {
- return;
- }
- this.jpaModel.javaElementChanged(event);
- }
-
- //209275 - This particular event only causes problems in a clean workspace the first time a JPA project
- //is created through the JPA wizard. The second time a JPA project is created, this event occurs, but
- //it occurs as the wizard is closing so it does not cause a deadlock.
- private boolean eventIndicatesProjectAddedButNotOpen(ElementChangedEvent event) {
- IJavaElementDelta delta = event.getDelta();
- if (delta.getKind() == IJavaElementDelta.CHANGED) {
- if (delta.getElement().getElementType() == IJavaElement.JAVA_MODEL) {
- IJavaElementDelta[] children = delta.getAffectedChildren();
- if (children.length == 1) {
- IJavaElementDelta childDelta = children[0];
- if (childDelta.getKind() == IJavaElementDelta.ADDED) {
- IJavaElement childElement = childDelta.getElement();
- if (childElement.getElementType() == IJavaElement.JAVA_PROJECT) {
- if (childDelta.getAffectedChildren().length == 0) {
- if (!((IOpenable) childElement).isOpen()) {
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- // ********** preference changed **********
-
- /**
- * When the "Default JPA Lib" preference changes,
- * update the appropriate JDT Core classpath variable.
- */
- /* private */ void preferenceChanged(PropertyChangeEvent event) {
- if (event.getProperty() == JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB) {
- try {
- JavaCore.setClasspathVariable("DEFAULT_JPA_LIB", new Path((String) event.getNewValue()), null);
- } catch (JavaModelException ex) {
- this.log(ex); // not sure what would cause this...
- }
- }
- }
-
-
- // ********** resource change listener **********
-
- /**
- * Forward the Resource change event back to the JPA model manager.
- */
- private class ResourceChangeListener implements IResourceChangeListener {
- ResourceChangeListener() {
- super();
- }
- public void resourceChanged(IResourceChangeEvent event) {
- JpaModelManager.this.resourceChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JPA model manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
- FacetedProjectListener() {
- super();
- }
- public void handleEvent(IFacetedProjectEvent event) {
- JpaModelManager.this.facetedProjectChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JPA model manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- JavaElementChangeListener() {
- super();
- }
- public void elementChanged(ElementChangedEvent event) {
- JpaModelManager.this.javaElementChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** preferences listener **********
-
- /**
- * Forward the Preferences change event back to the JPA model manager.
- */
- private class PreferencesListener implements IPropertyChangeListener {
- PreferencesListener() {
- super();
- }
- public void propertyChange(PropertyChangeEvent event) {
- JpaModelManager.this.preferenceChanged(event);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** debug **********
-
- // @see JpaModelTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- private static void debug(String message) {
- if (DEBUG) {
- System.out.println(Thread.currentThread().getName() + ": " + message);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java
deleted file mode 100644
index 2514d77e23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaProjectAdapterFactory.java
+++ /dev/null
@@ -1,44 +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.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-public class JpaProjectAdapterFactory
- implements IAdapterFactory
-{
- private static Class[] PROPERTIES= new Class[] {
- JpaProject.class
- };
-
- public Class[] getAdapterList() {
- return PROPERTIES;
- }
-
- public Object getAdapter(Object element, Class key) {
- IProject project;
-
- if (element instanceof IProject) {
- project = (IProject) element;
- }
- else if (element instanceof IJavaProject) {
- project = ((IJavaProject) element).getProject();
- }
- else {
- return null;
- }
-
- return JptCorePlugin.jpaProject(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java
deleted file mode 100644
index 8121ca9847..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java
+++ /dev/null
@@ -1,49 +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.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptCoreMessages extends NLS
-{
- private static final String BUNDLE_NAME = "jpa_core"; //$NON-NLS-1$
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptCoreMessages.class);
- }
-
- public static String VALIDATE_PLATFORM_NOT_SPECIFIED;
-
- public static String VALIDATE_CONNECTION_NOT_SPECIFIED;
-
- public static String VALIDATE_CONNECTION_NOT_CONNECTED;
-
- public static String VALIDATE_RUNTIME_NOT_SPECIFIED;
-
- public static String VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30;
-
- public static String VALIDATE_LIBRARY_NOT_SPECIFIED;
-
- public static String SYNCHRONIZE_CLASSES_JOB;
-
- public static String SYNCHRONIZING_CLASSES_TASK;
-
- public static String INVALID_PERSISTENCE_XML_CONTENT;
-
- public static String ERROR_SYNCHRONIZING_CLASSES_COULD_NOT_VALIDATE;
-
- public static String ERROR_WRITING_FILE;
-
-
- private JptCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java
deleted file mode 100644
index 5396f28241..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java
+++ /dev/null
@@ -1,67 +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.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Straightforward implementation of the JPA project config.
- */
-public class SimpleJpaProjectConfig implements JpaProject.Config {
- protected IProject project;
- protected JpaPlatform jpaPlatform;
- protected String connectionProfileName;
- protected boolean discoverAnnotatedClasses;
-
- public SimpleJpaProjectConfig() {
- super();
- }
-
- public IProject project() {
- return this.project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public JpaPlatform jpaPlatform() {
- return this.jpaPlatform;
- }
-
- public void setJpaPlatform(JpaPlatform jpaPlatform) {
- this.jpaPlatform = jpaPlatform;
- }
-
- public String connectionProfileName() {
- return this.connectionProfileName;
- }
-
- public void setConnectionProfileName(String connectionProfileName) {
- this.connectionProfileName = connectionProfileName;
- }
-
- public boolean discoverAnnotatedClasses() {
- return this.discoverAnnotatedClasses;
- }
-
- public void setDiscoverAnnotatedClasses(boolean discoverAnnotatedClasses) {
- this.discoverAnnotatedClasses = discoverAnnotatedClasses;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.project.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleSchedulingRule.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleSchedulingRule.java
deleted file mode 100644
index 52be764086..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleSchedulingRule.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-/**
- * A job scheduling rule that conflicts only with itself.
- */
-public final class SimpleSchedulingRule
- implements ISchedulingRule
-{
-
- // singleton
- private static final SimpleSchedulingRule INSTANCE = new SimpleSchedulingRule();
-
- /**
- * Return the singleton.
- */
- public static ISchedulingRule instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleSchedulingRule() {
- super();
- }
-
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- public boolean isConflicting(ISchedulingRule rule) {
- return rule == this;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java
deleted file mode 100644
index 60aed27a8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleTextRange.java
+++ /dev/null
@@ -1,83 +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.internal;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Straightforward, albeit almost useless, implementation of ITextRange.
- */
-public class SimpleTextRange implements TextRange {
- private final int offset;
- private final int length;
- private final int lineNumber;
-
- public SimpleTextRange(int offset, int length, int lineNumber) {
- super();
- this.offset = offset;
- this.length = length;
- this.lineNumber = lineNumber;
- }
-
- public int getOffset() {
- return this.offset;
- }
-
- public int getLength() {
- return this.length;
- }
-
- public int getLineNumber() {
- return this.lineNumber;
- }
-
- public boolean includes(int index) {
- return (this.offset <= index) && (index < this.end());
- }
-
- public boolean touches(int index) {
- return this.includes(index) || (index == this.end());
- }
-
- /**
- * The end offset is "exclusive", i.e. the element at the end offset
- * is not included in the range.
- */
- private int end() {
- return this.offset + this.length;
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == this.offset)
- && (r.getLength() == this.length);
- }
-
- @Override
- public int hashCode() {
- return this.offset ^ this.length;
- }
-
- @Override
- public String toString() {
- String start = String.valueOf(this.offset);
- String end = String.valueOf(this.end());
- return StringTools.buildToStringFor(this, start + ", " + end);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java
deleted file mode 100644
index 5b15115f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This updater will update the JPA project immediately and not return until
- * the update and all resulting updates are complete.
- */
-public class SynchronousJpaProjectUpdater implements JpaProject.Updater {
- protected final JpaProject jpaProject;
- protected boolean updating;
- protected boolean again;
-
- protected static final IProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
-
- public SynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.updating = false;
- this.again = false;
- }
-
- public void update() {
- if (this.updating) {
- // recursion: we get here when IJpaProject#update() is called during the "update"
- this.again = true;
- } else {
- this.updating = true;
- do {
- this.again = false;
- this.jpaProject.update(NULL_PROGRESS_MONITOR);
- } while (this.again);
- this.updating = false;
- }
- }
-
- public void dispose() {
- // nothing to do
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.jpaProject);
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java
deleted file mode 100644
index 193de0ca5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java
+++ /dev/null
@@ -1,56 +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.internal.context;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.AbstractJpaNode;
-
-public abstract class AbstractJpaContextNode extends AbstractJpaNode
- implements JpaContextNode
-{
- // **************** constructor ********************************************
-
- protected AbstractJpaContextNode(JpaNode parent) {
- super(parent);
- }
-
-
- // **************** IJpaContextNode impl ***********************************
-
- //TODO casting to IJpaContextNode here(possible CCE).
- /**
- * Overidden in BaseJpaContext, Persistence, PersitsenceXml to throw UnsupportedOperationException
- * Overidden in PersistenceUnit to return it.
- */
- public PersistenceUnit persistenceUnit() {
- return ((JpaContextNode) parent()).persistenceUnit();
- }
-
- /**
- * Overidden in BaseJpaContext to return null
- * Overidden in EntityMappings to return it.
- */
- public EntityMappings entityMappings() {
- return ((JpaContextNode) parent()).entityMappings();
- }
-
- /**
- * Overidden in BaseJpaContext to return null
- * Overidden in OrmPersistentType to return it.
- */
- public OrmPersistentType ormPersistentType() {
- return ((JpaContextNode) parent()).ormPersistentType();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericJpaContent.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericJpaContent.java
deleted file mode 100644
index c27dc9016e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/GenericJpaContent.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context;
-
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.persistence.PersistenceArtifactEdit;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJpaContent extends AbstractJpaContextNode
- implements BaseJpaContent
-{
- protected PersistenceXml persistenceXml;
-
-
- public GenericJpaContent(JpaProject jpaProject) {
- super(jpaProject);
- }
-
- @Override
- protected void initialize(Node parentNode) {
- super.initialize(parentNode);
- PersistenceArtifactEdit pae = PersistenceArtifactEdit.getArtifactEditForRead(jpaProject().project());
- PersistenceResource pr = pae.getResource();
-
- if (pr.exists()) {
- this.persistenceXml = this.buildPersistenceXml(pr);
- }
-
- pae.dispose();
- }
-
- @Override
- public EntityMappings entityMappings() {
- return null;
- }
-
- @Override
- public OrmPersistentType ormPersistentType() {
- return null;
- }
-
- // **************** persistence xml ****************************************
-
- public PersistenceXml getPersistenceXml() {
- return this.persistenceXml;
- }
-
- protected void setPersistenceXml(PersistenceXml persistenceXml) {
- PersistenceXml old = this.persistenceXml;
- this.persistenceXml = persistenceXml;
- this.firePropertyChanged(PERSISTENCE_XML_PROPERTY, old, persistenceXml);
- }
-
- public PersistenceXml addPersistenceXml() {
- if (this.persistenceXml != null) {
- throw new IllegalStateException();
- }
- PersistenceArtifactEdit pae = PersistenceArtifactEdit.getArtifactEditForWrite(this.jpaProject().project());
- PersistenceResource pr = pae.createDefaultResource();
- pae.dispose();
- PersistenceXml px = this.buildPersistenceXml(pr);
- this.setPersistenceXml(px);
- return px;
- }
-
- public void removePersistenceXml() {
- if (this.persistenceXml == null) {
- throw new IllegalStateException();
- }
- PersistenceArtifactEdit pae = PersistenceArtifactEdit.getArtifactEditForWrite(jpaProject().project());
- PersistenceResource pr = pae.getResource();
- pae.dispose();
- try {
- WorkbenchResourceHelper.deleteResource(pr);
- }
- catch (CoreException ce) {
- JptCorePlugin.log(ce);
- }
-
- if (! pr.exists()) {
- this.setPersistenceXml(null);
- }
- }
-
-
- // **************** updating ***********************************************
-
- public void update(IProgressMonitor monitor) {
- PersistenceArtifactEdit pae = PersistenceArtifactEdit.getArtifactEditForRead(jpaProject().project());
- PersistenceResource pr = pae.getResource();
-
- if (pr.exists()) {
- if (this.persistenceXml != null) {
- this.persistenceXml.update(pr);
- }
- else {
- setPersistenceXml(this.buildPersistenceXml(pr));
- }
- }
- else {
- setPersistenceXml(null);
- }
-
- pae.dispose();
- }
-
- protected PersistenceXml buildPersistenceXml(PersistenceResource persistenceResource) {
- return this.jpaFactory().buildPersistenceXml(this, persistenceResource);
- }
-
-
- // *************************************************************************
-
- @Override
- public PersistenceUnit persistenceUnit() {
- throw new UnsupportedOperationException("No PersistenceUnit in this context");
- }
-
-
- //******** Validation *************************************************
-
- /* If this is true, it may be assumed that all the requirements are valid
- * for further validation. For example, if this is true at the point we
- * are validating persistence units, it may be assumed that there is a
- * single persistence.xml and that it has valid content down to the
- * persistence unit level. */
- private boolean okToContinueValidation = true;
-
- public void addToMessages(List<IMessage> messages) {
- addNoPersistenceXmlMessage(messages);
- //TODO - multiple persistence unit message
- addOrphanedJavaClassMessages(messages);
-
- if(okToContinueValidation) {
- getPersistenceXml().addToMessages(messages);
- }
-
- }
-
- protected void addNoPersistenceXmlMessage(List<IMessage> messages) {
- if (persistenceXml == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PROJECT_NO_PERSISTENCE_XML,
- this)
- );
- okToContinueValidation = false;
- }
- }
-
-
-
-
- protected void addOrphanedJavaClassMessages(List<IMessage> messages) {
-// for (Iterator<JavaPersistentType> stream = jpaProject.javaPersistentTypes(); stream.hasNext(); ) {
-// JavaPersistentType jpType = stream.next();
-// if (jpType.getMappingKey() != IMappingKeys.NULL_TYPE_MAPPING_KEY && ! contains(jpType)) {
-// messages.add(
-// JpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// IJpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CONTEXT,
-// jpType.getMapping(), jpType.getMapping().validationTextRange())
-// );
-// }
-// }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/RelationshipMappingTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/RelationshipMappingTools.java
deleted file mode 100644
index dea08e011e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/RelationshipMappingTools.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.core.internal.context;
-
-import java.util.StringTokenizer;
-
-public class RelationshipMappingTools
-{
- public static boolean targetEntityIsValid(String targetEntity) {
- if (targetEntity == null) {
- return true;
- }
- // balance is # of name tokens - # of period tokens seen so far
- // initially 0; finally 1; should never drop < 0 or > 1
- int balance = 0;
- for (StringTokenizer t = new StringTokenizer(targetEntity, ".", true); t.hasMoreTokens();) {
- String s = t.nextToken();
- if (s.indexOf('.') >= 0) {
- // this is a delimiter
- if (s.length() > 1) {
- // too many periods in a row
- return false;
- }
- balance--;
- if (balance < 0) {
- return false;
- }
- } else {
- // this is an identifier segment
- balance++;
- }
- }
- return (balance == 1);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
deleted file mode 100644
index 58efe3ecaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,163 +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.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractJavaAttributeMapping extends AbstractJavaJpaContextNode
- implements JavaAttributeMapping
-{
- protected JavaResourcePersistentAttribute persistentAttributeResource;
-
-
- protected AbstractJavaAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- this.persistentAttributeResource = persistentAttributeResource;
- }
-
- protected JavaResourceNode mappingResource() {
- return this.persistentAttributeResource.mappingAnnotation(annotationName());
- }
-
- public GenericJavaPersistentAttribute persistentAttribute() {
- return (GenericJavaPersistentAttribute) this.parent();
- }
-
- /**
- * the persistent attribute can tell whether there is a "specified" mapping
- * or a "default" one
- */
- public boolean isDefault() {
- return this.persistentAttribute().mappingIsDefault();
- }
-
- protected boolean embeddableOwned() {
- return this.typeMapping().getKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- protected boolean entityOwned() {
- return this.typeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public TypeMapping typeMapping() {
- return this.persistentAttribute().typeMapping();
- }
-
- public String attributeName() {
- return this.persistentAttribute().getName();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.mappingResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.persistentAttribute().validationTextRange(astRoot);
- }
-
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- this.persistentAttributeResource = persistentAttributeResource;
- }
-
- public String primaryKeyColumnName() {
- return null;
- }
-
- public boolean isOverridableAttributeMapping() {
- return false;
- }
-
- public boolean isOverridableAssociationMapping() {
- return false;
- }
-
- public boolean isIdMapping() {
- return false;
- }
-
- //************ Validation *************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- addModifierMessages(messages, astRoot);
- addInvalidMappingMessage(messages, astRoot);
-
- }
-
- protected void addModifierMessages(List<IMessage> messages, CompilationUnit astRoot) {
- GenericJavaPersistentAttribute attribute = this.persistentAttribute();
- if (attribute.getMapping().getKey() != MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY
- && persistentAttributeResource.isForField()) {
- int flags;
-
- try {
- flags = persistentAttributeResource.getMember().getJdtMember().getFlags();
- } catch (JavaModelException jme) {
- /* no error to log, in that case */
- return;
- }
-
- if (Flags.isFinal(flags)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD,
- new String[] {attribute.getName()},
- attribute, attribute.validationTextRange(astRoot))
- );
- }
-
- if (Flags.isPublic(flags)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD,
- new String[] {attribute.getName()},
- attribute, attribute.validationTextRange(astRoot))
- );
-
- }
- }
- }
-
- protected void addInvalidMappingMessage(List<IMessage> messages, CompilationUnit astRoot) {
- if (! typeMapping().attributeMappingKeyAllowed(this.getKey())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING,
- new String[] {this.persistentAttribute().getName()},
- this, this.validationTextRange(astRoot))
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaColumn.java
deleted file mode 100644
index e0f7d061cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaColumn.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractColumn;
-import org.eclipse.jpt.core.context.java.JavaAbstractColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.AbstractColumnAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public abstract class AbstractJavaColumn<T extends AbstractColumnAnnotation> extends AbstractJavaNamedColumn<T>
- implements JavaAbstractColumn
-{
-
- protected String specifiedTable;
-
- protected String defaultTable;
-
- protected Boolean specifiedUnique;
-
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
- protected AbstractJavaColumn(JavaJpaContextNode parent, JavaAbstractColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- protected void initializeFromResource(T column) {
- super.initializeFromResource(column);
- this.defaultTable = this.defaultTable();
- this.specifiedTable = this.specifiedTable(column);
- this.specifiedUnique = this.specifiedUnique(column);
- this.specifiedNullable = this.specifiedNullable(column);
- this.specifiedInsertable = this.specifiedInsertable(column);
- this.specifiedUpdatable = this.specifiedUpdatable(column);
- }
-
- @Override
- public JavaAbstractColumn.Owner owner() {
- return (JavaAbstractColumn.Owner) super.owner();
- }
-
- //************** IAbstractColumn implementation *******************
-
-
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- columnResource().setTable(newSpecifiedTable);
- firePropertyChanged(AbstractColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(AbstractColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String newDefaultTable) {
- String oldDefaultTable = this.defaultTable;
- this.defaultTable = newDefaultTable;
- firePropertyChanged(AbstractColumn.DEFAULT_TABLE_PROPERTY, oldDefaultTable, newDefaultTable);
- }
-
- public Boolean getUnique() {
- return (this.getSpecifiedUnique() == null) ? this.getDefaultUnique() : this.getSpecifiedUnique();
- }
-
- public Boolean getDefaultUnique() {
- return AbstractColumn.DEFAULT_UNIQUE;
- }
-
- public Boolean getSpecifiedUnique() {
- return this.specifiedUnique;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- this.columnResource().setUnique(newSpecifiedUnique);
- firePropertyChanged(AbstractColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedUnique_(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- firePropertyChanged(AbstractColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- public Boolean getNullable() {
- return (this.getSpecifiedNullable() == null) ? this.getDefaultNullable() : this.getSpecifiedNullable();
- }
-
- public Boolean getDefaultNullable() {
- return AbstractColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- this.columnResource().setNullable(newSpecifiedNullable);
- firePropertyChanged(AbstractColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(AbstractColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- public Boolean getInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.getDefaultInsertable() : this.getSpecifiedInsertable();
- }
-
- public Boolean getDefaultInsertable() {
- return AbstractColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- this.columnResource().setInsertable(newSpecifiedInsertable);
- firePropertyChanged(AbstractColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(AbstractColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- public Boolean getUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.getDefaultUpdatable() : this.getSpecifiedUpdatable();
- }
-
- public Boolean getDefaultUpdatable() {
- return AbstractColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- this.columnResource().setUpdatable(newSpecifiedUpdatable);
- firePropertyChanged(AbstractColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(AbstractColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- @Override
- protected String tableName() {
- return this.getTable();
- }
-
- public TextRange tableTextRange(CompilationUnit astRoot) {
- return columnResource().tableTextRange(astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return columnResource().tableTouches(pos, astRoot);
- }
-
- private Iterator<String> candidateTableNames() {
- return this.tableIsAllowed() ? this.owner().typeMapping().associatedTableNamesIncludingInherited() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateTableNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateTableNames(), filter);
- }
-
- private Iterator<String> quotedCandidateTableNames(Filter<String> filter) {
- return StringTools.quote(this.candidateTableNames(filter));
- }
-
- /**
- * Return whether the 'table' element is allowed. It is not allowed for
- * join columns inside of join tables.
- */
- public abstract boolean tableIsAllowed();
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos, astRoot)) {
- return this.quotedCandidateTableNames(filter);
- }
- return null;
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- this.setDefaultTable(this.defaultTable());
- this.setSpecifiedTable_(this.specifiedTable(column));
- this.setSpecifiedUnique_(this.specifiedUnique(column));
- this.setSpecifiedNullable_(this.specifiedNullable(column));
- this.setSpecifiedInsertable_(this.specifiedInsertable(column));
- this.setSpecifiedUpdatable_(this.specifiedUpdatable(column));
- }
-
- protected String defaultTable() {
- return this.owner().defaultTableName();
- }
-
- protected String specifiedTable(AbstractColumnAnnotation column) {
- return column.getTable();
- }
-
- protected Boolean specifiedUnique(AbstractColumnAnnotation column) {
- return column.getUnique();
- }
-
- protected Boolean specifiedNullable(AbstractColumnAnnotation column) {
- return column.getNullable();
- }
-
- protected Boolean specifiedInsertable(AbstractColumnAnnotation column) {
- return column.getInsertable();
- }
-
- protected Boolean specifiedUpdatable(AbstractColumnAnnotation column) {
- return column.getUpdatable();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java
deleted file mode 100644
index 98ef6f2e4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java
+++ /dev/null
@@ -1,135 +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.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
-
-
-public abstract class AbstractJavaGenerator extends AbstractJavaJpaContextNode implements Generator
-{
- protected String name;
-
- protected Integer specifiedInitialValue;
-
- protected Integer specifiedAllocationSize;
-
- protected GeneratorAnnotation generatorResource;
-
- protected AbstractJavaGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
- public void initializeFromResource(GeneratorAnnotation generatorResource) {
- this.generatorResource = generatorResource;
- this.name = this.name(generatorResource);
- this.specifiedInitialValue = this.specifiedInitialValue(generatorResource);
- this.specifiedAllocationSize = this.specifiedAllocationSize(generatorResource);
- }
-
- protected GeneratorAnnotation generatorResource() {
- return this.generatorResource;
- }
-
- protected String name(GeneratorAnnotation generatorResource) {
- return generatorResource.getName();
- }
-
- protected Integer specifiedInitialValue(GeneratorAnnotation generatorResource) {
- return generatorResource.getInitialValue();
- }
-
- protected Integer specifiedAllocationSize(GeneratorAnnotation generatorResource) {
- return generatorResource.getAllocationSize();
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- generatorResource().setName(newName);
- firePropertyChanged(Generator.NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(Generator.NAME_PROPERTY, oldName, newName);
- }
-
- public Integer getInitialValue() {
- return (this.getSpecifiedInitialValue() == null) ? this.getDefaultInitialValue() : this.getSpecifiedInitialValue();
- }
-
- public Integer getSpecifiedInitialValue() {
- return this.specifiedInitialValue;
- }
-
- public void setSpecifiedInitialValue(Integer newSpecifiedInitialValue) {
- Integer oldSpecifiedInitialValue = this.specifiedInitialValue;
- this.specifiedInitialValue = newSpecifiedInitialValue;
- generatorResource().setInitialValue(newSpecifiedInitialValue);
- firePropertyChanged(Generator.SPECIFIED_INITIAL_VALUE_PROPERTY, oldSpecifiedInitialValue, newSpecifiedInitialValue);
- }
-
- protected void setSpecifiedInitialValue_(Integer newSpecifiedInitialValue) {
- Integer oldSpecifiedInitialValue = this.specifiedInitialValue;
- this.specifiedInitialValue = newSpecifiedInitialValue;
- firePropertyChanged(Generator.SPECIFIED_INITIAL_VALUE_PROPERTY, oldSpecifiedInitialValue, newSpecifiedInitialValue);
- }
-
- public Integer getAllocationSize() {
- return (this.getSpecifiedAllocationSize() == null) ? this.getDefaultAllocationSize() : this.getSpecifiedAllocationSize();
- }
-
- public Integer getSpecifiedAllocationSize() {
- return this.specifiedAllocationSize;
- }
-
- public void setSpecifiedAllocationSize(Integer newSpecifiedAllocationSize) {
- Integer oldSpecifiedAllocationSize = this.specifiedAllocationSize;
- this.specifiedAllocationSize = newSpecifiedAllocationSize;
- generatorResource().setAllocationSize(newSpecifiedAllocationSize);
- firePropertyChanged(Generator.SPECIFIED_ALLOCATION_SIZE_PROPERTY, oldSpecifiedAllocationSize, newSpecifiedAllocationSize);
- }
-
- protected void setSpecifiedAllocationSize_(Integer newSpecifiedAllocationSize) {
- Integer oldSpecifiedAllocationSize = this.specifiedAllocationSize;
- this.specifiedAllocationSize = newSpecifiedAllocationSize;
- firePropertyChanged(Generator.SPECIFIED_ALLOCATION_SIZE_PROPERTY, oldSpecifiedAllocationSize, newSpecifiedAllocationSize);
- }
-
- public Integer getDefaultAllocationSize() {
- return Generator.DEFAULT_ALLOCATION_SIZE;
- }
-
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return this.selectionTextRange(astRoot);
- }
-
- public TextRange selectionTextRange(CompilationUnit astRoot) {
- return this.generatorResource.textRange(astRoot);
- }
-
- protected void update(GeneratorAnnotation generatorResource) {
- this.generatorResource = generatorResource;
- this.setName_(this.name(generatorResource));
- this.setSpecifiedInitialValue_(this.specifiedInitialValue(generatorResource));
- this.setSpecifiedAllocationSize_(this.specifiedAllocationSize(generatorResource));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
deleted file mode 100644
index ba1c3f64ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractJavaJpaContextNode extends AbstractJpaContextNode implements JavaJpaContextNode
-{
- // ********** constructor **********
-
- protected AbstractJavaJpaContextNode(JpaContextNode parent) {
- super(parent);
- }
-
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (this.isConnected()) {
- Iterator<String> result = this.connectedCandidateValuesFor(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * This method is called if the database is connected, allowing us to
- * get candidates from the various database tables etc.
- * This method should NOT be cascaded to "child" objects; it should
- * only return candidates for the current object. The cascading is
- * handled by #candidateValuesFor(int, Filter, CompilationUnit).
- */
- public Iterator<String> connectedCandidateValuesFor(int pos, Filter<String> filter, CompilationUnit astRoot) {
- return null;
- }
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #addToMessages(List, CompilationUnit))}
- * should be preceded by a "super" call to this method
- */
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
deleted file mode 100644
index 206697ac7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.MapKey;
-import org.eclipse.jpt.core.resource.java.OrderBy;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractJavaMultiRelationshipMapping<T extends RelationshipMappingAnnotation>
- extends AbstractJavaRelationshipMapping<T> implements MultiRelationshipMapping
-{
-
- protected String mappedBy;
-
- protected String orderBy;
-
- protected boolean isNoOrdering;
-
- protected boolean isPkOrdering;
-
- protected boolean isCustomOrdering;
-
- //TODO should this be null if this is the non-owning side of the relationship??
- protected final JavaJoinTable joinTable;
-
- protected String mapKey;
-
- protected AbstractJavaMultiRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinTable = jpaFactory().buildJavaJoinTable(this);
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.setMappedByOnResourceModel(newMappedBy);
- firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected abstract void setMappedByOnResourceModel(String mappedBy);
-
- public String getOrderBy() {
- return this.orderBy;
- }
-
- public void setOrderBy(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- if (newOrderBy == null) {
- if (orderByResource() != null) {
- removeOrderByResource();
- }
- }
- else {
- if (orderByResource() == null) {
- addOrderByResource();
- }
- orderByResource().setValue(newOrderBy);
- }
- firePropertyChanged(MultiRelationshipMapping.ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected void setOrderBy_(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- firePropertyChanged(MultiRelationshipMapping.ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected OrderBy orderByResource() {
- return (OrderBy) this.persistentAttributeResource.annotation(OrderBy.ANNOTATION_NAME);
- }
-
- protected OrderBy addOrderByResource() {
- return (OrderBy) this.persistentAttributeResource.addAnnotation(OrderBy.ANNOTATION_NAME);
- }
-
- protected void removeOrderByResource() {
- this.persistentAttributeResource.removeAnnotation(OrderBy.ANNOTATION_NAME);
- }
-
- public boolean isNoOrdering() {
- return this.isNoOrdering;
- }
-
- public void setNoOrdering(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- if (newNoOrdering) {
- if (orderByResource() != null) {
- removeOrderByResource();
- }
- }
- else {
- //??
- }
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- protected void setNoOrdering_(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- public boolean isPkOrdering() {
- return this.isPkOrdering;
- }
-
- public void setPkOrdering(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- if (newPkOrdering) {
- if (orderByResource() == null) {
- addOrderByResource();
- }
- else {
- orderByResource().setValue(null);
- }
- }
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- protected void setPkOrdering_(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- public boolean isCustomOrdering() {
- return this.isCustomOrdering;
- }
-
- public void setCustomOrdering(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- if (newCustomOrdering) {
- setOrderBy("");
- }
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- protected void setCustomOrdering_(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- public FetchType getDefaultFetch() {
- return MultiRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- public JavaJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- public boolean isJoinTableSpecified() {
- return getJoinTable().isSpecified();
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public String getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- if (oldMapKey != newMapKey) {
- if (this.mapKeyResource(this.persistentAttributeResource) != null) {
- if (newMapKey != null) {
- this.mapKeyResource(this.persistentAttributeResource).setName(newMapKey);
- }
- else {
- this.persistentAttributeResource.removeAnnotation(MapKey.ANNOTATION_NAME);
- }
- }
- else if (newMapKey != null) {
- this.persistentAttributeResource.addAnnotation(MapKey.ANNOTATION_NAME);
- mapKeyResource(this.persistentAttributeResource).setName(newMapKey);
- }
- }
- firePropertyChanged(MultiRelationshipMapping.MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected void setMapKey_(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- firePropertyChanged(MultiRelationshipMapping.MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
-//TODO default orderBy - this wasn't supported in 1.0 either
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// super.refreshDefaults(defaultsContext);
-// // if (isOrderByPk()) {
-// // refreshDefaultOrderBy(defaultsContext);
-// // }
-// }
-//
-// //primary key ordering when just the @OrderBy annotation is present
-// protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) {
-// IEntity targetEntity = getResolvedTargetEntity();
-// if (targetEntity != null) {
-// setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC");
-// }
-// }
-
- @Override
- protected String defaultTargetEntity(JavaResourcePersistentAttribute persistentAttributeResource) {
- if (!persistentAttributeResource.typeIsContainer()) {
- return null;
- }
- return persistentAttributeResource.getQualifiedReferenceEntityElementTypeName();
- }
-
- protected abstract boolean mappedByTouches(int pos, CompilationUnit astRoot);
-
- protected boolean mapKeyNameTouches(int pos, CompilationUnit astRoot) {
- if (mapKeyResource(this.persistentAttributeResource) != null) {
- return mapKeyResource(this.persistentAttributeResource).nameTouches(pos, astRoot);
- }
- return false;
- }
-
- protected MapKey mapKeyResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- return (MapKey) persistentAttributeResource.annotation(MapKey.ANNOTATION_NAME);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
- protected Iterator<String> candidateMapKeyNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateMapKeyNames(), filter);
- }
-
- protected Iterator<String> quotedCandidateMapKeyNames(Filter<String> filter) {
- return StringTools.quote(this.candidateMapKeyNames(filter));
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getJoinTable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mappedByTouches(pos, astRoot)) {
- return this.quotedCandidateMappedByAttributeNames(filter);
- }
- if (this.mapKeyNameTouches(pos, astRoot)) {
- return this.quotedCandidateMapKeyNames(filter);
- }
- return null;
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- MapKey mapKey = this.mapKeyResource(persistentAttributeResource);
- if (mapKey != null) {
- this.mapKey = mapKey.getName();
- }
- this.initializeOrderBy(this.orderByResource());
- this.joinTable.initializeFromResource(persistentAttributeResource);
- }
-
- @Override
- protected void initialize(T relationshipMapping) {
- super.initialize(relationshipMapping);
- this.mappedBy = this.mappedBy(relationshipMapping);
- }
-
- protected void initializeOrderBy(OrderBy orderBy) {
- if (orderBy != null) {
- this.orderBy = orderBy.getValue();
- if (orderBy.getValue() == null) {
- this.isPkOrdering = true;
- }
- else {
- this.isCustomOrdering = true;
- }
- }
- else {
- this.isNoOrdering = true;
- }
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.updateMapKey(persistentAttributeResource);
- this.updateOrderBy(this.orderByResource());
- this.joinTable.update(persistentAttributeResource);
- }
-
- @Override
- protected void update(T relationshipMapping) {
- super.update(relationshipMapping);
- this.setMappedBy(this.mappedBy(relationshipMapping));
- }
-
- protected void updateMapKey(JavaResourcePersistentAttribute persistentAttributeResource) {
- MapKey mapKey = this.mapKeyResource(persistentAttributeResource);
- if (mapKey != null) {
- setMapKey_(mapKey.getName());
- }
- else {
- setMapKey_(null);
- }
- }
-
- protected void updateOrderBy(OrderBy orderBy) {
- if (orderBy != null) {
- setOrderBy_(orderBy.getValue());
- if (orderBy.getValue() == null) {
- setPkOrdering_(true);
- setCustomOrdering_(false);
- setNoOrdering_(false);
- }
- else {
- setPkOrdering_(false);
- setCustomOrdering_(true);
- setNoOrdering_(false);
- }
- }
- else {
- setOrderBy_(null);
- setPkOrdering_(false);
- setCustomOrdering_(false);
- setNoOrdering_(true);
- }
- }
- protected abstract String mappedBy(T relationshipMapping);
-
- //******** Validation ***********************************
-
- public abstract TextRange mappedByTextRange(CompilationUnit astRoot);
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- if (this.isJoinTableSpecified() || isRelationshipOwner()) {
- getJoinTable().addToMessages(messages, astRoot);
- }
- if (this.getMappedBy() != null) {
- addMappedByMessages(messages, astRoot);
- }
- }
-
- protected void addMappedByMessages(List<IMessage> messages, CompilationUnit astRoot) {
- String mappedBy = this.getMappedBy();
-
- if (this.isJoinTableSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_WITH_JOIN_TABLE,
- this.getJoinTable(), this.getJoinTable().validationTextRange(astRoot))
- );
-
- }
-
- Entity targetEntity = this.getResolvedTargetEntity();
-
- if (targetEntity == null) {
- // already have validation messages for that
- return;
- }
-
- PersistentAttribute attribute = targetEntity.persistentType().resolveAttribute(mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {mappedBy},
- this,
- this.mappedByTextRange(astRoot))
- );
- return;
- }
-
- if (! this.mappedByIsValid(attribute.getMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {mappedBy},
- this,
- this.mappedByTextRange(astRoot))
- );
- return;
- }
-
- NonOwningMapping mappedByMapping;
- try {
- mappedByMapping = (NonOwningMapping) attribute.getMapping();
- } catch (ClassCastException cce) {
- // there is no error then
- return;
- }
-
- if (mappedByMapping.getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this,
- this.mappedByTextRange(astRoot))
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
deleted file mode 100644
index f0d82fe06e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public abstract class AbstractJavaNamedColumn<T extends NamedColumnAnnotation> extends AbstractJavaJpaContextNode
- implements JavaNamedColumn
-{
-
- protected Owner owner;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String columnDefinition;
-
- protected AbstractJavaNamedColumn(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- // ******************* initialization from java resource model ********************
-
- protected void initializeFromResource(T column) {
- this.specifiedName = column.getName();
- this.defaultName = this.defaultName();
- this.columnDefinition = column.getColumnDefinition();
- }
-
-
- protected abstract T columnResource();
-
-
- //************** INamedColumn implementation *****************
- public String getName() {
- return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- columnResource().setName(newSpecifiedName);
- firePropertyChanged(NamedColumn.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(NamedColumn.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(NamedColumn.DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- columnResource().setColumnDefinition(newColumnDefinition);
- firePropertyChanged(NamedColumn.COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setColumnDefinition_(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- firePropertyChanged(NamedColumn.COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public Owner owner() {
- return this.owner;
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.columnResource().nameTextRange(astRoot);
- return (textRange != null) ? textRange : this.owner().validationTextRange(astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.columnResource().nameTouches(pos, astRoot);
- }
-
- public Column dbColumn() {
- Table table = this.dbTable();
- return (table == null) ? null : table.columnNamed(this.getName());
- }
-
- public Table dbTable() {
- return owner().dbTable(this.tableName());
- }
-
- /**
- * Return the name of the column's table.
- */
- protected abstract String tableName();
-
- public boolean isResolved() {
- return this.dbColumn() != null;
- }
-
- @Override
- public Iterator<String> connectedCandidateValuesFor(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedCandidateValuesFor(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.quotedCandidateNames(filter);
- }
- return null;
- }
-
- private Iterator<String> candidateNames() {
- Table dbTable = this.dbTable();
- return (dbTable != null) ? dbTable.columnNames() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateNames(), filter);
- }
-
- private Iterator<String> quotedCandidateNames(Filter<String> filter) {
- return StringTools.quote(this.candidateNames(filter));
- }
-
-
- // ******************* update from java resource model ********************
-
- protected void update(T column) {
- this.setSpecifiedName_(column.getName());
- this.setDefaultName(this.defaultName());
- this.setColumnDefinition_(column.getColumnDefinition());
- }
-
- /**
- * Return the default column name.
- */
- protected String defaultName() {
- return this.owner().defaultColumnName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
deleted file mode 100644
index 9683e3d844..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public abstract class AbstractJavaOverride extends AbstractJavaJpaContextNode implements BaseOverride
-{
-
- protected String name;
-
- protected final Owner owner;
-
- protected OverrideAnnotation overrideResource;
-
- public AbstractJavaOverride(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- protected void initializeFromResource(OverrideAnnotation overrideResource) {
- this.overrideResource = overrideResource;
- this.name = this.name(overrideResource);
- }
-
- protected OverrideAnnotation getOverrideResource() {
- return this.overrideResource;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.overrideResource.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void update(OverrideAnnotation overrideResource) {
- this.overrideResource = overrideResource;
- this.setName_(this.name(overrideResource));
- }
-
- protected String name(OverrideAnnotation overrideResource) {
- return overrideResource.getName();
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- public Owner owner() {
- return this.owner;
- }
-
- @Override
- public JavaJpaContextNode parent() {
- return (JavaJpaContextNode) super.parent();
- }
-
- protected abstract Iterator<String> candidateNames();
-
- private Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateNames(), filter);
- }
-
- private Iterator<String> quotedCandidateNames(Filter<String> filter) {
- return StringTools.quote(this.candidateNames(filter));
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.quotedCandidateNames(filter);
- }
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.overrideResource.nameTouches(pos, astRoot);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.overrideResource.textRange(astRoot);
- return (textRange != null) ? textRange : this.parent().validationTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java
deleted file mode 100644
index 0fbcbee3f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java
+++ /dev/null
@@ -1,160 +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.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.resource.java.QueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-
-public abstract class AbstractJavaQuery extends AbstractJavaJpaContextNode implements JavaQuery
-{
- protected String name;
-
- protected String query;
-
- protected final List<JavaQueryHint> hints;
-
- protected QueryAnnotation queryResource;
-
- protected AbstractJavaQuery(JavaJpaContextNode parent) {
- super(parent);
- this.hints = new ArrayList<JavaQueryHint>();
- }
-
- protected QueryAnnotation query() {
- return this.queryResource;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.queryResource.setName(newName);
- firePropertyChanged(Query.NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- this.queryResource.setQuery(newQuery);
- firePropertyChanged(Query.QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<JavaQueryHint> hints() {
- return new CloneListIterator<JavaQueryHint>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public JavaQueryHint addHint(int index) {
- JavaQueryHint hint = jpaFactory().buildJavaQueryHint(this);
- this.hints.add(index, hint);
- this.query().addHint(index);
- this.fireItemAdded(Query.HINTS_LIST, index, hint);
- return hint;
- }
-
- protected void addHint(int index, JavaQueryHint hint) {
- addItemToList(index, hint, this.hints, Query.HINTS_LIST);
- }
-
- public void removeHint(QueryHint queryHint) {
- removeHint(this.hints.indexOf(queryHint));
- }
-
- public void removeHint(int index) {
- JavaQueryHint removedHint = this.hints.remove(index);
- this.query().removeHint(index);
- fireItemRemoved(Query.HINTS_LIST, index, removedHint);
- }
-
- protected void removeHint_(JavaQueryHint hint) {
- removeItemFromList(hint, this.hints, Query.HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.hints, targetIndex, sourceIndex);
- this.query().moveHint(targetIndex, sourceIndex);
- fireItemMoved(Query.HINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void initializeFromResource(QueryAnnotation queryResource) {
- this.queryResource = queryResource;
- this.name = queryResource.getName();
- this.query = queryResource.getQuery();
- this.initializeQueryHints(queryResource);
- }
-
- protected void update(QueryAnnotation queryResource) {
- this.queryResource = queryResource;
- this.setName(queryResource.getName());
- this.setQuery(queryResource.getQuery());
- this.updateQueryHints(queryResource);
- }
-
- protected void initializeQueryHints(QueryAnnotation queryResource) {
- ListIterator<QueryHintAnnotation> annotations = queryResource.hints();
-
- while(annotations.hasNext()) {
- this.hints.add(createQueryHint(annotations.next()));
- }
- }
-
- protected void updateQueryHints(QueryAnnotation queryResource) {
- ListIterator<JavaQueryHint> hints = hints();
- ListIterator<QueryHintAnnotation> resourceHints = queryResource.hints();
-
- while (hints.hasNext()) {
- JavaQueryHint hint = hints.next();
- if (resourceHints.hasNext()) {
- hint.update(resourceHints.next());
- }
- else {
- removeHint_(hint);
- }
- }
-
- while (resourceHints.hasNext()) {
- addHint(hintsSize(), createQueryHint(resourceHints.next()));
- }
- }
-
- protected JavaQueryHint createQueryHint(QueryHintAnnotation hintResource) {
- JavaQueryHint queryHint = jpaFactory().buildJavaQueryHint(this);
- queryHint.initializeFromResource(hintResource);
- return queryHint;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java
deleted file mode 100644
index 06540bfbb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.context.RelationshipMappingTools;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public abstract class AbstractJavaRelationshipMapping<T extends RelationshipMappingAnnotation> extends AbstractJavaAttributeMapping
- implements JavaRelationshipMapping
-{
-
- protected String specifiedTargetEntity;
-
- protected String defaultTargetEntity;
-
- protected Entity resolvedTargetEntity;
-
- protected final JavaCascade cascade;
-
- protected FetchType specifiedFetch;
-
- protected AbstractJavaRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.cascade = new JavaCascade(this);
- }
-
- protected abstract T relationshipMapping();
-
- public String getTargetEntity() {
- return (this.getSpecifiedTargetEntity() == null) ? getDefaultTargetEntity() : this.getSpecifiedTargetEntity();
- }
-
- public String getSpecifiedTargetEntity() {
- return this.specifiedTargetEntity;
- }
-
- public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) {
- String oldSpecifiedTargetEntity = this.specifiedTargetEntity;
- this.specifiedTargetEntity = newSpecifiedTargetEntity;
- this.relationshipMapping().setTargetEntity(newSpecifiedTargetEntity);
- firePropertyChanged(RelationshipMapping.SPECIFIED_TARGET_ENTITY_PROPERTY, oldSpecifiedTargetEntity, newSpecifiedTargetEntity);
- }
-
- public String getDefaultTargetEntity() {
- return this.defaultTargetEntity;
- }
-
- protected void setDefaultTargetEntity(String newDefaultTargetEntity) {
- String oldDefaultTargetEntity = this.defaultTargetEntity;
- this.defaultTargetEntity = newDefaultTargetEntity;
- firePropertyChanged(RelationshipMapping.DEFAULT_TARGET_ENTITY_PROPERTY, oldDefaultTargetEntity, newDefaultTargetEntity);
- }
-
- public Entity getResolvedTargetEntity() {
- return this.resolvedTargetEntity;
- }
-
- protected void setResolvedTargetEntity(Entity newResolvedTargetEntity) {
- Entity oldResolvedTargetEntity = this.resolvedTargetEntity;
- this.resolvedTargetEntity = newResolvedTargetEntity;
- firePropertyChanged(RelationshipMapping.RESOLVED_TARGET_ENTITY_PROPERTY, oldResolvedTargetEntity, newResolvedTargetEntity);
- }
-
- public JavaCascade getCascade() {
- return this.cascade;
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.relationshipMapping().setFetch(FetchType.toJavaResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.defaultTargetEntity = this.defaultTargetEntity(persistentAttributeResource);
- initialize(this.relationshipMapping());
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.setDefaultTargetEntity(this.defaultTargetEntity(persistentAttributeResource));
- this.update(this.relationshipMapping());
- }
-
- protected void initialize(T relationshipMapping) {
- this.specifiedFetch = this.fetch(relationshipMapping);
- this.cascade.initialize(relationshipMapping);
- this.specifiedTargetEntity = this.specifiedTargetEntity(relationshipMapping);
- this.resolvedTargetEntity = this.resolveTargetEntity(relationshipMapping);
- }
-
- protected void update(T relationshipMapping) {
- this.setSpecifiedFetch(this.fetch(relationshipMapping));
- this.cascade.update(relationshipMapping);
- this.setSpecifiedTargetEntity(this.specifiedTargetEntity(relationshipMapping));
- this.setResolvedTargetEntity(this.resolveTargetEntity(relationshipMapping));
- }
-
- protected FetchType fetch(T relationshipMapping) {
- return FetchType.fromJavaResourceModel(relationshipMapping.getFetch());
- }
-
- protected String specifiedTargetEntity(T relationshipMapping) {
- return relationshipMapping.getTargetEntity();
- }
-
- protected abstract String defaultTargetEntity(JavaResourcePersistentAttribute persistentAttributeResource);
-
- protected Entity resolveTargetEntity(T relationshipMapping) {
- String qualifiedTargetEntity = getDefaultTargetEntity();
- if (getSpecifiedTargetEntity() != null) {
- qualifiedTargetEntity = relationshipMapping.getFullyQualifiedTargetEntity();
- }
- if (qualifiedTargetEntity == null) {
- return null;
- }
- PersistentType persistentType = persistenceUnit().persistentType(qualifiedTargetEntity);
- if (persistentType != null && persistentType.mappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (Entity) persistentType.getMapping();
- }
- return null;
- }
-
- public Entity getEntity() {
- if (typeMapping() instanceof Entity) {
- return (Entity) typeMapping();
- }
- return null;
- }
-
- public Iterator<String> allTargetEntityAttributeNames() {
- Entity targetEntity = this.getResolvedTargetEntity();
- return (targetEntity == null) ? EmptyIterator.<String> instance() : targetEntity.persistentType().allAttributeNames();
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return this.allTargetEntityAttributeNames();
- }
-
- protected Iterator<String> candidateMappedByAttributeNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateMappedByAttributeNames(), filter);
- }
-
- protected Iterator<String> quotedCandidateMappedByAttributeNames(Filter<String> filter) {
- return StringTools.quote(this.candidateMappedByAttributeNames(filter));
- }
-
-
- // ********** static methods **********
-
- public boolean targetEntityIsValid(String targetEntity) {
- return RelationshipMappingTools.targetEntityIsValid(targetEntity);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java
deleted file mode 100644
index 0c37a9cd7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaSingleRelationshipMapping;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumns;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractJavaSingleRelationshipMapping<T extends RelationshipMappingAnnotation>
- extends AbstractJavaRelationshipMapping<T> implements JavaSingleRelationshipMapping
-{
-
- protected final List<JavaJoinColumn> specifiedJoinColumns;
-
- protected JavaJoinColumn defaultJoinColumn;
-
- protected Boolean specifiedOptional;
-
- protected AbstractJavaSingleRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
- public FetchType getDefaultFetch() {
- return SingleRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- //***************** ISingleRelationshipMapping implementation *****************
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn newJoinColumn) {
- JavaJoinColumn oldJoinColumn = this.defaultJoinColumn;
- this.defaultJoinColumn = newJoinColumn;
- firePropertyChanged(SingleRelationshipMapping.DEFAULT_JOIN_COLUMN, oldJoinColumn, newJoinColumn);
- }
-
- protected ListIterator<JavaJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JoinColumn oldDefaultJoinColumn = this.getDefaultJoinColumn();
- if (oldDefaultJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultJoinColumn = null;
- }
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnResource = (JoinColumnAnnotation) this.persistentAttributeResource.addAnnotation(index, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumns.ANNOTATION_NAME);
- joinColumn.initializeFromResource(joinColumnResource);
- this.fireItemAdded(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(SingleRelationshipMapping.DEFAULT_JOIN_COLUMN, oldDefaultJoinColumn, null);
- }
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if (!containsSpecifiedJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = createJoinColumn(new NullJoinColumn(this.persistentAttributeResource));
- }
- this.persistentAttributeResource.removeAnnotation(index, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumns.ANNOTATION_NAME);
- fireItemRemoved(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(SingleRelationshipMapping.DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.persistentAttributeResource.move(targetIndex, sourceIndex, JoinColumns.ANNOTATION_NAME);
- fireItemMoved(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public Boolean getOptional() {
- return getSpecifiedOptional() == null ? getDefaultOptional() : getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldSpecifiedOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- setOptionalOnResourceModel(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldSpecifiedOptional, newSpecifiedOptional);
- }
-
- protected abstract void setOptionalOnResourceModel(Boolean newOptional);
-
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.initializeSpecifiedJoinColumns(persistentAttributeResource);
- this.initializeDefaultJoinColumn(persistentAttributeResource);
- }
-
- @Override
- protected void initialize(T relationshipMapping) {
- super.initialize(relationshipMapping);
- this.specifiedOptional = this.specifiedOptional(relationshipMapping);
- }
-
- protected void initializeSpecifiedJoinColumns(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaResourceNode> annotations = persistentAttributeResource.annotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumns.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(createJoinColumn((JoinColumnAnnotation) annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return !containsSpecifiedJoinColumns() && isRelationshipOwner();
- }
-
- protected void initializeDefaultJoinColumn(JavaResourcePersistentAttribute persistentAttributeResource) {
- if (!shouldBuildDefaultJoinColumn()) {
- return;
- }
- this.defaultJoinColumn = this.jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.defaultJoinColumn.initializeFromResource(new NullJoinColumn(persistentAttributeResource));
- }
-
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.updateSpecifiedJoinColumns(persistentAttributeResource);
- this.updateDefaultJoinColumn(persistentAttributeResource);
- }
-
- @Override
- protected void update(T relationshipMapping) {
- super.update(relationshipMapping);
- this.setSpecifiedOptional(this.specifiedOptional(relationshipMapping));
- }
-
- protected abstract Boolean specifiedOptional(T relationshipMapping);
-
-
- protected void updateSpecifiedJoinColumns(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<JavaResourceNode> resourceJoinColumns = persistentAttributeResource.annotations(JoinColumnAnnotation.ANNOTATION_NAME, JoinColumns.ANNOTATION_NAME);
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update((JoinColumnAnnotation) resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn((JoinColumnAnnotation) resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn(JavaResourcePersistentAttribute persistentAttributeResource) {
- if (!shouldBuildDefaultJoinColumn()) {
- setDefaultJoinColumn(null);
- return;
- }
- if (getDefaultJoinColumn() == null) {
- JavaJoinColumn joinColumn = this.jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initializeFromResource(new NullJoinColumn(persistentAttributeResource));
- this.setDefaultJoinColumn(joinColumn);
- }
- else {
- this.defaultJoinColumn.update(new NullJoinColumn(persistentAttributeResource));
- }
- }
-
- protected JavaJoinColumn createJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initializeFromResource(joinColumnResource);
- return joinColumn;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- /**
- * eliminate any "container" types
- */
- @Override
- protected String defaultTargetEntity(JavaResourcePersistentAttribute persistentAttributeResource) {
- if (persistentAttributeResource.typeIsContainer()) {
- return null;
- }
- return persistentAttributeResource.getQualifiedReferenceEntityTypeName();
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- //************* Validation **********************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- //bug 192287 - do not want joinColumn validation errors on the non-owning side
- //of a bidirectional relationship. This is a low risk fix for RC3, but a better
- //solution would be to not have the default joinColumns on the non-owning side.
- //This would fix another bug that we show default joinColumns in this situation.
- if (entityOwned() && isRelationshipOwner()) {
- addJoinColumnMessages(messages, astRoot);
- }
- }
-
- protected void addJoinColumnMessages(List<IMessage> messages, CompilationUnit astRoot) {
-
- for (Iterator<JavaJoinColumn> stream = this.joinColumns(); stream.hasNext();) {
- JavaJoinColumn joinColumn = stream.next();
- String table = joinColumn.getTable();
- boolean doContinue = joinColumn.isConnected();
-
- if (doContinue && this.typeMapping().tableNameIsInvalid(table)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_TABLE,
- new String[] {table, joinColumn.getName()},
- joinColumn, joinColumn.tableTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && ! joinColumn.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn, joinColumn.nameTextRange(astRoot))
- );
- }
-
- if (doContinue && ! joinColumn.isReferencedColumnResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn, joinColumn.referencedColumnNameTextRange(astRoot))
- );
- }
- }
- }
-
-
- public class JoinColumnOwner implements JavaJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String defaultTableName() {
- return AbstractJavaSingleRelationshipMapping.this.typeMapping().tableName();
- }
-
- public Entity targetEntity() {
- return AbstractJavaSingleRelationshipMapping.this.getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return AbstractJavaSingleRelationshipMapping.this.persistentAttribute().getName();
- }
-
- public RelationshipMapping relationshipMapping() {
- return AbstractJavaSingleRelationshipMapping.this;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractJavaSingleRelationshipMapping.this.typeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping typeMapping() {
- return AbstractJavaSingleRelationshipMapping.this.typeMapping();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return AbstractJavaSingleRelationshipMapping.this.defaultJoinColumn == joinColumn;
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return AbstractJavaSingleRelationshipMapping.this.validationTextRange(astRoot);
- }
-
- public int joinColumnsSize() {
- return AbstractJavaSingleRelationshipMapping.this.joinColumnsSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java
deleted file mode 100644
index 9a964b7c0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractJavaTable extends AbstractJavaJpaContextNode
-{
-
- protected String specifiedName;
- protected String defaultName;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
-// protected EList<IUniqueConstraint> uniqueConstraints;
-
-
- protected AbstractJavaTable(JavaJpaContextNode parent) {
- super(parent);
- }
-
- protected void initializeFromResource(TableAnnotation table) {
- this.defaultName = this.defaultName();
- this.defaultSchema = this.defaultSchema();
- this.defaultCatalog = this.defaultCatalog();
- this.specifiedName = table.getName();
- this.specifiedSchema = table.getSchema();
- this.specifiedCatalog = table.getCatalog();
- }
-
- /**
- * Return the java table resource, do not return null if the java annotation does not exist.
- * Use a null resource object instead of null.
- */
- protected abstract TableAnnotation tableResource();
-
- /**
- * Return the fully qualified annotation name of the java table resource
- */
- protected abstract String annotationName();
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- tableResource().setName(newSpecifiedName);
- firePropertyChanged(Table.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(Table.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- public String getCatalog() {
- return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog();
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- tableResource().setCatalog(newSpecifiedCatalog);
- firePropertyChanged(Table.SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedCatalog_(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- firePropertyChanged(Table.SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- public String getSchema() {
- return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema();
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- tableResource().setSchema(newSpecifiedSchema);
- firePropertyChanged(Table.SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedSchema_(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- firePropertyChanged(Table.SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
-// public EList<IUniqueConstraint> getUniqueConstraints() {
-// if (uniqueConstraints == null) {
-// uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS);
-// }
-// return uniqueConstraints;
-// }
-
-
-
- // ********** ITable implementation **********
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- TextRange textRange = tableResource().nameTextRange(astRoot);
- return (textRange != null) ? textRange : this.parent().validationTextRange(astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return tableResource().nameTouches(pos, astRoot);
- }
-
- public TextRange schemaTextRange(CompilationUnit astRoot) {
- TextRange textRange = tableResource().schemaTextRange(astRoot);
- return (textRange != null) ? textRange : this.parent().validationTextRange(astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return tableResource().schemaTouches(pos, astRoot);
- }
-
- public TextRange catalogTextRange(CompilationUnit astRoot) {
- return tableResource().catalogTextRange(astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return tableResource().catalogTouches(pos, astRoot);
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(Table.DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- protected void setDefaultCatalog(String newDefaultCatalog) {
- String oldDefaultCatalog = this.defaultCatalog;
- this.defaultCatalog = newDefaultCatalog;
- firePropertyChanged(Table.DEFAULT_CATALOG_PROPERTY, oldDefaultCatalog, newDefaultCatalog);
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(Table.DEFAULT_SCHEMA_PROPERTY, oldDefaultSchema, newDefaultSchema);
- }
-
-// public IUniqueConstraint createUniqueConstraint(int index) {
-// return createJavaUniqueConstraint(index);
-// }
-//
-// protected abstract JavaUniqueConstraint createJavaUniqueConstraint(int index);
-
-
-
- protected void update(TableAnnotation table) {
- this.setSpecifiedName_(table.getName());
- this.setSpecifiedSchema_(table.getSchema());
- this.setSpecifiedCatalog_(table.getCatalog());
- this.setDefaultName(this.defaultName());
- this.setDefaultSchema(this.defaultSchema());
- this.setDefaultCatalog(this.defaultCatalog());
- //this.updateUniqueConstraints(table);
- }
-
- protected abstract String defaultName();
-
- protected String defaultSchema() {
- if (entityMappings() != null) {
- return entityMappings().getSchema();
- }
- return persistenceUnit().getDefaultSchema();
- }
-
- protected String defaultCatalog() {
- if (entityMappings() != null) {
- return entityMappings().getCatalog();
- }
- return persistenceUnit().getDefaultCatalog();
- }
-
-
-// /**
-// * here we just worry about getting the unique constraints lists the same size;
-// * then we delegate to the unique constraints to synch themselves up
-// */
-// private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
-// // synchronize the model join columns with the Java source
-// List<IUniqueConstraint> constraints = this.getUniqueConstraints();
-// int persSize = constraints.size();
-// int javaSize = 0;
-// boolean allJavaAnnotationsFound = false;
-// for (int i = 0; i < persSize; i++) {
-// JavaUniqueConstraint uniqueConstraint = (JavaUniqueConstraint) constraints.get(i);
-// if (uniqueConstraint.annotation(astRoot) == null) {
-// allJavaAnnotationsFound = true;
-// break; // no need to go any further
-// }
-// uniqueConstraint.updateFromJava(astRoot);
-// javaSize++;
-// }
-// if (allJavaAnnotationsFound) {
-// // remove any model join columns beyond those that correspond to the Java annotations
-// while (persSize > javaSize) {
-// persSize--;
-// constraints.remove(persSize);
-// }
-// }
-// else {
-// // add new model join columns until they match the Java annotations
-// while (!allJavaAnnotationsFound) {
-// JavaUniqueConstraint uniqueConstraint = this.createJavaUniqueConstraint(javaSize);
-// if (uniqueConstraint.annotation(astRoot) == null) {
-// allJavaAnnotationsFound = true;
-// }
-// else {
-// this.getUniqueConstraints().add(uniqueConstraint);
-// uniqueConstraint.updateFromJava(astRoot);
-// javaSize++;
-// }
-// }
-// }
-// }
-
- @Override
- public JavaJpaContextNode parent() {
- return (JavaJpaContextNode) super.parent();
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = tableResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.parent().validationTextRange(astRoot);
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable() {
- Schema schema = this.dbSchema();
- return (schema == null) ? null : schema.tableNamed(this.getName());
- }
-
- public Schema dbSchema() {
- return this.database().schemaNamed(this.getSchema());
- }
-
- public boolean hasResolvedSchema() {
- return this.dbSchema() != null;
- }
-
- public boolean isResolved() {
- return this.dbTable() != null;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
-// for (IUniqueConstraint constraint : this.getUniqueConstraints()) {
-// result = ((JavaUniqueConstraint) constraint).candidateValuesFor(pos, filter, astRoot);
-// if (result != null) {
-// return result;
-// }
-// }
- return null;
- }
-
- /**
- * called if the database is connected
- * name, schema, catalog
- */
- @Override
- public Iterator<String> connectedCandidateValuesFor(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedCandidateValuesFor(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.quotedCandidateNames(filter);
- }
- if (this.schemaTouches(pos, astRoot)) {
- return this.quotedCandidateSchemas(filter);
- }
- if (this.catalogTouches(pos, astRoot)) {
- return this.quotedCandidateCatalogs(filter);
- }
- return null;
- }
-
- private Iterator<String> candidateNames() {
- Schema dbSchema = this.dbSchema();
- return (dbSchema != null) ? dbSchema.tableNames() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateNames(), filter);
- }
-
- private Iterator<String> quotedCandidateNames(Filter<String> filter) {
- return StringTools.quote(this.candidateNames(filter));
- }
-
- private Iterator<String> candidateSchemas() {
- return this.database().schemaNames();
- }
-
- private Iterator<String> candidateSchemas(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateSchemas(), filter);
- }
-
- private Iterator<String> quotedCandidateSchemas(Filter<String> filter) {
- return StringTools.quote(this.candidateSchemas(filter));
- }
-
- private Iterator<String> candidateCatalogs() {
- return this.database().catalogNames();
- }
-
- private Iterator<String> candidateCatalogs(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateCatalogs(), filter);
- }
-
- private Iterator<String> quotedCandidateCatalogs(Filter<String> filter) {
- return StringTools.quote(this.candidateCatalogs(filter));
- }
-
- public String qualifiedName() {
- return NameTools.buildQualifiedDatabaseObjectName(this.getCatalog(), this.getSchema(), this.getName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(qualifiedName());
- }
-
- @Override
- public String displayString() {
- return qualifiedName();
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- boolean doContinue = isConnected();
- String schema = getSchema();
-
- if (doContinue && ! hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_SCHEMA,
- new String[] {schema, getName()},
- this,
- schemaTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && ! isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_NAME,
- new String[] {getName()},
- this,
- nameTextRange(astRoot))
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java
deleted file mode 100644
index cb574b8550..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,112 +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.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public abstract class AbstractJavaTypeMapping extends AbstractJavaJpaContextNode
- implements JavaTypeMapping
-{
- protected JavaResourcePersistentType persistentTypeResource;
-
-
- protected AbstractJavaTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- protected JavaResourceNode mappingResource() {
- return this.persistentTypeResource.mappingAnnotation(annotationName());
- }
-
- //***************** ITypeMapping implementation *****************
-
- public JavaPersistentType persistentType() {
- return (JavaPersistentType) parent();
- }
-
- public String tableName() {
- return null;
- }
-
- public org.eclipse.jpt.db.internal.Table primaryDbTable() {
- return null;
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- return null;
- }
-
- public Schema dbSchema() {
- return null;
- }
-
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return true;
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- //******************** updatating *********************
- public void initializeFromResource(JavaResourcePersistentType persistentTypeResource) {
- this.persistentTypeResource = persistentTypeResource;
- }
-
- public void update(JavaResourcePersistentType persistentTypeResource) {
- this.persistentTypeResource = persistentTypeResource;
- }
-
- //******************** validation *********************
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.mappingResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.persistentType().validationTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java
deleted file mode 100644
index 99dd6d9940..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAssociationOverride.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class GenericJavaAssociationOverride extends AbstractJavaOverride
- implements JavaAssociationOverride
-{
-
- protected final List<JavaJoinColumn> specifiedJoinColumns;
-
- protected final List<JavaJoinColumn> defaultJoinColumns;
-
-
- public GenericJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner) {
- super(parent, owner);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- this.defaultJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
- @Override
- protected AssociationOverrideAnnotation getOverrideResource() {
- return (AssociationOverrideAnnotation) super.getOverrideResource();
- }
-
- @Override
- public AssociationOverride.Owner owner() {
- return (AssociationOverride.Owner) super.owner();
- }
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public ListIterator<JavaJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnResource = getOverrideResource().addJoinColumn(index);
- joinColumn.initializeFromResource(joinColumnResource);
- this.fireItemAdded(AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- getOverrideResource().removeJoinColumn(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedJoinColumn(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- getOverrideResource().moveJoinColumn(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.owner().typeMapping().allOverridableAssociationNames();
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- public void initializeFromResource(AssociationOverrideAnnotation associationOverride) {
- super.initializeFromResource(associationOverride);
- this.name = associationOverride.getName();
- initializeSpecifiedJoinColumns(associationOverride);
- }
-
- protected void initializeSpecifiedJoinColumns(AssociationOverrideAnnotation associationOverride) {
- ListIterator<JoinColumnAnnotation> annotations = associationOverride.joinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(createJoinColumn(annotations.next()));
- }
- }
-
- public void update(AssociationOverrideAnnotation associationOverride) {
- super.update(associationOverride);
- updateSpecifiedJoinColumns(associationOverride);
- }
-
- protected void updateSpecifiedJoinColumns(AssociationOverrideAnnotation associationOverride) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = associationOverride.joinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
-
- protected JavaJoinColumn createJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initializeFromResource(joinColumnResource);
- return joinColumn;
- }
-
- public class JoinColumnOwner implements JavaJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String defaultTableName() {
- return GenericJavaAssociationOverride.this.owner.typeMapping().tableName();
- }
-
- public String defaultColumnName() {
- return null;
- }
-
- public Entity targetEntity() {
- RelationshipMapping relationshipMapping = relationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return GenericJavaAssociationOverride.this.getName();
- }
-
- public RelationshipMapping relationshipMapping() {
- return GenericJavaAssociationOverride.this.owner().relationshipMapping(GenericJavaAssociationOverride.this.getName());
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return typeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaAssociationOverride.this.owner.typeMapping();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericJavaAssociationOverride.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public int joinColumnsSize() {
- return GenericJavaAssociationOverride.this.joinColumnsSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java
deleted file mode 100644
index b854f11c47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaAttributeOverride.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-
-
-public class GenericJavaAttributeOverride extends AbstractJavaOverride
- implements JavaAttributeOverride
-{
-
- protected final JavaColumn column;
-
-
- public GenericJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner) {
- super(parent, owner);
- this.column = jpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- protected AttributeOverrideAnnotation getOverrideResource() {
- return (AttributeOverrideAnnotation) super.getOverrideResource();
- }
-
- @Override
- public AttributeOverride.Owner owner() {
- return (AttributeOverride.Owner) super.owner();
- }
-
- public ColumnAnnotation columnResource() {
- return this.getOverrideResource().getNonNullColumn();
- }
-
- public String defaultColumnName() {
- ColumnMapping columnMapping = columnMapping();
- if (columnMapping == null) {
- return null;
- }
- return columnMapping.getColumn().getName();
- }
-
- public String defaultTableName() {
- ColumnMapping columnMapping = columnMapping();
- if (columnMapping == null) {
- return null;
- }
- String tableName = columnMapping.getColumn().getSpecifiedTable();
- if (tableName != null) {
- return tableName;
- }
- return owner().typeMapping().tableName();
- }
-
- protected ColumnMapping columnMapping() {
- return owner().columnMapping(getName());
- }
-
- //************* IColumn.Owner implementation **************
- public TypeMapping typeMapping() {
- return this.owner().typeMapping();
- }
-
- public Table dbTable(String tableName) {
- return this.typeMapping().dbTable(tableName);
- }
-
- //************* IAttributeOverride implementation **************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- //************* JavaOverride implementation **************
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.owner().typeMapping().allOverridableAttributeNames();
- }
-
- //************* java resource model -> java context model **************
- public void initializeFromResource(AttributeOverrideAnnotation attributeOverrideResource) {
- super.initializeFromResource(attributeOverrideResource);
- this.column.initializeFromResource(this.columnResource());
- }
-
- public void update(AttributeOverrideAnnotation attributeOverrideResource) {
- super.update(attributeOverrideResource);
- this.column.update(this.columnResource());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
-
- // ********** static methods **********
-// static JavaAttributeOverride createAttributeOverride(Owner owner, Member member, int index) {
-// return JpaJavaMappingsFactory.eINSTANCE.createJavaAttributeOverride(owner, member, buildAnnotationAdapter(index));
-// }
-//
-// private static IndexedDeclarationAnnotationAdapter buildAnnotationAdapter(int index) {
-// return new CombinationIndexedDeclarationAnnotationAdapter(SINGLE_DECLARATION_ANNOTATION_ADAPTER, MULTIPLE_DECLARATION_ANNOTATION_ADAPTER, index, JPA.ATTRIBUTE_OVERRIDE);
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java
deleted file mode 100644
index af16c2cb7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaBasicMapping.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.Basic;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Enumerated;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Lob;
-import org.eclipse.jpt.core.resource.java.Temporal;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaBasicMapping extends AbstractJavaAttributeMapping implements JavaBasicMapping
-{
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected EnumType specifiedEnumerated;
-
- protected final JavaColumn column;
-
- protected boolean lob;
-
- protected TemporalType temporal;
-
- public GenericJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- }
-
- protected JavaColumn createJavaColumn() {
- return jpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.column.initializeFromResource(this.columnResource());
- Basic basicResource = this.mappingResource();
- this.specifiedFetch = this.specifiedFetchType(basicResource);
- this.specifiedOptional = this.specifiedOptional(basicResource);
- this.specifiedEnumerated = this.specifiedEnumerated(this.enumeratedResource());
- this.lob = this.lob(persistentAttributeResource);
- this.temporal = this.temporal(this.temporalResource());
- }
-
- @Override
- protected Basic mappingResource() {
- return (Basic) this.persistentAttributeResource.nonNullMappingAnnotation(annotationName());
- }
-
- protected Enumerated enumeratedResource() {
- return (Enumerated) this.persistentAttributeResource.nonNullAnnotation(Enumerated.ANNOTATION_NAME);
- }
-
- protected Temporal temporalResource() {
- return (Temporal) this.persistentAttributeResource.nonNullAnnotation(Temporal.ANNOTATION_NAME);
- }
-
- public ColumnAnnotation columnResource() {
- return (ColumnAnnotation) this.persistentAttributeResource.nonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** IJavaAttributeMapping implementation ***************
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Basic.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.LOB,
- JPA.TEMPORAL,
- JPA.ENUMERATED);
- }
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- //************** IBasicMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return BasicMapping.DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.mappingResource().setFetch(FetchType.toJavaResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- public Boolean getOptional() {
- return (this.getSpecifiedOptional() == null) ? this.getDefaultOptional() : this.getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- this.mappingResource().setOptional(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
-
- public boolean isLob() {
- return this.lob;
- }
-
- public void setLob(boolean newLob) {
- boolean oldLob = this.lob;
- this.lob = newLob;
- if (newLob) {
- if (lobResource(this.persistentAttributeResource) == null) {
- this.persistentAttributeResource.addAnnotation(Lob.ANNOTATION_NAME);
- }
- }
- else {
- if (lobResource(this.persistentAttributeResource) != null) {
- this.persistentAttributeResource.removeAnnotation(Lob.ANNOTATION_NAME);
- }
- }
- firePropertyChanged(BasicMapping.LOB_PROPERTY, oldLob, newLob);
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.temporalResource().setValue(TemporalType.toJavaResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setTemporal_(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- public EnumType getEnumerated() {
- return (this.getSpecifiedEnumerated() == null) ? this.getDefaultEnumerated() : this.getSpecifiedEnumerated();
- }
-
- public EnumType getDefaultEnumerated() {
- return BasicMapping.DEFAULT_ENUMERATED;
- }
-
- public EnumType getSpecifiedEnumerated() {
- return this.specifiedEnumerated;
- }
-
- public void setSpecifiedEnumerated(EnumType newSpecifiedEnumerated) {
- EnumType oldEnumerated = this.specifiedEnumerated;
- this.specifiedEnumerated = newSpecifiedEnumerated;
- this.enumeratedResource().setValue(EnumType.toJavaResourceModel(newSpecifiedEnumerated));
- firePropertyChanged(BasicMapping.SPECIFIED_ENUMERATED_PROPERTY, oldEnumerated, newSpecifiedEnumerated);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedEnumerated_(EnumType newSpecifiedEnumerated) {
- EnumType oldEnumerated = this.specifiedEnumerated;
- this.specifiedEnumerated = newSpecifiedEnumerated;
- firePropertyChanged(BasicMapping.SPECIFIED_ENUMERATED_PROPERTY, oldEnumerated, newSpecifiedEnumerated);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.column.update(this.columnResource());
- Basic basicResource = this.mappingResource();
- this.setSpecifiedFetch_(this.specifiedFetchType(basicResource));
- this.setSpecifiedOptional(this.specifiedOptional(basicResource));
- this.setSpecifiedEnumerated_(this.specifiedEnumerated(this.enumeratedResource()));
- this.setLob(this.lob(persistentAttributeResource));
- this.setTemporal_(this.temporal(this.temporalResource()));
- }
-
-
- protected FetchType specifiedFetchType(Basic basic) {
- return FetchType.fromJavaResourceModel(basic.getFetch());
- }
-
- protected Boolean specifiedOptional(Basic basic) {
- return basic.getOptional();
- }
-
- protected EnumType specifiedEnumerated(Enumerated enumerated) {
- return EnumType.fromJavaResourceModel(enumerated.getValue());
- }
-
- protected boolean lob(JavaResourcePersistentAttribute persistentAttributeResource) {
- return lobResource(persistentAttributeResource) != null;
- }
-
- protected Lob lobResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- return (Lob) persistentAttributeResource.annotation(Lob.ANNOTATION_NAME);
- }
-
- protected TemporalType temporal(Temporal temporal) {
- return TemporalType.fromJavaResourceModel(temporal.getValue());
- }
-
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- // ************** Validation *************************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages ,astRoot);
-
- addColumnMessages(messages, astRoot);
- }
-
- protected void addColumnMessages(List<IMessage> messages, CompilationUnit astRoot) {
- JavaColumn column = this.getColumn();
- String table = column.getTable();
- boolean doContinue = entityOwned() && column.isConnected();
-
- if (doContinue && this.typeMapping().tableNameIsInvalid(table)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {table, column.getName()},
- column, column.tableTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && ! column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName()},
- column, column.nameTextRange(astRoot))
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java
deleted file mode 100644
index 9ddf12aa12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaColumn.java
+++ /dev/null
@@ -1,136 +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.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-public class GenericJavaColumn extends AbstractJavaColumn<ColumnAnnotation> implements JavaColumn
-{
-
- protected Integer specifiedLength;
-
- protected Integer specifiedPrecision;
-
- protected Integer specifiedScale;
-
- public GenericJavaColumn(JavaJpaContextNode parent, JavaColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initializeFromResource(ColumnAnnotation column) {
- super.initializeFromResource(column);
- this.specifiedLength = this.specifiedLength(column);
- this.specifiedPrecision = this.specifiedPrecision(column);
- this.specifiedScale = this.specifiedScale(column);
- }
-
- @Override
- public JavaColumn.Owner owner() {
- return (JavaColumn.Owner) super.owner();
- }
-
- @Override
- protected ColumnAnnotation columnResource() {
- return this.owner().columnResource();
- }
-
- public Integer getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return Column.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- columnResource().setLength(newSpecifiedLength);
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- public Integer getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision();
- }
-
- public Integer getDefaultPrecision() {
- return Column.DEFAULT_PRECISION;
- }
-
- public Integer getSpecifiedPrecision() {
- return this.specifiedPrecision;
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- columnResource().setPrecision(newSpecifiedPrecision);
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- public Integer getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale();
- }
-
- public Integer getDefaultScale() {
- return Column.DEFAULT_SCALE;
- }
-
- public Integer getSpecifiedScale() {
- return this.specifiedScale;
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- columnResource().setScale(newSpecifiedScale);
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- @Override
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = columnResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.owner().validationTextRange(astRoot);
- }
-
- @Override
- public void update(ColumnAnnotation column) {
- super.update(column);
- this.setSpecifiedLength(this.specifiedLength(column));
- this.setSpecifiedPrecision(this.specifiedPrecision(column));
- this.setSpecifiedScale(this.specifiedScale(column));
- }
-
- protected Integer specifiedLength(ColumnAnnotation column) {
- return column.getLength();
- }
-
- protected Integer specifiedPrecision(ColumnAnnotation column) {
- return column.getPrecision();
- }
-
- protected Integer specifiedScale(ColumnAnnotation column) {
- return column.getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java
deleted file mode 100644
index 8c3f44e593..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaDiscriminatorColumn.java
+++ /dev/null
@@ -1,151 +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.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class GenericJavaDiscriminatorColumn extends AbstractJavaNamedColumn<DiscriminatorColumnAnnotation>
- implements JavaDiscriminatorColumn
-{
-
- protected DiscriminatorType specifiedDiscriminatorType;
-
- protected Integer specifiedLength;
-
- protected JavaResourcePersistentMember persistenceResource;
-
- public GenericJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initializeFromResource(JavaResourcePersistentMember persistentResource) {
- this.persistenceResource = persistentResource;
- this.initializeFromResource(this.columnResource());
- }
-
- @Override
- public void initializeFromResource(DiscriminatorColumnAnnotation column) {
- super.initializeFromResource(column);
- this.specifiedDiscriminatorType = this.discriminatorType(column);
- this.specifiedLength = this.length(column);
- }
-
- protected JavaEntity javaEntity() {
- return (JavaEntity) super.parent();
- }
-
- @Override
- protected DiscriminatorColumnAnnotation columnResource() {
- return (DiscriminatorColumnAnnotation) this.persistenceResource.nonNullAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME);
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public DiscriminatorType getSpecifiedDiscriminatorType() {
- return this.specifiedDiscriminatorType;
- }
-
- public void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- columnResource().setDiscriminatorType(DiscriminatorType.toJavaResourceModel(newSpecifiedDiscriminatorType));
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedDiscriminatorType_(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- public Integer getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return DiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- columnResource().setLength(newSpecifiedLength);
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- @Override
- protected String tableName() {
- return javaEntity().tableName();
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = columnResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.owner().validationTextRange(astRoot);
- }
-
-
- // ********** java annotations -> persistence model **********
-
- public void update(JavaResourcePersistentMember persistentResource) {
- this.persistenceResource = persistentResource;
- this.update(this.columnResource());
- }
-
- @Override
- public void update(DiscriminatorColumnAnnotation discriminatorColumn) {
- super.update(discriminatorColumn);
- this.setSpecifiedDiscriminatorType_(this.discriminatorType(discriminatorColumn));
- this.setSpecifiedLength_(this.length(discriminatorColumn));
- }
-
- protected DiscriminatorType discriminatorType(DiscriminatorColumnAnnotation discriminatorColumn) {
- return DiscriminatorType.fromJavaResourceModel(discriminatorColumn.getDiscriminatorType());
- }
-
- protected Integer length(DiscriminatorColumnAnnotation discriminatorColumn) {
- return discriminatorColumn.getLength();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java
deleted file mode 100644
index 81059f310f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddable.java
+++ /dev/null
@@ -1,46 +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.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public class GenericJavaEmbeddable extends AbstractJavaTypeMapping implements JavaEmbeddable
-{
- public GenericJavaEmbeddable(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java
deleted file mode 100644
index 1a3e6fdaea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedIdMapping.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverride;
-import org.eclipse.jpt.core.internal.resource.java.NullColumn;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrides;
-import org.eclipse.jpt.core.resource.java.EmbeddedId;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaEmbeddedIdMapping extends AbstractJavaAttributeMapping
- implements JavaEmbeddedIdMapping
-{
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> defaultAttributeOverrides;
-
- private Embeddable embeddable;
-
- public GenericJavaEmbeddedIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- }
-
- //****************** IJavaAttributeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return EmbeddedId.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ATTRIBUTE_OVERRIDE,
- JPA.ATTRIBUTE_OVERRIDES);
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- //****************** IOverride.Owner implemenation *******************
- public ColumnMapping columnMapping(String attributeName) {
- return GenericJavaEmbeddedMapping.columnMapping(attributeName, embeddable());
- }
-
- public boolean isVirtual(BaseOverride override) {
- return this.defaultAttributeOverrides.contains(override);
- }
-
-
- //****************** IEmbeddedMapping implemenation *******************
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides(), this.defaultAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.defaultAttributeOverridesSize();
- }
-
- public ListIterator<JavaAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<JavaAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public JavaAttributeOverride addSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) this.persistentAttributeResource.addAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- attributeOverride.initializeFromResource(attributeOverrideResource);
- this.fireItemAdded(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
-
- //add the default attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride defaultAttributeOverride = null;
- if (removedAttributeOverride.getName() != null) {
- if (CollectionTools.contains(allOverridableAttributeNames(), removedAttributeOverride.getName())) {
- defaultAttributeOverride = createAttributeOverride(new NullAttributeOverride(this.persistentAttributeResource, removedAttributeOverride.getName()));
- this.defaultAttributeOverrides.add(defaultAttributeOverride);
- }
- }
-
- this.persistentAttributeResource.removeAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- fireItemRemoved(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
-
- if (defaultAttributeOverride != null) {
- fireItemAdded(EmbeddedIdMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST, defaultAttributeOverridesSize() - 1, defaultAttributeOverride);
- }
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.persistentAttributeResource.move(targetIndex, sourceIndex, AttributeOverrides.ANNOTATION_NAME);
- fireItemMoved(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.defaultAttributeOverrides, EmbeddedIdMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.defaultAttributeOverrides, EmbeddedIdMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public JavaAttributeOverride attributeOverrideNamed(String name) {
- return (JavaAttributeOverride) overrideNamed(name, attributeOverrides());
- }
-
- public boolean containsAttributeOverride(String name) {
- return containsOverride(name, attributeOverrides());
- }
-
- public boolean containsDefaultAttributeOverride(String name) {
- return containsOverride(name, defaultAttributeOverrides());
- }
-
- public boolean containsSpecifiedAttributeOverride(String name) {
- return containsOverride(name, specifiedAttributeOverrides());
- }
-
- private BaseOverride overrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- private boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return overrideNamed(name, overrides) != null;
- }
-
- public Embeddable embeddable() {
- return this.embeddable;
- }
-
-
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.initializeAttributeOverrides(persistentAttributeResource);
- this.initializeDefaultAttributeOverrides(persistentAttributeResource);
- this.embeddable = embeddableFor(persistentAttribute());
- }
-
- protected void initializeAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaResourceNode> annotations = persistentAttributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initializeFromResource((AttributeOverrideAnnotation) annotations.next());
- this.specifiedAttributeOverrides.add(attributeOverride);
- }
- }
-
- protected void initializeDefaultAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentAttributeResource, attributeName));
- this.defaultAttributeOverrides.add(attributeOverride);
- }
- }
- } @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.embeddable = embeddableFor(persistentAttribute());
- this.updateSpecifiedAttributeOverrides(persistentAttributeResource);
- this.updateDefaultAttributeOverrides(persistentAttributeResource);
-
- }
- protected void updateSpecifiedAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<JavaResourceNode> resourceAttributeOverrides = persistentAttributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while (attributeOverrides.hasNext()) {
- JavaAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update((AttributeOverrideAnnotation) resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), createAttributeOverride((AttributeOverrideAnnotation) resourceAttributeOverrides.next()));
- }
- }
-
- protected JavaAttributeOverride createAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initializeFromResource(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected void updateDefaultAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentAttributeResource, attributeName));
- addDefaultAttributeOverride(attributeOverride);
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.getColumn().update(new NullColumn(persistentAttributeResource));
- }
- }
-
- Collection<String> attributeNames = CollectionTools.collection(allOverridableAttributeNames());
-
- //remove any default mappings that are not included in the attributeNames collection
- for (JavaAttributeOverride attributeOverride : CollectionTools.iterable(defaultAttributeOverrides())) {
- if (!attributeNames.contains(attributeOverride.getName())
- || containsSpecifiedAttributeOverride(attributeOverride.getName())) {
- removeDefaultAttributeOverride(attributeOverride);
- }
- }
- }
-
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.embeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.embeddable().persistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (AttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = ((JavaAttributeOverride) override).javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- //******** Validation ******************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-
- //******* static methods *********
-
- protected static Embeddable embeddableFor(JavaPersistentAttribute persistentAttribute) {
- return GenericJavaEmbeddedMapping.embeddableFor(persistentAttribute);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java
deleted file mode 100644
index 969b002908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEmbeddedMapping.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverride;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrides;
-import org.eclipse.jpt.core.resource.java.Embedded;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaEmbeddedMapping extends AbstractJavaAttributeMapping implements JavaEmbeddedMapping
-{
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> defaultAttributeOverrides;
-
- private Embeddable embeddable;
-
- public GenericJavaEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.embeddable = embeddableFor(persistentAttribute());
- this.initializeSpecifiedAttributeOverrides(persistentAttributeResource);
- this.initializeDefaultAttributeOverrides(persistentAttributeResource);
- }
-
- protected void initializeSpecifiedAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaResourceNode> annotations = persistentAttributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initializeFromResource((AttributeOverrideAnnotation) annotations.next());
- this.specifiedAttributeOverrides.add(attributeOverride);
- }
- }
-
- protected void initializeDefaultAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentAttributeResource, attributeName));
- this.defaultAttributeOverrides.add(attributeOverride);
- }
- }
- }
- //****************** IOverride.Owner implemenation *******************
- public ColumnMapping columnMapping(String attributeName) {
- return columnMapping(attributeName, embeddable());
- }
-
- public boolean isVirtual(BaseOverride override) {
- return this.defaultAttributeOverrides.contains(override);
- }
-
- //****************** IJavaAttributeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Embedded.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ATTRIBUTE_OVERRIDE,
- JPA.ATTRIBUTE_OVERRIDES);
- }
-
- @Override
- protected Embedded mappingResource() {
- return (Embedded) this.persistentAttributeResource.nonNullMappingAnnotation(annotationName());
- }
-
- //****************** IEmbeddedMapping implemenation *******************
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<JavaAttributeOverride>(specifiedAttributeOverrides(), defaultAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.defaultAttributeOverridesSize();
- }
-
- public ListIterator<JavaAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<JavaAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public JavaAttributeOverride addSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) this.persistentAttributeResource.addAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- attributeOverride.initializeFromResource(attributeOverrideResource);
- this.fireItemAdded(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
-
- //add the default attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride defaultAttributeOverride = null;
- if (removedAttributeOverride.getName() != null) {
- if (CollectionTools.contains(allOverridableAttributeNames(), removedAttributeOverride.getName())) {
- defaultAttributeOverride = createAttributeOverride(new NullAttributeOverride(this.persistentAttributeResource, removedAttributeOverride.getName()));
- this.defaultAttributeOverrides.add(defaultAttributeOverride);
- }
- }
-
- this.persistentAttributeResource.removeAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- fireItemRemoved(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
-
- if (defaultAttributeOverride != null) {
- fireItemAdded(EmbeddedMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST, defaultAttributeOverridesSize() - 1, defaultAttributeOverride);
- }
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.persistentAttributeResource.move(targetIndex, sourceIndex, AttributeOverrides.ANNOTATION_NAME);
- fireItemMoved(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.defaultAttributeOverrides, EmbeddedMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.defaultAttributeOverrides, EmbeddedMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public JavaAttributeOverride attributeOverrideNamed(String name) {
- return (JavaAttributeOverride) overrideNamed(name, attributeOverrides());
- }
-
- public boolean containsAttributeOverride(String name) {
- return containsOverride(name, attributeOverrides());
- }
-
- public boolean containsDefaultAttributeOverride(String name) {
- return containsOverride(name, defaultAttributeOverrides());
- }
-
- public boolean containsSpecifiedAttributeOverride(String name) {
- return containsOverride(name, specifiedAttributeOverrides());
- }
-
- private BaseOverride overrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- private boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return overrideNamed(name, overrides) != null;
- }
-
- public Embeddable embeddable() {
- return this.embeddable;
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.embeddable = embeddableFor(persistentAttribute());
- this.updateSpecifiedAttributeOverrides(persistentAttributeResource);
- this.updateDefaultAttributeOverrides(persistentAttributeResource);
-
- }
- protected void updateSpecifiedAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<JavaResourceNode> resourceAttributeOverrides = persistentAttributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while (attributeOverrides.hasNext()) {
- JavaAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update((AttributeOverrideAnnotation) resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), createAttributeOverride((AttributeOverrideAnnotation) resourceAttributeOverrides.next()));
- }
- }
-
- protected JavaAttributeOverride createAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, this);
- attributeOverride.initializeFromResource(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected void updateDefaultAttributeOverrides(JavaResourcePersistentAttribute persistentAttributeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentAttributeResource, attributeName));
- addDefaultAttributeOverride(attributeOverride);
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.update(new NullAttributeOverride(persistentAttributeResource, attributeName));
- }
- }
-
- Collection<String> attributeNames = CollectionTools.collection(allOverridableAttributeNames());
-
- //remove any default mappings that are not included in the attributeNames collection
- for (JavaAttributeOverride attributeOverride : CollectionTools.iterable(defaultAttributeOverrides())) {
- if (!attributeNames.contains(attributeOverride.getName())
- || containsSpecifiedAttributeOverride(attributeOverride.getName())) {
- removeDefaultAttributeOverride(attributeOverride);
- }
- }
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.embeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.embeddable().persistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (AttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = ((JavaAttributeOverride) override).javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
-
- //******** Validation ******************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- for (Iterator<JavaAttributeOverride> stream = attributeOverrides(); stream.hasNext();) {
- stream.next().addToMessages(messages, astRoot);
- }
- }
-
- //******* static methods *********
-
- public static Embeddable embeddableFor(JavaPersistentAttribute persistentAttribute) {
- String qualifiedTypeName = persistentAttribute.getResourcePersistentAttribute().getQualifiedTypeName();
- if (qualifiedTypeName == null) {
- return null;
- }
- PersistentType persistentType = persistentAttribute.persistenceUnit().persistentType(qualifiedTypeName);
- if (persistentType != null) {
- if (persistentType.mappingKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- return (Embeddable) persistentType.getMapping();
- }
- }
- return null;
- }
-
- public static ColumnMapping columnMapping(String attributeName, Embeddable embeddable) {
- if (attributeName == null || embeddable == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = embeddable.persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java
deleted file mode 100644
index aff3a1a63d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaEntity.java
+++ /dev/null
@@ -1,1805 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAbstractJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.internal.resource.java.NullAssociationOverride;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverride;
-import org.eclipse.jpt.core.internal.resource.java.NullColumn;
-import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrides;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrides;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValue;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.IdClass;
-import org.eclipse.jpt.core.resource.java.Inheritance;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueries;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueries;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumns;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTables;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaEntity extends AbstractJavaTypeMapping implements JavaEntity
-{
- protected EntityAnnotation entityResource;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected final JavaTable table;
-
- protected final List<JavaSecondaryTable> specifiedSecondaryTables;
-
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected InheritanceType specifiedInheritanceStrategy;
-
- protected InheritanceType defaultInheritanceStrategy;
-
- protected String defaultDiscriminatorValue;
-
- protected boolean discriminatorValueAllowed;
-
- protected String specifiedDiscriminatorValue;
-
- protected final JavaDiscriminatorColumn discriminatorColumn;
-
- protected JavaSequenceGenerator sequenceGenerator;
-
- protected JavaTableGenerator tableGenerator;
-
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> defaultAttributeOverrides;
-
- protected final List<JavaAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<JavaAssociationOverride> defaultAssociationOverrides;
-
- protected final List<JavaNamedQuery> namedQueries;
-
- protected final List<JavaNamedNativeQuery> namedNativeQueries;
-
- protected String idClass;
-
-
- public GenericJavaEntity(JavaPersistentType parent) {
- super(parent);
- this.table = jpaFactory().buildJavaTable(this);
- this.discriminatorColumn = createJavaDiscriminatorColumn();
- this.specifiedSecondaryTables = new ArrayList<JavaSecondaryTable>();
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.namedQueries = new ArrayList<JavaNamedQuery>();
- this.namedNativeQueries = new ArrayList<JavaNamedNativeQuery>();
- this.specifiedAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- this.defaultAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- }
-
- protected JavaAbstractJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected JavaDiscriminatorColumn createJavaDiscriminatorColumn() {
- return jpaFactory().buildJavaDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected JavaNamedColumn.Owner buildDiscriminatorColumnOwner() {
- return new JavaNamedColumn.Owner(){
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- return GenericJavaEntity.this.dbTable(tableName);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return GenericJavaEntity.this.validationTextRange(astRoot);
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaEntity.this;
- }
-
- public String defaultColumnName() {
- return DiscriminatorColumn.DEFAULT_NAME;
- }
- };
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentType persistentTypeResource) {
- super.initializeFromResource(persistentTypeResource);
- this.entityResource = (EntityAnnotation) persistentTypeResource.mappingAnnotation(EntityAnnotation.ANNOTATION_NAME);
-
- this.specifiedName = this.specifiedName(this.entityResource);
- this.defaultName = this.defaultName(persistentTypeResource);
- this.table.initializeFromResource(persistentTypeResource);
- this.defaultInheritanceStrategy = this.defaultInheritanceStrategy();
- this.specifiedInheritanceStrategy = this.specifiedInheritanceStrategy(inheritanceResource());
- this.specifiedDiscriminatorValue = this.discriminatorValueResource().getValue();
- this.defaultDiscriminatorValue = this.javaDefaultDiscriminatorValue();
- this.discriminatorValueAllowed = this.discriminatorValueIsAllowed(persistentTypeResource);
- this.discriminatorColumn.initializeFromResource(persistentTypeResource);
- this.initializeSecondaryTables(persistentTypeResource);
- this.initializeTableGenerator(persistentTypeResource);
- this.initializeSequenceGenerator(persistentTypeResource);
- this.initializePrimaryKeyJoinColumns(persistentTypeResource);
- this.initializeDefaultPrimaryKeyJoinColumn(persistentTypeResource);
- this.initializeSpecifiedAttributeOverrides(persistentTypeResource);
- this.initializeDefaultAttributeOverrides(persistentTypeResource);
- this.initializeSpecifiedAssociationOverrides(persistentTypeResource);
- this.initializeDefaultAssociationOverrides(persistentTypeResource);
- this.initializeNamedQueries(persistentTypeResource);
- this.initializeNamedNativeQueries(persistentTypeResource);
- this.initializeIdClass(persistentTypeResource);
- }
-
- protected void initializeSecondaryTables(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTables.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedSecondaryTables.add(createSecondaryTable((SecondaryTableAnnotation) annotations.next()));
- }
- }
-
- protected void initializeTableGenerator(JavaResourcePersistentType persistentTypeResource) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(persistentTypeResource);
- if (tableGeneratorResource != null) {
- this.tableGenerator = createTableGenerator(tableGeneratorResource);
- }
- }
-
- protected void initializeSequenceGenerator(JavaResourcePersistentType persistentTypeResource) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(persistentTypeResource);
- if (sequenceGeneratorResource != null) {
- this.sequenceGenerator = createSequenceGenerator(sequenceGeneratorResource);
- }
- }
-
- protected void initializePrimaryKeyJoinColumns(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumns.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedPrimaryKeyJoinColumns.add(createPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn(JavaResourcePersistentType persistentTypeResource) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = this.jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.defaultPrimaryKeyJoinColumn.initializeFromResource(new NullPrimaryKeyJoinColumn(persistentTypeResource));
- }
-
- protected void initializeSpecifiedAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedAttributeOverrides.add(createAttributeOverride((AttributeOverrideAnnotation) annotations.next()));
- }
- }
-
- protected void initializeDefaultAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- this.defaultAttributeOverrides.add(createAttributeOverride(new NullAttributeOverride(persistentTypeResource, attributeName)));
- }
- }
- }
-
- protected void initializeSpecifiedAssociationOverrides(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverrides.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.specifiedAssociationOverrides.add(createAssociationOverride((AssociationOverrideAnnotation) annotations.next()));
- }
- }
-
- protected void initializeDefaultAssociationOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (Iterator<String> i = allOverridableAssociationNames(); i.hasNext(); ) {
- String associationName = i.next();
- JavaAssociationOverride associationOverride = associationOverrideNamed(associationName);
- if (associationOverride == null) {
- associationOverride = createAssociationOverride(new NullAssociationOverride(persistentTypeResource, associationName));
- this.defaultAssociationOverrides.add(associationOverride);
- }
- }
- }
-
- protected void initializeNamedQueries(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.namedQueries.add(createNamedQuery((NamedQueryAnnotation) annotations.next()));
- }
- }
-
- protected void initializeNamedNativeQueries(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaResourceNode> annotations = persistentTypeResource.annotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME);
-
- while(annotations.hasNext()) {
- this.namedNativeQueries.add(createNamedNativeQuery((NamedNativeQueryAnnotation) annotations.next()));
- }
- }
-
- //query for the inheritance resource every time on setters.
- //call one setter and the inheritanceResource could change.
- //You could call more than one setter before this object has received any notification
- //from the java resource model
- protected Inheritance inheritanceResource() {
- return (Inheritance) this.persistentTypeResource.nonNullAnnotation(Inheritance.ANNOTATION_NAME);
- }
-
- protected DiscriminatorValue discriminatorValueResource() {
- return (DiscriminatorValue) this.persistentTypeResource.nonNullAnnotation(DiscriminatorValue.ANNOTATION_NAME);
- }
-
- protected void initializeIdClass(JavaResourcePersistentType typeResource) {
- IdClass idClassResource = (IdClass) typeResource.annotation(IdClass.ANNOTATION_NAME);
- if (idClassResource != null) {
- this.idClass = idClassResource.getValue();
- }
- }
-
- //****************** ITypeMapping implemenation *******************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public String tableName() {
- return getTable().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table primaryDbTable() {
- return getTable().dbTable();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- for (Iterator<Table> stream = this.associatedTablesIncludingInherited(); stream.hasNext();) {
- org.eclipse.jpt.db.internal.Table dbTable = stream.next().dbTable();
- if (dbTable != null && dbTable.matchesShortJavaClassName(tableName)) {
- return dbTable;
- }
- }
- return null;
- }
-
- @Override
- public Schema dbSchema() {
- return getTable().dbSchema();
- }
-
-
- //****************** IJavaTypeMapping implemenation *******************
-
- public String annotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.TABLE,
- JPA.SECONDARY_TABLE,
- JPA.SECONDARY_TABLES,
- JPA.PRIMARY_KEY_JOIN_COLUMN,
- JPA.PRIMARY_KEY_JOIN_COLUMNS,
- JPA.ID_CLASS,
- JPA.INHERITANCE,
- JPA.DISCRIMINATOR_VALUE,
- JPA.DISCRIMINATOR_COLUMN,
- JPA.SEQUENCE_GENERATOR,
- JPA.TABLE_GENERATOR,
- JPA.NAMED_QUERY,
- JPA.NAMED_QUERIES,
- JPA.NAMED_NATIVE_QUERY,
- JPA.NAMED_NATIVE_QUERIES,
- JPA.SQL_RESULT_SET_MAPPING,
- JPA.EXCLUDE_DEFAULT_LISTENERS,
- JPA.EXCLUDE_SUPERCLASS_LISTENERS,
- JPA.ENTITY_LISTENERS,
- JPA.PRE_PERSIST,
- JPA.POST_PERSIST,
- JPA.PRE_REMOVE,
- JPA.POST_REMOVE,
- JPA.PRE_UPDATE,
- JPA.POST_UPDATE,
- JPA.POST_LOAD,
- JPA.ATTRIBUTE_OVERRIDE,
- JPA.ATTRIBUTE_OVERRIDES,
- JPA.ASSOCIATION_OVERRIDE,
- JPA.ASSOCIATION_OVERRIDES);
- }
-
- //****************** IEntity implemenation *******************
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? this.getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- this.entityResource.setName(newSpecifiedName);
- firePropertyChanged(Entity.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected/*private-protected*/ void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(Entity.DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public JavaTable getTable() {
- return this.table;
- }
-
- public ListIterator<JavaSecondaryTable> specifiedSecondaryTables() {
- return new CloneListIterator<JavaSecondaryTable>(this.specifiedSecondaryTables);
- }
-
- public int specifiedSecondaryTablesSize() {
- return this.specifiedSecondaryTables.size();
- }
-
- public JavaSecondaryTable addSpecifiedSecondaryTable(int index) {
- JavaSecondaryTable secondaryTable = jpaFactory().buildJavaSecondaryTable(this);
- this.specifiedSecondaryTables.add(index, secondaryTable);
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) this.persistentTypeResource.addAnnotation(index, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTables.ANNOTATION_NAME);
- secondaryTable.initializeFromResource(secondaryTableResource);
- fireItemAdded(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, secondaryTable);
- return secondaryTable;
- }
-
- protected void addSpecifiedSecondaryTable(int index, JavaSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable) {
- this.removeSpecifiedSecondaryTable(this.specifiedSecondaryTables.indexOf(secondaryTable));
- }
-
- public void removeSpecifiedSecondaryTable(int index) {
- JavaSecondaryTable removedSecondaryTable = this.specifiedSecondaryTables.remove(index);
- this.persistentTypeResource.removeAnnotation(index, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTables.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, removedSecondaryTable);
- }
-
- protected void removeSpecifiedSecondaryTable_(JavaSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedSecondaryTables, targetIndex, sourceIndex);
- this.persistentTypeResource.move(targetIndex, sourceIndex, SecondaryTables.ANNOTATION_NAME);
- fireItemMoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaSecondaryTable> secondaryTables() {
- return specifiedSecondaryTables();
- }
-
- public int secondaryTablesSize() {
- return specifiedSecondaryTablesSize();
- }
-//TODO
-// public boolean containsSecondaryTable(String name) {
-// return containsSecondaryTable(name, getSecondaryTables());
-// }
-//
-// public boolean containsSpecifiedSecondaryTable(String name) {
-// return containsSecondaryTable(name, getSpecifiedSecondaryTables());
-// }
-//
-// private boolean containsSecondaryTable(String name, List<ISecondaryTable> secondaryTables) {
-// for (ISecondaryTable secondaryTable : secondaryTables) {
-// String secondaryTableName = secondaryTable.getName();
-// if (secondaryTableName != null && secondaryTableName.equals(name)) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
- public InheritanceType getInheritanceStrategy() {
- return (this.getSpecifiedInheritanceStrategy() == null) ? this.getDefaultInheritanceStrategy() : this.getSpecifiedInheritanceStrategy();
- }
-
- public InheritanceType getDefaultInheritanceStrategy() {
- return this.defaultInheritanceStrategy;
- }
-
- protected void setDefaultInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.defaultInheritanceStrategy;
- this.defaultInheritanceStrategy = newInheritanceType;
- firePropertyChanged(DEFAULT_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public InheritanceType getSpecifiedInheritanceStrategy() {
- return this.specifiedInheritanceStrategy;
- }
-
- public void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- inheritanceResource().setStrategy(InheritanceType.toJavaResourceModel(newInheritanceType));
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedInheritanceStrategy_(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public JavaDiscriminatorColumn getDiscriminatorColumn() {
- return this.discriminatorColumn;
- }
-
- public String getDefaultDiscriminatorValue() {
- return this.defaultDiscriminatorValue;
- }
-
- protected void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) {
- String oldDefaultDiscriminatorValue = this.defaultDiscriminatorValue;
- this.defaultDiscriminatorValue = newDefaultDiscriminatorValue;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, oldDefaultDiscriminatorValue, newDefaultDiscriminatorValue);
- }
-
- public String getSpecifiedDiscriminatorValue() {
- return this.specifiedDiscriminatorValue;
- }
-
- public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- discriminatorValueResource().setValue(newSpecifiedDiscriminatorValue);
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedDiscriminatorValue_(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- public String getDiscriminatorValue() {
- return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue();
- }
-
- public boolean isDiscriminatorValueAllowed() {
- return this.discriminatorValueAllowed;
- }
-
- protected void setDiscriminatorValueAllowed(boolean newDiscriminatorValueAllowed) {
- boolean oldDiscriminatorValueAllowed = this.discriminatorValueAllowed;
- this.discriminatorValueAllowed = newDiscriminatorValueAllowed;
- firePropertyChanged(Entity.DISCRIMINATOR_VALUE_ALLOWED_PROPERTY, oldDiscriminatorValueAllowed, newDiscriminatorValueAllowed);
- }
-
- public JavaTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists");
- }
- this.tableGenerator = jpaFactory().buildJavaTableGenerator(this);
- TableGeneratorAnnotation tableGeneratorResource = (TableGeneratorAnnotation) this.persistentTypeResource.addAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- this.tableGenerator.initializeFromResource(tableGeneratorResource);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed");
- }
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.persistentTypeResource.removeAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public JavaTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(JavaTableGenerator newTableGenerator) {
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
- public JavaSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists");
- }
- this.sequenceGenerator = jpaFactory().buildJavaSequenceGenerator(this);
- SequenceGeneratorAnnotation sequenceGeneratorResource = (SequenceGeneratorAnnotation) this.persistentTypeResource.addAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- this.sequenceGenerator.initializeFromResource(sequenceGeneratorResource);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed");
- }
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.persistentTypeResource.removeAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator,null);
- }
-
- public JavaSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(JavaSequenceGenerator newSequenceGenerator) {
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumns() : this.defaultPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- return this.defaultPrimaryKeyJoinColumn;
- }
-
- protected void setDefaultPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn newPkJoinColumn) {
- JavaPrimaryKeyJoinColumn oldPkJoinColumn = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = newPkJoinColumn;
- firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldPkJoinColumn, newPkJoinColumn);
- }
-
- protected ListIterator<JavaPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- if (this.defaultPrimaryKeyJoinColumn != null) {
- return new SingleElementListIterator<JavaPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultPrimaryKeyJoinColumnsSize() {
- return (this.defaultPrimaryKeyJoinColumn == null) ? 0 : 1;
- }
-
- public JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn oldDefaultPkJoinColumn = this.getDefaultPrimaryKeyJoinColumn();
- if (oldDefaultPkJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultPrimaryKeyJoinColumn = null;
- }
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) this.persistentTypeResource.addAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumns.ANNOTATION_NAME);
- primaryKeyJoinColumn.initializeFromResource(pkJoinColumnResource);
- this.fireItemAdded(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return primaryKeyJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(primaryKeyJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultPrimaryKeyJoinColumn = createPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumn(this.persistentTypeResource));
- }
- this.persistentTypeResource.removeAnnotation(index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumns.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (this.defaultPrimaryKeyJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, null, this.defaultPrimaryKeyJoinColumn);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- this.persistentTypeResource.move(targetIndex, sourceIndex, PrimaryKeyJoinColumns.ANNOTATION_NAME);
- moveItemInList(targetIndex, sourceIndex, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<JavaAttributeOverride>(specifiedAttributeOverrides(), defaultAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.defaultAttributeOverridesSize();
- }
-
- public ListIterator<JavaAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<JavaAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public JavaAttributeOverride addSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) this.persistentTypeResource.addAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- attributeOverride.initializeFromResource(attributeOverrideResource);
- this.fireItemAdded(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
- protected void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
-
- //add the default attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride defaultAttributeOverride = null;
- if (removedAttributeOverride.getName() != null) {
- if (CollectionTools.contains(allOverridableAttributeNames(), removedAttributeOverride.getName())) {
- defaultAttributeOverride = createAttributeOverride(new NullAttributeOverride(this.persistentTypeResource, removedAttributeOverride.getName()));
- this.defaultAttributeOverrides.add(defaultAttributeOverride);
- }
- }
-
- this.persistentTypeResource.removeAnnotation(index, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
-
- if (defaultAttributeOverride != null) {
- fireItemAdded(Entity.DEFAULT_ATTRIBUTE_OVERRIDES_LIST, defaultAttributeOverridesSize() - 1, defaultAttributeOverride);
- }
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.persistentTypeResource.move(targetIndex, sourceIndex, AttributeOverrides.ANNOTATION_NAME);
- fireItemMoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.defaultAttributeOverrides, Entity.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeDefaultAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.defaultAttributeOverrides, Entity.DEFAULT_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public JavaAttributeOverride attributeOverrideNamed(String name) {
- return (JavaAttributeOverride) overrideNamed(name, attributeOverrides());
- }
-
- public boolean containsAttributeOverride(String name) {
- return containsOverride(name, attributeOverrides());
- }
-
- public boolean containsDefaultAttributeOverride(String name) {
- return containsOverride(name, defaultAttributeOverrides());
- }
-
- public boolean containsSpecifiedAttributeOverride(String name) {
- return containsOverride(name, specifiedAttributeOverrides());
- }
-
- public JavaAssociationOverride associationOverrideNamed(String name) {
- return (JavaAssociationOverride) overrideNamed(name, associationOverrides());
- }
-
- public boolean containsAssociationOverride(String name) {
- return containsOverride(name, associationOverrides());
- }
-
- public boolean containsSpecifiedAssociationOverride(String name) {
- return containsOverride(name, specifiedAssociationOverrides());
- }
-
- public boolean containsDefaultAssociationOverride(String name) {
- return containsOverride(name, defaultAssociationOverrides());
- }
-
- private BaseOverride overrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- private boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return overrideNamed(name, overrides) != null;
- }
-
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAssociationOverride> associationOverrides() {
- return new CompositeListIterator<JavaAssociationOverride>(specifiedAssociationOverrides(), defaultAssociationOverrides());
- }
-
- public int associationOverridesSize() {
- return this.specifiedAssociationOverridesSize() + this.defaultAssociationOverridesSize();
- }
-
- public ListIterator<JavaAssociationOverride> defaultAssociationOverrides() {
- return new CloneListIterator<JavaAssociationOverride>(this.defaultAssociationOverrides);
- }
-
- public int defaultAssociationOverridesSize() {
- return this.defaultAssociationOverrides.size();
- }
-
- public ListIterator<JavaAssociationOverride> specifiedAssociationOverrides() {
- return new CloneListIterator<JavaAssociationOverride>(this.specifiedAssociationOverrides);
- }
-
- public int specifiedAssociationOverridesSize() {
- return this.specifiedAssociationOverrides.size();
- }
-
- public JavaAssociationOverride addSpecifiedAssociationOverride(int index) {
- JavaAssociationOverride associationOverride = jpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- this.specifiedAssociationOverrides.add(index, associationOverride);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) this.persistentTypeResource.addAnnotation(index, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverrides.ANNOTATION_NAME);
- associationOverride.initializeFromResource(associationOverrideResource);
- this.fireItemAdded(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- return associationOverride;
- }
-
- protected AssociationOverride.Owner createAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- protected void addSpecifiedAssociationOverride(int index, JavaAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAssociationOverride(AssociationOverride associationOverride) {
- removeSpecifiedAssociationOverride(this.specifiedAssociationOverrides.indexOf(associationOverride));
- }
-
- public void removeSpecifiedAssociationOverride(int index) {
- JavaAssociationOverride removedAssociationOverride = this.specifiedAssociationOverrides.remove(index);
- JavaAssociationOverride defaultAssociationOverride = null;
-
- //add the default association override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the association override
- //during the udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- if (removedAssociationOverride.getName() != null) {
- if (CollectionTools.contains(allOverridableAssociationNames(), removedAssociationOverride.getName())) {
- defaultAssociationOverride = createAssociationOverride(new NullAssociationOverride(this.persistentTypeResource, removedAssociationOverride.getName()));
- this.defaultAssociationOverrides.add(defaultAssociationOverride);
- }
- }
- this.persistentTypeResource.removeAnnotation(index, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverrides.ANNOTATION_NAME);
- fireItemRemoved(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, removedAssociationOverride);
-
- if (defaultAssociationOverride != null) {
- fireItemAdded(Entity.DEFAULT_ASSOCIATION_OVERRIDES_LIST, defaultAssociationOverridesSize() - 1, defaultAssociationOverride);
- }
- }
-
- protected void removeSpecifiedAssociationOverride_(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.persistentTypeResource.move(targetIndex, sourceIndex, AssociationOverrides.ANNOTATION_NAME);
- fireItemMoved(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addDefaultAssociationOverride(JavaAssociationOverride associationOverride) {
- addItemToList(associationOverride, this.defaultAssociationOverrides, Entity.DEFAULT_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void removeDefaultAssociationOverride(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.defaultAssociationOverrides, Entity.DEFAULT_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public ListIterator<JavaNamedQuery> namedQueries() {
- return new CloneListIterator<JavaNamedQuery>(this.namedQueries);
- }
-
- public int namedQueriesSize() {
- return this.namedQueries.size();
- }
-
- public JavaNamedQuery addNamedQuery(int index) {
- JavaNamedQuery namedQuery = jpaFactory().buildJavaNamedQuery(this);
- this.namedQueries.add(index, namedQuery);
- this.persistentTypeResource.addAnnotation(index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME);
- fireItemAdded(Entity.NAMED_QUERIES_LIST, index, namedQuery);
- return namedQuery;
- }
-
- protected void addNamedQuery(int index, JavaNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, Entity.NAMED_QUERIES_LIST);
- }
-
- public void removeNamedQuery(NamedQuery namedQuery) {
- removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- JavaNamedQuery removedNamedQuery = this.namedQueries.remove(index);
- this.persistentTypeResource.removeAnnotation(index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME);
- fireItemRemoved(Entity.NAMED_QUERIES_LIST, index, removedNamedQuery);
- }
-
- protected void removeNamedQuery_(JavaNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, Entity.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.persistentTypeResource.move(targetIndex, sourceIndex, NamedQueries.ANNOTATION_NAME);
- fireItemMoved(Entity.NAMED_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaNamedNativeQuery> namedNativeQueries() {
- return new CloneListIterator<JavaNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int namedNativeQueriesSize() {
- return this.namedNativeQueries.size();
- }
-
- public JavaNamedNativeQuery addNamedNativeQuery(int index) {
- JavaNamedNativeQuery namedNativeQuery = jpaFactory().buildJavaNamedNativeQuery(this);
- this.namedNativeQueries.add(index, namedNativeQuery);
- this.persistentTypeResource.addAnnotation(index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME);
- fireItemAdded(Entity.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, JavaNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, Entity.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
- this.removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- JavaNamedNativeQuery removedNamedNativeQuery = this.namedNativeQueries.remove(index);
- this.persistentTypeResource.removeAnnotation(index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME);
- fireItemRemoved(Entity.NAMED_NATIVE_QUERIES_LIST, index, removedNamedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(JavaNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, Entity.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.persistentTypeResource.move(targetIndex, sourceIndex, NamedNativeQueries.ANNOTATION_NAME);
- fireItemMoved(Entity.NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (newIdClass != oldIdClass) {
- if (newIdClass != null) {
- if (idClassResource() == null) {
- addIdClassResource();
- }
- idClassResource().setValue(newIdClass);
- }
- else {
- removeIdClassResource();
- }
- }
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClass idClassResource() {
- return (IdClass) this.persistentTypeResource.annotation(IdClass.ANNOTATION_NAME);
- }
-
- protected void addIdClassResource() {
- this.persistentTypeResource.addAnnotation(IdClass.ANNOTATION_NAME);
- }
-
- protected void removeIdClassResource() {
- this.persistentTypeResource.removeAnnotation(IdClass.ANNOTATION_NAME);
- }
-
- public Entity parentEntity() {
- for (Iterator<PersistentType> i = persistentType().inheritanceHierarchy(); i.hasNext();) {
- TypeMapping typeMapping = i.next().getMapping();
- if (typeMapping != this && typeMapping instanceof Entity) {
- return (Entity) typeMapping;
- }
- }
- return this;
- }
-
- public Entity rootEntity() {
- Entity rootEntity = this;
- for (Iterator<PersistentType> i = persistentType().inheritanceHierarchy(); i.hasNext();) {
- PersistentType persistentType = i.next();
- if (persistentType.getMapping() instanceof Entity) {
- rootEntity = (Entity) persistentType.getMapping();
- }
- }
- return rootEntity;
- }
-
- public String primaryKeyColumnName() {
- return primaryKeyColumnName(persistentType().allAttributes());
- }
-
- public static String primaryKeyColumnName(Iterator<PersistentAttribute> attributes) {
- String pkColumnName = null;
- for (Iterator<PersistentAttribute> stream = attributes; stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- String name = attribute.primaryKeyColumnName();
- if (pkColumnName == null) {
- pkColumnName = name;
- }
- else if (name != null) {
- // if we encounter a composite primary key, return null
- return null;
- }
- }
- // if we encounter only a single primary key column name, return it
- return pkColumnName;
-
- }
-//TODO
-// public String primaryKeyAttributeName() {
-// String pkColumnName = null;
-// String pkAttributeName = null;
-// for (Iterator<IPersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
-// IPersistentAttribute attribute = stream.next();
-// String name = attribute.primaryKeyColumnName();
-// if (pkColumnName == null) {
-// pkColumnName = name;
-// pkAttributeName = attribute.getName();
-// }
-// else if (name != null) {
-// // if we encounter a composite primary key, return null
-// return null;
-// }
-// }
-// // if we encounter only a single primary key column name, return it
-// return pkAttributeName;
-// }
-
- @Override
- public boolean tableNameIsInvalid(String tableName) {
- return !CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- @Override
- public Iterator<Table> associatedTables() {
- return new CompositeIterator<Table>(this.getTable(), this.secondaryTables());
- }
-
- @Override
- public Iterator<Table> associatedTablesIncludingInherited() {
- return new CompositeIterator<Table>(new TransformationIterator<TypeMapping, Iterator<Table>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<Table> transform(TypeMapping mapping) {
- return new FilteringIterator<Table, Table>(mapping.associatedTables()) {
- @Override
- protected boolean accept(Table o) {
- return true;
- //TODO
- //filtering these out so as to avoid the duplicate table, root and children share the same table
- //return !(o instanceof SingleTableInheritanceChildTableImpl);
- }
- };
- }
- });
- }
-
- @Override
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return this.nonNullTableNames(this.associatedTablesIncludingInherited());
- }
-
- protected Iterator<String> nonNullTableNames(Iterator<Table> tables) {
- return new FilteringIterator<String, String>(this.tableNames(tables)) {
- @Override
- protected boolean accept(String o) {
- return o != null;
- }
- };
- }
-
- protected Iterator<String> tableNames(Iterator<Table> tables) {
- return new TransformationIterator<Table, String>(tables) {
- @Override
- protected String transform(Table t) {
- return t.getName();
- }
- };
- }
-
- /**
- * Return an iterator of Entities, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- protected Iterator<TypeMapping> inheritanceHierarchy() {
- return new TransformationIterator<PersistentType, TypeMapping>(persistentType().inheritanceHierarchy()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- public Iterator<String> allOverridableAttributeNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAttributeNames();
- }
- });
- }
-
- @Override
- public Iterator<String> allOverridableAssociationNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAssociationNames();
- }
- });
- }
-
- @Override
- public void update(JavaResourcePersistentType persistentTypeResource) {
- super.update(persistentTypeResource);
- this.entityResource = (EntityAnnotation) persistentTypeResource.mappingAnnotation(EntityAnnotation.ANNOTATION_NAME);
-
- this.setSpecifiedName(this.specifiedName(this.entityResource));
- this.setDefaultName(this.defaultName(persistentTypeResource));
-
- this.updateTable(persistentTypeResource);
- this.updateInheritance(inheritanceResource());
- this.updateDiscriminatorColumn(persistentTypeResource);
- this.updateDiscriminatorValue(discriminatorValueResource());
- this.setDiscriminatorValueAllowed(discriminatorValueIsAllowed(persistentTypeResource));
- this.updateSecondaryTables(persistentTypeResource);
- this.updateTableGenerator(persistentTypeResource);
- this.updateSequenceGenerator(persistentTypeResource);
- this.updateSpecifiedPrimaryKeyJoinColumns(persistentTypeResource);
- this.updateDefaultPrimaryKeyJoinColumn(persistentTypeResource);
- this.updateSpecifiedAttributeOverrides(persistentTypeResource);
- this.updateDefaultAttributeOverrides(persistentTypeResource);
- this.updateSpecifiedAssociationOverrides(persistentTypeResource);
- this.updateDefaultAssociationOverrides(persistentTypeResource);
- this.updateNamedQueries(persistentTypeResource);
- this.updateNamedNativeQueries(persistentTypeResource);
- this.updateIdClass(persistentTypeResource);
- }
-
- protected String specifiedName(EntityAnnotation entityResource) {
- return entityResource.getName();
- }
-
- protected String defaultName(JavaResourcePersistentType persistentTypeResource) {
- return persistentTypeResource.getName();
- }
-
- protected void updateTable(JavaResourcePersistentType persistentTypeResource) {
- getTable().update(persistentTypeResource);
- }
-
- protected void updateInheritance(Inheritance inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.specifiedInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.defaultInheritanceStrategy());
- }
-
- protected InheritanceType specifiedInheritanceStrategy(Inheritance inheritanceResource) {
- return InheritanceType.fromJavaResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType defaultInheritanceStrategy() {
- if (rootEntity() == this) {
- return InheritanceType.SINGLE_TABLE;
- }
- return rootEntity().getInheritanceStrategy();
- }
-
- protected void updateDiscriminatorColumn(JavaResourcePersistentType persistentTypeResource) {
- getDiscriminatorColumn().update(persistentTypeResource);
- }
-
- protected void updateDiscriminatorValue(DiscriminatorValue discriminatorValueResource) {
- this.setSpecifiedDiscriminatorValue_(discriminatorValueResource.getValue());
- this.setDefaultDiscriminatorValue(this.javaDefaultDiscriminatorValue());
- }
-
- protected boolean discriminatorValueIsAllowed(JavaResourcePersistentType persistentTypeResource) {
- return !persistentTypeResource.isAbstract();
- }
-
- protected void updateSecondaryTables(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaSecondaryTable> secondaryTables = specifiedSecondaryTables();
- ListIterator<JavaResourceNode> resourceSecondaryTables = persistentTypeResource.annotations(SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTables.ANNOTATION_NAME);
-
- while (secondaryTables.hasNext()) {
- JavaSecondaryTable secondaryTable = secondaryTables.next();
- if (resourceSecondaryTables.hasNext()) {
- secondaryTable.update((SecondaryTableAnnotation) resourceSecondaryTables.next());
- }
- else {
- removeSpecifiedSecondaryTable_(secondaryTable);
- }
- }
-
- while (resourceSecondaryTables.hasNext()) {
- addSpecifiedSecondaryTable(specifiedSecondaryTablesSize(), createSecondaryTable((SecondaryTableAnnotation) resourceSecondaryTables.next()));
- }
- }
-
- protected JavaSecondaryTable createSecondaryTable(SecondaryTableAnnotation secondaryTableResource) {
- JavaSecondaryTable secondaryTable = jpaFactory().buildJavaSecondaryTable(this);
- secondaryTable.initializeFromResource(secondaryTableResource);
- return secondaryTable;
- }
-
- protected void updateTableGenerator(JavaResourcePersistentType persistentTypeResource) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(persistentTypeResource);
- if (tableGeneratorResource == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(createTableGenerator(tableGeneratorResource));
- }
- else {
- getTableGenerator().update(tableGeneratorResource);
- }
- }
- }
-
- protected JavaTableGenerator createTableGenerator(TableGeneratorAnnotation tableGeneratorResource) {
- JavaTableGenerator tableGenerator = jpaFactory().buildJavaTableGenerator(this);
- tableGenerator.initializeFromResource(tableGeneratorResource);
- return tableGenerator;
- }
-
- protected TableGeneratorAnnotation tableGenerator(JavaResourcePersistentType persistentTypeResource) {
- return (TableGeneratorAnnotation) persistentTypeResource.annotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected void updateSequenceGenerator(JavaResourcePersistentType persistentTypeResource) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(persistentTypeResource);
- if (sequenceGeneratorResource == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(createSequenceGenerator(sequenceGeneratorResource));
- }
- else {
- getSequenceGenerator().update(sequenceGeneratorResource);
- }
- }
- }
-
- protected JavaSequenceGenerator createSequenceGenerator(SequenceGeneratorAnnotation sequenceGeneratorResource) {
- JavaSequenceGenerator sequenceGenerator = jpaFactory().buildJavaSequenceGenerator(this);
- sequenceGenerator.initializeFromResource(sequenceGeneratorResource);
- return sequenceGenerator;
- }
-
- protected SequenceGeneratorAnnotation sequenceGenerator(JavaResourcePersistentType persistentTypeResource) {
- return (SequenceGeneratorAnnotation) persistentTypeResource.annotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<JavaResourceNode> resourcePrimaryKeyJoinColumns = persistentTypeResource.annotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumns.ANNOTATION_NAME);
-
- while (primaryKeyJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update((PrimaryKeyJoinColumnAnnotation) resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(specifiedPrimaryKeyJoinColumnsSize(), createPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumnResource) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initializeFromResource(primaryKeyJoinColumnResource);
- return primaryKeyJoinColumn;
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn(JavaResourcePersistentType persistentTypeResource) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- this.setDefaultPrimaryKeyJoinColumn(createPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumn(this.persistentTypeResource)));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumn(persistentTypeResource));
- }
- }
-
- protected void updateSpecifiedAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<JavaResourceNode> resourceAttributeOverrides = persistentTypeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverrides.ANNOTATION_NAME);
-
- while (attributeOverrides.hasNext()) {
- JavaAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update((AttributeOverrideAnnotation) resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), createAttributeOverride((AttributeOverrideAnnotation) resourceAttributeOverrides.next()));
- }
- }
-
- protected JavaAttributeOverride createAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = jpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- attributeOverride.initializeFromResource(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected void updateDefaultAttributeOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
- String attributeName = i.next();
- JavaAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
- if (attributeOverride == null) {
- attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentTypeResource, attributeName));
- addDefaultAttributeOverride(attributeOverride);
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.getColumn().update(new NullColumn(persistentTypeResource));
- }
- }
-
- Collection<String> attributeNames = CollectionTools.collection(allOverridableAttributeNames());
-
- //remove any default mappings that are not included in the attributeNames collection
- for (JavaAttributeOverride attributeOverride : CollectionTools.iterable(defaultAttributeOverrides())) {
- if (!attributeNames.contains(attributeOverride.getName())
- || containsSpecifiedAttributeOverride(attributeOverride.getName())) {
- removeDefaultAttributeOverride(attributeOverride);
- }
- }
- }
-
- protected void updateSpecifiedAssociationOverrides(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- ListIterator<JavaResourceNode> resourceAssociationOverrides = persistentTypeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverrides.ANNOTATION_NAME);
-
- while (associationOverrides.hasNext()) {
- JavaAssociationOverride associationOverride = associationOverrides.next();
- if (resourceAssociationOverrides.hasNext()) {
- associationOverride.update((AssociationOverrideAnnotation) resourceAssociationOverrides.next());
- }
- else {
- removeSpecifiedAssociationOverride_(associationOverride);
- }
- }
-
- while (resourceAssociationOverrides.hasNext()) {
- addSpecifiedAssociationOverride(specifiedAssociationOverridesSize(), createAssociationOverride((AssociationOverrideAnnotation) resourceAssociationOverrides.next()));
- }
- }
-
- protected JavaAssociationOverride createAssociationOverride(AssociationOverrideAnnotation associationOverrideResource) {
- JavaAssociationOverride associationOverride = jpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- associationOverride.initializeFromResource(associationOverrideResource);
- return associationOverride;
- }
-
- protected void updateDefaultAssociationOverrides(JavaResourcePersistentType persistentTypeResource) {
- for (Iterator<String> i = allOverridableAssociationNames(); i.hasNext(); ) {
- String associationName = i.next();
- JavaAssociationOverride associationOverride = associationOverrideNamed(associationName);
- if (associationOverride == null) {
- associationOverride = createAssociationOverride(new NullAssociationOverride(persistentTypeResource, associationName));
- addDefaultAssociationOverride(associationOverride);
- }
- else if (associationOverride.isVirtual()) {
- //TODO what is this about for attributeOverrides???
- //associationOverride.getColumn().update(new NullColumn(persistentTypeResource));
- }
- }
-
- Collection<String> associationNames = CollectionTools.collection(allOverridableAssociationNames());
-
- //remove any default mappings that are not included in the associationNames collection
- for (JavaAssociationOverride associationOverride : CollectionTools.iterable(defaultAssociationOverrides())) {
- if (!associationNames.contains(associationOverride.getName())
- || containsSpecifiedAssociationOverride(associationOverride.getName())) {
- removeDefaultAssociationOverride(associationOverride);
- }
- }
- }
-
- protected void updateNamedQueries(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaNamedQuery> namedQueries = namedQueries();
- ListIterator<JavaResourceNode> resourceNamedQueries = persistentTypeResource.annotations(NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME);
-
- while (namedQueries.hasNext()) {
- JavaNamedQuery namedQuery = namedQueries.next();
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update((NamedQueryAnnotation) resourceNamedQueries.next());
- }
- else {
- removeNamedQuery_(namedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(namedQueriesSize(), createNamedQuery((NamedQueryAnnotation) resourceNamedQueries.next()));
- }
- }
-
- protected void updateNamedNativeQueries(JavaResourcePersistentType persistentTypeResource) {
- ListIterator<JavaNamedNativeQuery> namedNativeQueries = namedNativeQueries();
- ListIterator<JavaResourceNode> resourceNamedNativeQueries = persistentTypeResource.annotations(NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME);
-
- while (namedNativeQueries.hasNext()) {
- JavaNamedNativeQuery namedQuery = namedNativeQueries.next();
- if (resourceNamedNativeQueries.hasNext()) {
- namedQuery.update((NamedNativeQueryAnnotation) resourceNamedNativeQueries.next());
- }
- else {
- removeNamedNativeQuery_(namedQuery);
- }
- }
-
- while (resourceNamedNativeQueries.hasNext()) {
- addNamedNativeQuery(namedQueriesSize(), createNamedNativeQuery((NamedNativeQueryAnnotation) resourceNamedNativeQueries.next()));
- }
- }
-
-
- protected JavaNamedQuery createNamedQuery(NamedQueryAnnotation namedQueryResource) {
- JavaNamedQuery namedQuery = jpaFactory().buildJavaNamedQuery(this);
- namedQuery.initializeFromResource(namedQueryResource);
- return namedQuery;
- }
-
- protected JavaNamedNativeQuery createNamedNativeQuery(NamedNativeQueryAnnotation namedNativeQueryResource) {
- JavaNamedNativeQuery namedNativeQuery = jpaFactory().buildJavaNamedNativeQuery(this);
- namedNativeQuery.initializeFromResource(namedNativeQueryResource);
- return namedNativeQuery;
- }
-
- protected void updateIdClass(JavaResourcePersistentType typeResource) {
- IdClass idClass = (IdClass) typeResource.annotation(IdClass.ANNOTATION_NAME);
- if (idClass != null) {
- setIdClass_(idClass.getValue());
- }
- else {
- setIdClass_(null);
- }
- }
-
- /**
- * From the Spec:
- * If the DiscriminatorValue annotation is not specified, a
- * provider-specific function to generate a value representing
- * the entity type is used for the value of the discriminator
- * column. If the DiscriminatorType is STRING, the discriminator
- * value default is the entity name.
- *
- * TODO extension point for provider-specific function?
- */
- protected String javaDefaultDiscriminatorValue() {
- if (this.persistentTypeResource.isAbstract()) {
- return null;
- }
- if (this.discriminatorType() != DiscriminatorType.STRING) {
- return null;
- }
- return this.getName();
- }
-
- protected DiscriminatorType discriminatorType() {
- return this.getDiscriminatorColumn().getDiscriminatorType();
- }
-
-
- //******************** Code Completion *************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getTable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaSecondaryTable sTable : CollectionTools.iterable(this.secondaryTables())) {
- result = sTable.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- for (JavaPrimaryKeyJoinColumn column : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- for (JavaAttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = override.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- for (JavaAssociationOverride override : CollectionTools.iterable(this.associationOverrides())) {
- result = override.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- result = this.getDiscriminatorColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.getTableGenerator() != null) {
- result = this.getTableGenerator().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- if (this.getSequenceGenerator() != null) {
- result = this.getSequenceGenerator().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
-
- //********** Validation ********************************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- getTable().addToMessages(messages, astRoot);
- addIdMessages(messages, astRoot);
-
- for (Iterator<JavaSecondaryTable> stream = this.specifiedSecondaryTables(); stream.hasNext();) {
- stream.next().addToMessages(messages, astRoot);
- }
-
- for (Iterator<JavaAttributeOverride> stream = this.attributeOverrides(); stream.hasNext();) {
- stream.next().addToMessages(messages, astRoot);
- }
-
- for (Iterator<JavaAssociationOverride> stream = this.associationOverrides(); stream.hasNext();) {
- stream.next().addToMessages(messages, astRoot);
- }
-
- }
-
- protected void addIdMessages(List<IMessage> messages, CompilationUnit astRoot) {
- addNoIdMessage(messages, astRoot);
- }
-
- protected void addNoIdMessage(List<IMessage> messages, CompilationUnit astRoot) {
- if (entityHasNoId()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NO_ID,
- new String[] {this.getName()},
- this, this.validationTextRange(astRoot))
- );
- }
- }
-
- private boolean entityHasNoId() {
- return ! this.entityHasId();
- }
-
- private boolean entityHasId() {
- for (Iterator<PersistentAttribute> stream = persistentType().allAttributes(); stream.hasNext(); ) {
- if (stream.next().isIdAttribute()) {
- return true;
- }
- }
- return false;
- }
-
- class PrimaryKeyJoinColumnOwner implements JavaAbstractJoinColumn.Owner
- {
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return GenericJavaEntity.this.validationTextRange(astRoot);
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaEntity.this;
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- return GenericJavaEntity.this.dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- Entity parentEntity = GenericJavaEntity.this.parentEntity();
- return (parentEntity == null) ? null : parentEntity.primaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericJavaEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericJavaEntity.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String defaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return GenericJavaEntity.this.parentEntity().primaryKeyColumnName();
- }
- }
-
- class AttributeOverrideOwner implements AttributeOverride.Owner {
-
- public ColumnMapping columnMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaEntity.this.defaultAttributeOverrides.contains(override);
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaEntity.this;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
-
- class AssociationOverrideOwner implements AssociationOverride.Owner {
-
- public RelationshipMapping relationshipMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof RelationshipMapping) {
- return (RelationshipMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaEntity.this.defaultAssociationOverrides.contains(override);
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaEntity.this;
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java
deleted file mode 100644
index 957b775f71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaGeneratedValue.java
+++ /dev/null
@@ -1,114 +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.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-
-
-public class GenericJavaGeneratedValue extends AbstractJavaJpaContextNode implements JavaGeneratedValue
-{
- protected GenerationType strategy;
-
- protected String generator;
-
- protected String defaultGenerator;
-
- protected GeneratedValueAnnotation generatedValueResource;
-
- public GenericJavaGeneratedValue(JavaAttributeMapping parent) {
- super(parent);
- }
-
- public void initializeFromResource(GeneratedValueAnnotation generatedValue) {
- this.generatedValueResource = generatedValue;
- this.strategy = this.strategy(generatedValue);
- this.generator = this.generator(generatedValue);
- }
-
- public GenerationType getStrategy() {
- return (this.getSpecifiedStrategy() == null) ? this.getDefaultStrategy() : this.getSpecifiedStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.strategy;
- }
-
- public void setSpecifiedStrategy(GenerationType newStrategy) {
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.generatedValueResource.setStrategy(GenerationType.toJavaResourceModel(newStrategy));
- firePropertyChanged(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType newStrategy) {
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- firePropertyChanged(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public String getGenerator() {
- return (this.getSpecifiedGenerator() == null) ? this.getDefaultGenerator() : this.getSpecifiedGenerator();
- }
-
- public String getSpecifiedGenerator() {
- return this.generator;
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- public void setSpecifiedGenerator(String newGenerator) {
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- this.generatedValueResource.setGenerator(newGenerator);
- firePropertyChanged(GeneratedValue.SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- protected void setSpecifiedGenerator_(String newGenerator) {
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- firePropertyChanged(GeneratedValue.SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return null;//TODO //this.member.annotationTextRange(DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public TextRange generatorTextRange(CompilationUnit astRoot) {
- return this.generatedValueResource.generatorTextRange(astRoot);
- }
-
- // ********** resource model -> java context model **********
-
- public void update(GeneratedValueAnnotation generatedValue) {
- this.generatedValueResource = generatedValue;
- this.setSpecifiedStrategy_(this.strategy(generatedValue));
- this.setSpecifiedGenerator_(this.generator(generatedValue));
- }
-
- protected GenerationType strategy(GeneratedValueAnnotation generatedValue) {
- return GenerationType.fromJavaResourceModel(generatedValue.getStrategy());
- }
-
- protected String generator(GeneratedValueAnnotation generatedValue) {
- return generatedValue.getGenerator();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java
deleted file mode 100644
index 7f85152cef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdMapping.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.Id;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.Temporal;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaIdMapping extends AbstractJavaAttributeMapping implements JavaIdMapping
-{
- protected final JavaColumn column;
-
- protected JavaGeneratedValue generatedValue;
-
- protected TemporalType temporal;
-
- protected JavaTableGenerator tableGenerator;
-
- protected JavaSequenceGenerator sequenceGenerator;
-
- public GenericJavaIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- }
-
- protected JavaColumn createJavaColumn() {
- return jpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.column.initializeFromResource(this.columnResource());
- this.temporal = this.temporal(this.temporalResource());
- this.initializeTableGenerator(persistentAttributeResource);
- this.initializeSequenceGenerator(persistentAttributeResource);
- this.initializeGeneratedValue(persistentAttributeResource);
- }
-
- protected void initializeTableGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(persistentAttributeResource);
- if (tableGeneratorResource != null) {
- this.tableGenerator = jpaFactory().buildJavaTableGenerator(this);
- this.tableGenerator.initializeFromResource(tableGeneratorResource);
- }
- }
-
- protected void initializeSequenceGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(persistentAttributeResource);
- if (sequenceGeneratorResource != null) {
- this.sequenceGenerator = jpaFactory().buildJavaSequenceGenerator(this);
- this.sequenceGenerator.initializeFromResource(sequenceGeneratorResource);
- }
- }
-
- protected void initializeGeneratedValue(JavaResourcePersistentAttribute persistentAttributeResource) {
- GeneratedValueAnnotation generatedValueResource = generatedValue(persistentAttributeResource);
- if (generatedValueResource != null) {
- this.generatedValue = jpaFactory().buildJavaGeneratedValue(this);
- this.generatedValue.initializeFromResource(generatedValueResource);
- }
- }
-
- protected Temporal temporalResource() {
- return (Temporal) this.persistentAttributeResource.nonNullAnnotation(Temporal.ANNOTATION_NAME);
- }
-
- public ColumnAnnotation columnResource() {
- return (ColumnAnnotation) this.persistentAttributeResource.nonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** IJavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Id.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.GENERATED_VALUE,
- JPA.TEMPORAL,
- JPA.TABLE_GENERATOR,
- JPA.SEQUENCE_GENERATOR);
- }
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- //************** IIdMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.temporalResource().setValue(TemporalType.toJavaResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setTemporal_(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- public JavaGeneratedValue addGeneratedValue() {
- if (getGeneratedValue() != null) {
- throw new IllegalStateException("gemeratedValue already exists");
- }
- this.generatedValue = jpaFactory().buildJavaGeneratedValue(this);
- GeneratedValueAnnotation generatedValueResource = (GeneratedValueAnnotation) this.persistentAttributeResource.addAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- this.generatedValue.initializeFromResource(generatedValueResource);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, null, this.generatedValue);
- return this.generatedValue;
- }
-
- public void removeGeneratedValue() {
- if (getGeneratedValue() == null) {
- throw new IllegalStateException("gemeratedValue does not exist, cannot be removed");
- }
- JavaGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = null;
- this.persistentAttributeResource.removeAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, null);
- }
-
- public JavaGeneratedValue getGeneratedValue() {
- return this.generatedValue;
- }
-
- protected void setGeneratedValue(JavaGeneratedValue newGeneratedValue) {
- JavaGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = newGeneratedValue;
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, newGeneratedValue);
- }
-
- public JavaTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists");
- }
- this.tableGenerator = jpaFactory().buildJavaTableGenerator(this);
- TableGeneratorAnnotation tableGeneratorResource = (TableGeneratorAnnotation) this.persistentAttributeResource.addAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- this.tableGenerator.initializeFromResource(tableGeneratorResource);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed");
- }
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.persistentAttributeResource.removeAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public JavaTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(JavaTableGenerator newTableGenerator) {
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
- public JavaSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists");
- }
-
- this.sequenceGenerator = jpaFactory().buildJavaSequenceGenerator(this);
- SequenceGeneratorAnnotation sequenceGeneratorResource = (SequenceGeneratorAnnotation) this.persistentAttributeResource.addAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- this.sequenceGenerator.initializeFromResource(sequenceGeneratorResource);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed");
- }
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.persistentAttributeResource.removeAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, null);
- }
-
- public JavaSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(JavaSequenceGenerator newSequenceGenerator) {
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.column.update(this.columnResource());
- this.setTemporal_(this.temporal(this.temporalResource()));
- this.updateTableGenerator(persistentAttributeResource);
- this.updateSequenceGenerator(persistentAttributeResource);
- this.updateGeneratedValue(persistentAttributeResource);
- }
-
- protected TemporalType temporal(Temporal temporal) {
- return TemporalType.fromJavaResourceModel(temporal.getValue());
- }
-
- protected void updateTableGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- TableGeneratorAnnotation tableGeneratorResource = tableGenerator(persistentAttributeResource);
- if (tableGeneratorResource == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(jpaFactory().buildJavaTableGenerator(this));
- getTableGenerator().initializeFromResource(tableGeneratorResource);
- }
- else {
- getTableGenerator().update(tableGeneratorResource);
- }
- }
- }
-
- protected void updateSequenceGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- SequenceGeneratorAnnotation sequenceGeneratorResource = sequenceGenerator(persistentAttributeResource);
- if (sequenceGeneratorResource == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(jpaFactory().buildJavaSequenceGenerator(this));
- getSequenceGenerator().initializeFromResource(sequenceGeneratorResource);
- }
- else {
- getSequenceGenerator().update(sequenceGeneratorResource);
- }
- }
- }
-
- protected void updateGeneratedValue(JavaResourcePersistentAttribute persistentAttributeResource) {
- GeneratedValueAnnotation generatedValueResource = generatedValue(persistentAttributeResource);
- if (generatedValueResource == null) {
- if (getGeneratedValue() != null) {
- setGeneratedValue(null);
- }
- }
- else {
- if (getGeneratedValue() == null) {
- setGeneratedValue(jpaFactory().buildJavaGeneratedValue(this));
- getGeneratedValue().initializeFromResource(generatedValueResource);
- }
- else {
- getGeneratedValue().update(generatedValueResource);
- }
- }
- }
-
- protected TableGeneratorAnnotation tableGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- return (TableGeneratorAnnotation) persistentAttributeResource.annotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected SequenceGeneratorAnnotation sequenceGenerator(JavaResourcePersistentAttribute persistentAttributeResource) {
- return (SequenceGeneratorAnnotation) persistentAttributeResource.annotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected GeneratedValueAnnotation generatedValue(JavaResourcePersistentAttribute persistentAttributeResource) {
- return (GeneratedValueAnnotation) persistentAttributeResource.annotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- }
-
-
-// private void updateGeneratedValueFromJava(CompilationUnit astRoot) {
-// if (this.generatedValueAnnotationAdapter.getAnnotation(astRoot) == null) {
-// if (getGeneratedValue() != null) {
-// setGeneratedValue(null);
-// }
-// }
-// else {
-// if (getGeneratedValue() == null) {
-// setGeneratedValue(createGeneratedValue());
-// }
-// ((JavaGeneratedValue) getGeneratedValue()).updateFromJava(astRoot);
-// }
-// }
-
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- @Override
- public String primaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- //*********** Validation ************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- addColumnMessages(messages, astRoot);
-
- //TODO njh there is no generator repos yet
-// addGeneratorMessages(messages);
- }
-
- protected void addColumnMessages(List<IMessage> messages, CompilationUnit astRoot) {
- JavaColumn column = this.getColumn();
- String table = column.getTable();
- boolean doContinue = entityOwned() && column.isConnected();
-
- if (doContinue && this.typeMapping().tableNameIsInvalid(table)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {table, column.getName()},
- column, column.tableTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && ! column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName()},
- column, column.nameTextRange(astRoot))
- );
- }
- }
-
- protected void addGeneratorMessages(List<IMessage> messages, CompilationUnit astRoot) {
- JavaGeneratedValue generatedValue = this.getGeneratedValue();
- if (generatedValue == null) {
- return;
- }
- String generatorName = generatedValue.getGenerator();
- if (generatorName == null) {
- return;
- }
-// IGeneratorRepository generatorRepository = persistenceUnit().getGeneratorRepository();
-// IJavaGenerator generator = generatorRepository.generator(generatorName);
-//
-// if (generator == null) {
-// messages.add(
-// JpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// IJpaValidationMessages.GENERATED_VALUE_UNRESOLVED_GENERATOR,
-// new String[] {generatorName},
-// generatedValue, generatedValue.generatorTextRange())
-// );
-// }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java
deleted file mode 100644
index d59153d795..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumn.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public class GenericJavaJoinColumn extends AbstractJavaColumn<JoinColumnAnnotation> implements JavaJoinColumn
-{
-
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected JoinColumnAnnotation joinColumn;
-
- public GenericJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- protected JoinColumnAnnotation columnResource() {
- return this.joinColumn;
- }
-
- public String getReferencedColumnName() {
- return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName;
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- this.joinColumn.setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(AbstractJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
-
- @Override
- public JavaJoinColumn.Owner owner() {
- return (JavaJoinColumn.Owner) super.owner();
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- public Table dbReferencedColumnTable() {
- return owner().dbReferencedColumnTable();
- }
-
- public Column dbReferencedColumn() {
- Table table = this.dbReferencedColumnTable();
- return (table == null) ? null : table.columnNamed(this.getReferencedColumnName());
- }
-
- @Override
- public boolean tableIsAllowed() {
- return this.owner().tableIsAllowed();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return columnResource().referencedColumnNameTouches(pos, astRoot);
- }
-
- private Iterator<String> candidateReferencedColumnNames() {
- Table table = this.owner().dbReferencedColumnTable();
- return (table != null) ? table.columnNames() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateReferencedColumnNames(), filter);
- }
-
- private Iterator<String> quotedCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.quote(this.candidateReferencedColumnNames(filter));
- }
-
- @Override
- public Iterator<String> connectedCandidateValuesFor(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedCandidateValuesFor(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.referencedColumnNameTouches(pos, astRoot)) {
- return this.quotedCandidateReferencedColumnNames(filter);
- }
- return null;
- }
-
- public boolean isReferencedColumnResolved() {
- return dbReferencedColumn() != null;
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- TextRange textRange = columnResource().referencedColumnNameTextRange(astRoot);
- return (textRange != null) ? textRange : owner().validationTextRange(astRoot);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void initializeFromResource(JoinColumnAnnotation joinColumn) {
- this.joinColumn = joinColumn;
- super.initializeFromResource(joinColumn);
- this.specifiedReferencedColumnName = joinColumn.getReferencedColumnName();
- this.defaultReferencedColumnName = this.defaultReferencedColumnName();
- }
-
- @Override
- public void update(JoinColumnAnnotation joinColumn) {
- this.joinColumn = joinColumn;
- super.update(joinColumn);
- this.setSpecifiedReferencedColumnName_(joinColumn.getReferencedColumnName());
- this.setDefaultReferencedColumnName(this.defaultReferencedColumnName());
- }
-
- @Override
- protected String defaultName() {
- RelationshipMapping relationshipMapping = owner().relationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if (!relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- return buildDefaultName();
- }
-
- protected String defaultReferencedColumnName() {
- RelationshipMapping relationshipMapping = owner().relationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if (!relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- return buildDefaultReferencedColumnName();
- }
-
- @Override
- protected String defaultTable() {
- RelationshipMapping relationshipMapping = owner().relationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- if (!relationshipMapping.isRelationshipOwner()) {
- return null;
- }
- return super.defaultTable();
- }
-
- /**
- * return the join column's default name;
- * which is typically &lt;attribute name&gt;_&lt;referenced column name&gt;
- * but, if we don't have an attribute name (e.g. in a unidirectional
- * OneToMany or ManyToMany) is
- * &lt;target entity name&gt;_&lt;referenced column name&gt;
- */
- // <attribute name>_<referenced column name>
- // or
- // <target entity name>_<referenced column name>
- protected String buildDefaultName() {
- if (owner().joinColumnsSize() != 1) {
- return null;
- }
- String prefix = owner().attributeName();
- if (prefix == null) {
- prefix = targetEntityName();
- }
- if (prefix == null) {
- return null;
- }
- // TODO not sure which of these is correct...
- // (the spec implies that the referenced column is always the
- // primary key column of the target entity)
- // String targetColumn = this.targetPrimaryKeyColumnName();
- String targetColumn = getReferencedColumnName();
- if (targetColumn == null) {
- return null;
- }
- return prefix + "_" + targetColumn;
- }
-
- /**
- * return the name of the target entity
- */
- protected String targetEntityName() {
- Entity targetEntity = owner().targetEntity();
- return (targetEntity == null) ? null : targetEntity.getName();
- }
-
- protected String buildDefaultReferencedColumnName() {
- if (owner().joinColumnsSize() != 1) {
- return null;
- }
- return this.targetPrimaryKeyColumnName();
- }
-
- /**
- * return the name of the single primary key column of the target entity
- */
- protected String targetPrimaryKeyColumnName() {
- Entity targetEntity = owner().targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryKeyColumnName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java
deleted file mode 100644
index 81b1aad8ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTable.java
+++ /dev/null
@@ -1,755 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaJoinTable extends AbstractJavaTable implements JavaJoinTable
-{
- protected final List<JavaJoinColumn> specifiedJoinColumns;
-
- protected JavaJoinColumn defaultJoinColumn;
-
- protected final List<JavaJoinColumn> specifiedInverseJoinColumns;
-
- protected JavaJoinColumn defaultInverseJoinColumn;
-
- protected JavaResourcePersistentAttribute attributeResource;
-
- public GenericJavaJoinTable(JavaRelationshipMapping parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<JavaJoinColumn>();
- this.specifiedInverseJoinColumns = new ArrayList<JavaJoinColumn>();
- }
-
- @Override
- public JavaRelationshipMapping parent() {
- return (JavaRelationshipMapping) super.parent();
- }
-
- //******************* AbstractJavaTable implementation *****************
-
- @Override
- protected String annotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- /**
- * Default join table name from the JPA spec:
- * The concatenated names of the two associated primary
- * entity tables, separated by a underscore.
- *
- * [owning table name]_[target table name]
- */
- @Override
- protected String defaultName() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- String owningTableName = relationshipMapping().typeMapping().tableName();
- if (owningTableName == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String targetTableName = targetEntity.tableName();
- if (targetTableName == null) {
- return null;
- }
- return owningTableName + "_" + targetTableName;
- }
-
- @Override
- protected String defaultCatalog() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- return super.defaultCatalog();
- }
-
- @Override
- protected String defaultSchema() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- return super.defaultSchema();
- }
-
- @Override
- protected JoinTableAnnotation tableResource() {
- return (JoinTableAnnotation) this.attributeResource.nonNullAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
- /**
- * Return the join table java resource, null if the annotation does not exist.
- * Use tableResource() if you want a non null implementation
- */
- protected JoinTableAnnotation joinTableResource() {
- return (JoinTableAnnotation) this.attributeResource.annotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
- protected void addJoinTableResource() {
- this.attributeResource.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
-
- //******************* IJoinTable implementation *****************
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.containsSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn newJoinColumn) {
- JavaJoinColumn oldJoinColumn = this.defaultJoinColumn;
- this.defaultJoinColumn = newJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, oldJoinColumn, newJoinColumn);
- }
-
- protected ListIterator<JavaJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- JoinColumn oldDefaultJoinColumn = this.getDefaultJoinColumn();
- if (oldDefaultJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultJoinColumn = null;
- }
- if (joinTableResource() == null) {
- //Add the JoinTable before creating the specifiedJoinColumn.
- //Otherwise we will remove it and create another during an update
- //from the java resource model
- addJoinTableResource();
- }
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnResource = this.tableResource().addJoinColumn(index);
- joinColumn.initializeFromResource(joinColumnResource);
- this.fireItemAdded(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, oldDefaultJoinColumn, null);
- }
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if (!containsSpecifiedJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = createJoinColumn(new NullJoinColumn(tableResource()));
- }
- this.tableResource().removeJoinColumn(index);
- fireItemRemoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.tableResource().moveJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaJoinColumn> inverseJoinColumns() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumns() : this.defaultInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.containsSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumnsSize() : this.defaultInverseJoinColumnsSize();
- }
-
- public JavaJoinColumn getDefaultInverseJoinColumn() {
- return this.defaultInverseJoinColumn;
- }
-
- protected void setDefaultInverseJoinColumn(JavaJoinColumn newInverseJoinColumn) {
- JavaJoinColumn oldInverseJoinColumn = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = newInverseJoinColumn;
- firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, oldInverseJoinColumn, newInverseJoinColumn);
- }
-
- protected ListIterator<JavaJoinColumn> defaultInverseJoinColumns() {
- if (this.defaultInverseJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultInverseJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultInverseJoinColumnsSize() {
- return (this.defaultInverseJoinColumn == null) ? 0 : 1;
- }
-
- public ListIterator<JavaJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- public boolean containsSpecifiedInverseJoinColumns() {
- return !this.specifiedInverseJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedInverseJoinColumn(int index) {
- JoinColumn oldDefaultInverseJoinColumn = this.getDefaultInverseJoinColumn();
- if (oldDefaultInverseJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultInverseJoinColumn = null;
- }
- if (joinTableResource() == null) {
- //Add the JoinTable before creating the specifiedJoinColumn.
- //Otherwise we will remove it and create another during an update
- //from the java resource model
- addJoinTableResource();
- }
- JavaJoinColumn inverseJoinColumn = jpaFactory().buildJavaJoinColumn(this, createInverseJoinColumnOwner());
- this.specifiedInverseJoinColumns.add(index, inverseJoinColumn);
- JoinColumnAnnotation joinColumnResource = this.tableResource().addInverseJoinColumn(index);
- inverseJoinColumn.initializeFromResource(joinColumnResource);
- this.fireItemAdded(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, inverseJoinColumn);
- if (oldDefaultInverseJoinColumn != null) {
- this.firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, oldDefaultInverseJoinColumn, null);
- }
- return inverseJoinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, JavaJoinColumn inverseJoinColumn) {
- addItemToList(index, inverseJoinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedInverseJoinColumn(JoinColumn inverseJoinColumn) {
- this.removeSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.indexOf(inverseJoinColumn));
- }
-
- public void removeSpecifiedInverseJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedInverseJoinColumns.remove(index);
- if (!containsSpecifiedInverseJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultInverseJoinColumn = createInverseJoinColumn(new NullJoinColumn(tableResource()));
- }
- this.tableResource().removeInverseJoinColumn(index);
- fireItemRemoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultInverseJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(JoinTable.DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
- }
-
- protected void removeSpecifiedInverseJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.tableResource().moveInverseJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- public RelationshipMapping relationshipMapping() {
- return (RelationshipMapping) this.parent();
- }
-
- public boolean isSpecified() {
- return joinTableResource() != null;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.inverseJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- protected JavaJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected JavaJoinColumn.Owner createInverseJoinColumnOwner() {
- return new InverseJoinColumnOwner();
- }
-
- public void initializeFromResource(JavaResourcePersistentAttribute attributeResource) {
- this.attributeResource = attributeResource;
- JoinTableAnnotation joinTable = tableResource();
- this.initializeFromResource(joinTable);
- this.initializeSpecifiedJoinColumns(joinTable);
- this.initializeDefaultJoinColumn(joinTable);
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- this.initializeDefaultInverseJoinColumn(joinTable);
- }
-
- protected void initializeSpecifiedJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JoinColumnAnnotation> annotations = joinTableResource.joinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedJoinColumns.add(createJoinColumn(annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return !containsSpecifiedJoinColumns() && relationshipMapping().isRelationshipOwner();
- }
-
- protected void initializeDefaultJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultJoinColumn()) {
- return;
- }
- this.defaultJoinColumn = this.jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- this.defaultJoinColumn.initializeFromResource(new NullJoinColumn(joinTable));
- }
-
- protected void initializeSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JoinColumnAnnotation> annotations = joinTableResource.inverseJoinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedInverseJoinColumns.add(createInverseJoinColumn(annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultInverseJoinColumn() {
- return !containsSpecifiedInverseJoinColumns() && relationshipMapping().isRelationshipOwner();
- }
-
- protected void initializeDefaultInverseJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- return;
- }
- this.defaultInverseJoinColumn = this.jpaFactory().buildJavaJoinColumn(this, createInverseJoinColumnOwner());
- this.defaultInverseJoinColumn.initializeFromResource(new NullJoinColumn(joinTable));
- }
-
- public void update(JavaResourcePersistentAttribute attributeResource) {
- this.attributeResource = attributeResource;
- JoinTableAnnotation joinTable = tableResource();
- this.update(joinTable);
- this.updateSpecifiedJoinColumns(joinTable);
- this.updateDefaultJoinColumn(joinTable);
- this.updateSpecifiedInverseJoinColumns(joinTable);
- this.updateDefaultInverseJoinColumn(joinTable);
- }
-
- protected void updateSpecifiedJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = joinTableResource.joinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultJoinColumn()) {
- setDefaultJoinColumn(null);
- return;
- }
- if (getDefaultJoinColumn() == null) {
- JoinColumnAnnotation joinColumnResource = new NullJoinColumn(joinTable);
- this.setDefaultJoinColumn(createJoinColumn(joinColumnResource));
- }
- else {
- this.defaultJoinColumn.update(new NullJoinColumn(joinTable));
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableResource) {
- ListIterator<JavaJoinColumn> joinColumns = specifiedInverseJoinColumns();
- ListIterator<JoinColumnAnnotation> resourceJoinColumns = joinTableResource.inverseJoinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedInverseJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedInverseJoinColumn(specifiedInverseJoinColumnsSize(), createInverseJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultInverseJoinColumn(JoinTableAnnotation joinTable) {
- if (!shouldBuildDefaultInverseJoinColumn()) {
- setDefaultInverseJoinColumn(null);
- return;
- }
- if (getDefaultInverseJoinColumn() == null) {
- JoinColumnAnnotation joinColumnResource = new NullJoinColumn(joinTable);
- this.setDefaultInverseJoinColumn(createInverseJoinColumn(joinColumnResource));
- }
- else {
- this.defaultInverseJoinColumn.update(new NullJoinColumn(joinTable));
- }
- }
-
- protected JavaJoinColumn createJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createJoinColumnOwner());
- joinColumn.initializeFromResource(joinColumnResource);
- return joinColumn;
- }
-
- protected JavaJoinColumn createInverseJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = jpaFactory().buildJavaJoinColumn(this, createInverseJoinColumnOwner());
- joinColumn.initializeFromResource(joinColumnResource);
- return joinColumn;
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- boolean doContinue = isConnected();
- String schema = getSchema();
-
- if (doContinue && ! hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {schema, getName()},
- this,
- schemaTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && !isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME,
- new String[] {getName()},
- this,
- nameTextRange(astRoot))
- );
- doContinue = false;
- }
-
- for (Iterator<JavaJoinColumn> stream = joinColumns(); stream.hasNext(); ) {
- JavaJoinColumn joinColumn = stream.next();
-
- if (doContinue && ! joinColumn.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn, joinColumn.nameTextRange(astRoot))
- );
- }
-
- if (doContinue && ! joinColumn.isReferencedColumnResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn, joinColumn.referencedColumnNameTextRange(astRoot))
- );
- }
- }
-
- for (Iterator<JavaJoinColumn> stream = inverseJoinColumns(); stream.hasNext(); ) {
- JavaJoinColumn joinColumn = stream.next();
-
- if (doContinue && ! joinColumn.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getName()},
- joinColumn, joinColumn.nameTextRange(astRoot))
- );
- }
-
- if (doContinue && ! joinColumn.isReferencedColumnResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {joinColumn.getReferencedColumnName(), joinColumn.getName()},
- joinColumn, joinColumn.referencedColumnNameTextRange(astRoot))
- );
- }
- }
- }
-
- /**
- * just a little common behavior
- */
- abstract class AbstractJoinColumnOwner implements JavaJoinColumn.Owner
- {
- AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping typeMapping() {
- return relationshipMapping().typeMapping();
- }
-
- public RelationshipMapping relationshipMapping() {
- return GenericJavaJoinTable.this.relationshipMapping();
- }
-
- /**
- * the default table name is always valid and a specified table name
- * is prohibited (which will be handled elsewhere)
- */
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * the join column can only be on the join table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- if (GenericJavaJoinTable.this.getName() == null) {
- return null;
- }
- return (GenericJavaJoinTable.this.getName().equals(tableName)) ? GenericJavaJoinTable.this.dbTable() : null;
- }
-
- /**
- * by default, the join column is, obviously, in the join table;
- * not sure whether it can be anywhere else...
- */
- public String defaultTableName() {
- return GenericJavaJoinTable.this.getName();
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return GenericJavaJoinTable.this.validationTextRange(astRoot);
- }
-
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- class InverseJoinColumnOwner extends AbstractJoinColumnOwner
- {
- public InverseJoinColumnOwner() {
- super();
- }
-
- public Entity targetEntity() {
- return GenericJavaJoinTable.this.relationshipMapping().getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return GenericJavaJoinTable.this.relationshipMapping().persistentAttribute().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- org.eclipse.jpt.db.internal.Table dbTable = super.dbTable(tableName);
- if (dbTable != null) {
- return dbTable;
- }
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericJavaJoinTable.this.defaultInverseJoinColumn == joinColumn;
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.inverseJoinColumnsSize();
- }
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- class JoinColumnOwner extends AbstractJoinColumnOwner
- {
- public JoinColumnOwner() {
- super();
- }
-
- public Entity targetEntity() {
- return GenericJavaJoinTable.this.relationshipMapping().getEntity();
- }
-
- public String attributeName() {
- Entity targetEntity = GenericJavaJoinTable.this.relationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String attributeName = GenericJavaJoinTable.this.relationshipMapping().persistentAttribute().getName();
- for (Iterator<PersistentAttribute> stream = targetEntity.persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- AttributeMapping mapping = attribute.getMapping();
- if (mapping instanceof NonOwningMapping) {
- String mappedBy = ((NonOwningMapping) mapping).getMappedBy();
- if ((mappedBy != null) && mappedBy.equals(attributeName)) {
- return attribute.getName();
- }
- }
- }
- return null;
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- org.eclipse.jpt.db.internal.Table dbTable = super.dbTable(tableName);
- if (dbTable != null) {
- return dbTable;
- }
- return typeMapping().dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- return typeMapping().primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericJavaJoinTable.this.defaultJoinColumn == joinColumn;
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.joinColumnsSize();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java
deleted file mode 100644
index 46c3c7c4f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyMapping.java
+++ /dev/null
@@ -1,87 +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.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.ManyToMany;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaManyToManyMapping extends AbstractJavaMultiRelationshipMapping<ManyToMany>
- implements JavaManyToManyMapping
-{
-
- public GenericJavaManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return ManyToMany.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ORDER_BY,
- JPA.MAP_KEY,
- JPA.JOIN_TABLE);
- }
-
- @Override
- protected ManyToMany relationshipMapping() {
- return (ManyToMany) this.persistentAttributeResource.mappingAnnotation();
- }
-
- // ********** JavaMultiRelationshipMapping implementation **********
-
- @Override
- protected boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTouches(pos, astRoot);
- }
-
-
- @Override
- protected void setMappedByOnResourceModel(String mappedBy) {
- relationshipMapping().setMappedBy(mappedBy);
- }
-
- @Override
- protected String mappedBy(ManyToMany relationshipMapping) {
- return relationshipMapping.getMappedBy();
- }
-
- // ********** INonOwningMapping implementation **********
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTextRange(astRoot);
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java
deleted file mode 100644
index da53f2070c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneMapping.java
+++ /dev/null
@@ -1,101 +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.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.ManyToOne;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaManyToOneMapping extends AbstractJavaSingleRelationshipMapping<ManyToOne>
- implements JavaManyToOneMapping
-{
-
- public GenericJavaManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS,
- JPA.JOIN_TABLE);
- }
-
- public String annotationName() {
- return ManyToOne.ANNOTATION_NAME;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected ManyToOne relationshipMapping() {
- return (ManyToOne) this.persistentAttributeResource.mappingAnnotation();
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- @Override
- protected void setOptionalOnResourceModel(Boolean newOptional) {
- this.relationshipMapping().setOptional(newOptional);
- }
-
- @Override
- protected Boolean specifiedOptional(ManyToOne relationshipMapping) {
- return relationshipMapping.getOptional();
- }
-
- //ManyToOne mapping is always the owning side
- public boolean isRelationshipOwner() {
- return true;
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-
- //***************** ISingleRelationshipMapping implementation *****************
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> joinColumns() {
- return super.joinColumns();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> defaultJoinColumns() {
- return super.defaultJoinColumns();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return super.specifiedJoinColumns();
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java
deleted file mode 100644
index 27049e9ac2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedSuperclass.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.java.IdClass;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-public class GenericJavaMappedSuperclass extends AbstractJavaTypeMapping
- implements JavaMappedSuperclass
-{
-
- protected String idClass;
-
- public GenericJavaMappedSuperclass(JavaPersistentType parent) {
- super(parent);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ID_CLASS,
- JPA.EXCLUDE_DEFAULT_LISTENERS,
- JPA.EXCLUDE_SUPERCLASS_LISTENERS,
- JPA.ENTITY_LISTENERS,
- JPA.PRE_PERSIST,
- JPA.POST_PERSIST,
- JPA.PRE_REMOVE,
- JPA.POST_REMOVE,
- JPA.PRE_UPDATE,
- JPA.POST_UPDATE,
- JPA.POST_LOAD);
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (newIdClass != oldIdClass) {
- if (newIdClass != null) {
- if (idClassResource() == null) {
- addIdClassResource();
- }
- idClassResource().setValue(newIdClass);
- }
- else {
- removeIdClassResource();
- }
- }
- firePropertyChanged(MappedSuperclass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(MappedSuperclass.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClass idClassResource() {
- return (IdClass) this.persistentTypeResource.annotation(IdClass.ANNOTATION_NAME);
- }
-
- protected void addIdClassResource() {
- this.persistentTypeResource.addAnnotation(IdClass.ANNOTATION_NAME);
- }
-
- protected void removeIdClassResource() {
- this.persistentTypeResource.removeAnnotation(IdClass.ANNOTATION_NAME);
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- return this.namesOf(this.overridableAttributes());
- }
-
- protected Iterator<JavaPersistentAttribute> overridableAttributes() {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(this.persistentType().attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- return this.namesOf(this.overridableAssociations());
- }
-
- protected Iterator<JavaPersistentAttribute> overridableAssociations() {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(this.persistentType().attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return o.isOverridableAssociation();
- }
- };
- }
-
- protected Iterator<String> namesOf(Iterator<JavaPersistentAttribute> attributes) {
- return new TransformationIterator<JavaPersistentAttribute, String>(attributes) {
- @Override
- protected String transform(JavaPersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentType persistentTypeResource) {
- super.initializeFromResource(persistentTypeResource);
- this.initializeIdClass(persistentTypeResource);
- }
-
- protected void initializeIdClass(JavaResourcePersistentType typeResource) {
- IdClass idClassResource = (IdClass) typeResource.annotation(IdClass.ANNOTATION_NAME);
- if (idClassResource != null) {
- this.idClass = idClassResource.getValue();
- }
- }
-
- @Override
- public void update(JavaResourcePersistentType persistentTypeResource) {
- super.update(persistentTypeResource);
- this.updateIdClass(persistentTypeResource);
- }
-
- protected void updateIdClass(JavaResourcePersistentType typeResource) {
- IdClass idClass = (IdClass) typeResource.annotation(IdClass.ANNOTATION_NAME);
- if (idClass != null) {
- setIdClass_(idClass.getValue());
- }
- else {
- setIdClass_(null);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.java
deleted file mode 100644
index e9f6ae429a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedNativeQuery.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-
-
-public class GenericJavaNamedNativeQuery extends AbstractJavaQuery
- implements JavaNamedNativeQuery
-{
-
- protected String resultClass;
-
- protected String resultSetMapping;
-
- public GenericJavaNamedNativeQuery(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected NamedNativeQueryAnnotation query() {
- return (NamedNativeQueryAnnotation) super.query();
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- query().setResultClass(newResultClass);
- firePropertyChanged(NamedNativeQuery.RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- query().setResultSetMapping(newResultSetMapping);
- firePropertyChanged(NamedNativeQuery.RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
- public void initializeFromResource(NamedNativeQueryAnnotation queryResource) {
- super.initializeFromResource(queryResource);
- this.resultClass = queryResource.getResultClass();
- this.resultSetMapping = queryResource.getResultSetMapping();
- }
-
- public void update(NamedNativeQueryAnnotation queryResource) {
- super.update(queryResource);
- this.setResultClass(queryResource.getResultClass());
- this.setResultSetMapping(queryResource.getResultSetMapping());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.java
deleted file mode 100644
index d0574fdffd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNamedQuery.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-
-
-public class GenericJavaNamedQuery extends AbstractJavaQuery implements JavaNamedQuery
-{
-
- public GenericJavaNamedQuery(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected NamedQueryAnnotation query() {
- return (NamedQueryAnnotation) super.query();
- }
-
- public void initializeFromResource(NamedQueryAnnotation queryResource) {
- super.initializeFromResource(queryResource);
- }
-
- public void update(NamedQueryAnnotation queryResource) {
- super.update(queryResource);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index 6d46be00d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaNullAttributeMapping.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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-
-public class GenericJavaNullAttributeMapping extends AbstractJavaAttributeMapping
-{
- public GenericJavaNullAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return null;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.java
deleted file mode 100644
index 2d2565bda7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToManyMapping.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.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.OneToMany;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaOneToManyMapping extends AbstractJavaMultiRelationshipMapping<OneToMany>
- implements JavaOneToManyMapping
-{
-
- public GenericJavaOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.ORDER_BY,
- JPA.MAP_KEY,
- JPA.JOIN_TABLE,
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS);
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return OneToMany.ANNOTATION_NAME;
- }
-
- @Override
- protected OneToMany relationshipMapping() {
- return (OneToMany) this.persistentAttributeResource.mappingAnnotation();
- }
-
- // ********** JavaMultiRelationshipMapping implementation **********
-
- @Override
- protected boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTouches(pos, astRoot);
- }
-
- @Override
- protected void setMappedByOnResourceModel(String mappedBy) {
- this.relationshipMapping().setMappedBy(mappedBy);
- }
-
- @Override
- protected String mappedBy(OneToMany relationshipMapping) {
- return relationshipMapping.getMappedBy();
- }
-
-
- // ********** INonOwningMapping implementation **********
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTextRange(astRoot);
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java
deleted file mode 100644
index 0425c2c11b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneMapping.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.OneToOne;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaOneToOneMapping extends AbstractJavaSingleRelationshipMapping<OneToOne>
- implements JavaOneToOneMapping
-{
- protected String mappedBy;
-
- public GenericJavaOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.PRIMARY_KEY_JOIN_COLUMN,
- JPA.PRIMARY_KEY_JOIN_COLUMNS,
- JPA.JOIN_COLUMN,
- JPA.JOIN_COLUMNS,
- JPA.JOIN_TABLE);
- }
-
- public String annotationName() {
- return OneToOne.ANNOTATION_NAME;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected OneToOne relationshipMapping() {
- return (OneToOne) this.persistentAttributeResource.mappingAnnotation();
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.relationshipMapping().setMappedBy(newMappedBy);
- firePropertyChanged(NonOwningMapping.MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- @Override
- protected void setOptionalOnResourceModel(Boolean newOptional) {
- this.relationshipMapping().setOptional(newOptional);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTextRange(astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.relationshipMapping().mappedByTouches(pos, astRoot);
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mappedByTouches(pos, astRoot)) {
- return this.quotedCandidateMappedByAttributeNames(filter);
- }
- return null;
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- @Override
- protected void initialize(OneToOne oneToOneResource) {
- super.initialize(oneToOneResource);
- this.mappedBy = oneToOneResource.getMappedBy();
- }
-
- @Override
- protected void update(OneToOne oneToOneResource) {
- super.update(oneToOneResource);
- this.setMappedBy(oneToOneResource.getMappedBy());
- }
-
- @Override
- protected Boolean specifiedOptional(OneToOne relationshipMapping) {
- return relationshipMapping.getOptional();
- }
-
- //***************** Validation ***********************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- if (this.getMappedBy() != null) {
- addMappedByMessages(messages ,astRoot);
- }
- }
-
- protected void addMappedByMessages(List<IMessage> messages, CompilationUnit astRoot) {
- String mappedBy = this.getMappedBy();
- Entity targetEntity = this.getResolvedTargetEntity();
-
- if (targetEntity == null) {
- // already have validation messages for that
- return;
- }
-
- PersistentAttribute attribute = targetEntity.persistentType().resolveAttribute(mappedBy);
-
- if (attribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {mappedBy},
- this, this.mappedByTextRange(astRoot))
- );
- return;
- }
-
- if (! this.mappedByIsValid(attribute.getMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {mappedBy},
- this, this.mappedByTextRange(astRoot))
- );
- return;
- }
-
- NonOwningMapping mappedByMapping;
- try {
- mappedByMapping = (NonOwningMapping) attribute.getMapping();
- } catch (ClassCastException cce) {
- // there is no error then
- return;
- }
-
- if (mappedByMapping.getMappedBy() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- this, this.mappedByTextRange(astRoot))
- );
- }
- }
-
- //***************** ISingleRelationshipMapping implementation *****************
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> joinColumns() {
- return super.joinColumns();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> defaultJoinColumns() {
- return super.defaultJoinColumns();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return super.specifiedJoinColumns();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index 04a490b6f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaPersistentAttribute extends AbstractJavaJpaContextNode
- implements JavaPersistentAttribute
-{
- protected String name;
-
- protected JavaAttributeMapping defaultMapping;
-
- protected JavaAttributeMapping specifiedMapping;
-
- protected JavaResourcePersistentAttribute persistentAttributeResource;
-
- public GenericJavaPersistentAttribute(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- this.persistentAttributeResource = persistentAttributeResource;
- this.name = this.name(persistentAttributeResource);
- initializeDefaultMapping(persistentAttributeResource);
- initializeSpecifiedMapping(persistentAttributeResource);
- }
-
- protected void initializeDefaultMapping(JavaResourcePersistentAttribute persistentAttributeResource) {
- this.defaultMapping = createDefaultJavaAttributeMapping(persistentAttributeResource);
- }
-
- protected void initializeSpecifiedMapping(JavaResourcePersistentAttribute persistentAttributeResource) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(persistentAttributeResource);
- this.specifiedMapping = createJavaAttributeMappingFromAnnotation(javaMappingAnnotationName, persistentAttributeResource);
- }
-
- public JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.persistentAttributeResource;
- }
-
- public JavaPersistentType persistentType() {
- return (JavaPersistentType) this.parent();
- }
-
- public JavaTypeMapping typeMapping() {
- return this.persistentType().getMapping();
- }
-
- public String primaryKeyColumnName() {
- return this.getMapping().primaryKeyColumnName();
- }
-
- public boolean isOverridableAttribute() {
- return this.getMapping().isOverridableAttributeMapping();
- }
-
- public boolean isOverridableAssociation() {
- return this.getMapping().isOverridableAssociationMapping();
- }
-
- public boolean isIdAttribute() {
- return this.getMapping().isIdMapping();
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- public String getName() {
- return this.name;
- }
-
- protected void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public JavaAttributeMapping getDefaultMapping() {
- return this.defaultMapping;
- }
-
- /**
- * clients do not set the "default" mapping
- */
- protected void setDefaultMapping(JavaAttributeMapping newDefaultMapping) {
- JavaAttributeMapping oldMapping = this.defaultMapping;
- this.defaultMapping = newDefaultMapping;
- firePropertyChanged(PersistentAttribute.DEFAULT_MAPPING_PROPERTY, oldMapping, newDefaultMapping);
- }
-
- public JavaAttributeMapping getSpecifiedMapping() {
- return this.specifiedMapping;
- }
-
- /**
- * clients do not set the "specified" mapping;
- * use #setMappingKey(String)
- */
- protected void setSpecifiedMapping(JavaAttributeMapping newSpecifiedMapping) {
- JavaAttributeMapping oldMapping = this.specifiedMapping;
- this.specifiedMapping = newSpecifiedMapping;
- firePropertyChanged(PersistentAttribute.SPECIFIED_MAPPING_PROPERTY, oldMapping, newSpecifiedMapping);
- }
-
-
- public JavaAttributeMapping getMapping() {
- return (this.specifiedMapping != null) ? this.specifiedMapping : this.defaultMapping;
- }
-
- public String mappingKey() {
- return this.getMapping().getKey();
- }
-
- /**
- * return null if there is no "default" mapping for the attribute
- */
- public String defaultMappingKey() {
- return this.defaultMapping.getKey();
- }
-
- /**
- * return null if there is no "specified" mapping for the attribute
- */
- public String specifiedMappingKey() {
- return (this.specifiedMapping == null) ? null : this.specifiedMapping.getKey();
- }
-
- // TODO support morphing mappings, i.e. copying common settings over
- // to the new mapping; this can't be done in the same was as XmlAttributeMapping
- // since we don't know all the possible mapping types
- public void setSpecifiedMappingKey(String newKey) {
- if (newKey == specifiedMappingKey()) {
- return;
- }
- JavaAttributeMapping oldMapping = getMapping();
- JavaAttributeMapping newMapping = createJavaAttributeMappingFromMappingKey(newKey);
-
- this.specifiedMapping = newMapping;
- if (newMapping != null) {
- this.persistentAttributeResource.setMappingAnnotation(newMapping.annotationName());
- }
- else {
- this.persistentAttributeResource.setMappingAnnotation(null);
- }
- firePropertyChanged(PersistentAttribute.SPECIFIED_MAPPING_PROPERTY, oldMapping, newMapping);
-
- if (oldMapping != null) {
- Collection<String> annotationsToRemove = CollectionTools.collection(oldMapping.correspondingAnnotationNames());
- if (getMapping() != null) {
- CollectionTools.removeAll(annotationsToRemove, getMapping().correspondingAnnotationNames());
- }
-
- for (String annotationName : annotationsToRemove) {
- this.persistentAttributeResource.removeAnnotation(annotationName);
- }
- }
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- return this;
- }
-
- public boolean contains(int offset, CompilationUnit astRoot) {
- TextRange fullTextRange = this.fullTextRange(astRoot);
- if (fullTextRange == null) {
- //This happens if the attribute no longer exists in the java.
- //The text selection event is fired before the update from java so our
- //model has not yet had a chance to update appropriately. The list of
- //JavaPersistentAttriubtes is stale at this point. For now, we are trying
- //to avoid the NPE, not sure of the ultimate solution to these 2 threads accessing
- //our model
- return false;
- }
- return fullTextRange.includes(offset);
- }
-
-
- public TextRange fullTextRange(CompilationUnit astRoot) {
- return this.persistentAttributeResource.textRange(astRoot);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return this.selectionTextRange(astRoot);
- }
-
- public TextRange selectionTextRange(CompilationUnit astRoot) {
- return this.persistentAttributeResource.nameTextRange(astRoot);
- }
-
- public TextRange selectionTextRange() {
- return selectionTextRange(this.persistentAttributeResource.getMember().astRoot());
- }
-
-
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- this.persistentAttributeResource = persistentAttributeResource;
- this.setName(this.name(persistentAttributeResource));
- this.updateDefaultMapping(persistentAttributeResource);
- this.updateSpecifiedMapping(persistentAttributeResource);
- }
-
- protected String name(JavaResourcePersistentAttribute persistentAttributeResource) {
- return persistentAttributeResource.getName();
- }
-
- public String specifiedMappingAnnotationName() {
- return (this.specifiedMapping == null) ? null : this.specifiedMapping.annotationName();
- }
-
- protected void updateSpecifiedMapping(JavaResourcePersistentAttribute persistentAttributeResource) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(persistentAttributeResource);
- if (specifiedMappingAnnotationName() != javaMappingAnnotationName) {
- setSpecifiedMapping(createJavaAttributeMappingFromAnnotation(javaMappingAnnotationName, persistentAttributeResource));
- }
- else {
- if (getSpecifiedMapping() != null) {
- getSpecifiedMapping().update(persistentAttributeResource);
- }
- }
- }
-
- protected void updateDefaultMapping(JavaResourcePersistentAttribute persistentAttributeResource) {
- String defaultMappingKey = jpaPlatform().defaultJavaAttributeMappingKey(this);
- if (getDefaultMapping().getKey() != defaultMappingKey) {
- setDefaultMapping(createDefaultJavaAttributeMapping(persistentAttributeResource));
- }
- else {
- getDefaultMapping().update(persistentAttributeResource);
- }
- }
-
- protected String javaMappingAnnotationName(JavaResourcePersistentAttribute persistentAttributeResource) {
- Annotation mappingAnnotation = (Annotation) persistentAttributeResource.mappingAnnotation();
- if (mappingAnnotation != null) {
- return mappingAnnotation.getAnnotationName();
- }
- return null;
- }
-
- protected JavaAttributeMapping createJavaAttributeMappingFromMappingKey(String key) {
- if (key == MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY) {
- return null;
- }
- return jpaPlatform().buildJavaAttributeMappingFromMappingKey(key, this);
- }
-
- protected JavaAttributeMapping createJavaAttributeMappingFromAnnotation(String annotationName, JavaResourcePersistentAttribute persistentAttributeResource) {
- if (annotationName == null) {
- return null;
- }
- JavaAttributeMapping mapping = jpaPlatform().buildJavaAttributeMappingFromAnnotation(annotationName, this);
- mapping.initializeFromResource(persistentAttributeResource);
- return mapping;
- }
-
- protected JavaAttributeMapping createDefaultJavaAttributeMapping(JavaResourcePersistentAttribute persistentAttributeResource) {
- JavaAttributeMapping defaultMapping = jpaPlatform().buildDefaultJavaAttributeMapping(this);
- defaultMapping.initializeFromResource(persistentAttributeResource);
- return defaultMapping;
- }
-
- /**
- * the mapping might be "default", but it still might be a "null" mapping...
- */
- public boolean mappingIsDefault() {
- return this.specifiedMapping == null;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return this.getMapping().javaCompletionProposals(pos, filter, astRoot);
- }
-
- //************* Validation ******************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- if (this.specifiedMapping != null) {
- this.specifiedMapping.addToMessages(messages, astRoot);
- }
- else if (this.defaultMapping != null) {
- this.defaultMapping.addToMessages(messages, astRoot);
- }
-
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java
deleted file mode 100644
index 4543e58d58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPersistentType.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-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;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaPersistentType extends AbstractJavaJpaContextNode implements JavaPersistentType
-{
- protected String name;
-
- protected JavaTypeMapping mapping;
-
- protected final List<JavaPersistentAttribute> attributes;
-
- protected AccessType access;
-
- protected PersistentType parentPersistentType;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
- public GenericJavaPersistentType(JpaContextNode parent, JavaResourcePersistentType resourcePersistentType) {
- super(parent);
- this.attributes = new ArrayList<JavaPersistentAttribute>();
- this.initialize(resourcePersistentType);
- }
-
- @Override
- public IResource resource() {
- return this.resourcePersistentType.resourceModel().resource().getCompilationUnit().getResource();
- }
-
- //****************** JpaStructureNode implementation *******************
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- //****************** PersistentType implementation *******************
- public String getName() {
- return this.name;
- }
-
- protected void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public JavaTypeMapping getMapping() {
- return this.mapping;
- }
-
- public String mappingKey() {
- return getMapping().getKey();
- }
-
- public void setMappingKey(String key) {
- if (key == getMapping().getKey()) {
- return;
- }
- JavaTypeMapping oldMapping = getMapping();
- JavaTypeMapping newMapping = createJavaTypeMappingFromMappingKey(key);
-
- this.mapping = newMapping;
- this.resourcePersistentType.setMappingAnnotation(newMapping.annotationName());
- firePropertyChanged(PersistentType.MAPPING_PROPERTY, oldMapping, newMapping);
-
- if (oldMapping != null) {
- Collection<String> annotationsToRemove = CollectionTools.collection(oldMapping.correspondingAnnotationNames());
- if (getMapping() != null) {
- CollectionTools.removeAll(annotationsToRemove, getMapping().correspondingAnnotationNames());
- }
-
- for (String annotationName : annotationsToRemove) {
- this.resourcePersistentType.removeAnnotation(annotationName);
- }
- }
- }
-
- protected void setMapping(JavaTypeMapping newMapping) {
- JavaTypeMapping oldMapping = this.mapping;
- this.mapping = newMapping;
- firePropertyChanged(PersistentType.MAPPING_PROPERTY, oldMapping, newMapping);
- }
-
- public boolean isMapped() {
- return getMapping().isMapped();
- }
-
- public AccessType access() {
- return this.access;
- }
-
- protected void setAccess(AccessType newAccess) {
- AccessType oldAccess = this.access;
- this.access = newAccess;
- firePropertyChanged(PersistentType.ACCESS_PROPERTY, oldAccess, newAccess);
- }
-
- protected Iterator<JavaPersistentAttribute> attributesNamed(final String attributeName) {
- return new FilteringIterator<JavaPersistentAttribute, JavaPersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return attributeName.equals(o.getName());
- }
- };
- }
-
- public JavaPersistentAttribute attributeNamed(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = attributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = attributesNamed(attributeName);
- if (stream.hasNext()) {
- JavaPersistentAttribute attribute = stream.next();
- return (stream.hasNext()) ? null /*more than one*/: attribute;
- }
- return (parentPersistentType() == null) ? null : parentPersistentType().resolveAttribute(attributeName);
- }
-
- public ListIterator<JavaPersistentAttribute> attributes() {
- return new CloneListIterator<JavaPersistentAttribute>(this.attributes);
- }
-
- public int attributesSize() {
- return this.attributes.size();
- }
-
- private void addAttribute(JavaPersistentAttribute attribute) {
- addItemToList(attribute, this.attributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- private void removeAttribute(JavaPersistentAttribute attribute) {
- removeItemFromList(attribute, this.attributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- public Iterator<String> attributeNames() {
- return this.attributeNames(this.attributes());
- }
-
- protected Iterator<String> attributeNames(Iterator<? extends PersistentAttribute> attrs) {
- return new TransformationIterator<PersistentAttribute, String>(attrs) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allAttributes() {
- return new CompositeIterator<PersistentAttribute>(new TransformationIterator<PersistentType, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(PersistentType pt) {
- return pt.attributes();
- }
- });
- }
-
- public Iterator<String> allAttributeNames() {
- return this.attributeNames(this.allAttributes());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- Iterator<String> values = this.mapping.javaCompletionProposals(pos, filter, astRoot);
- if (values != null) {
- return values;
- }
- for (Iterator<JavaPersistentAttribute> stream = attributes(); stream.hasNext();) {
- values = stream.next().javaCompletionProposals(pos, filter, astRoot);
- if (values != null) {
- return values;
- }
- }
- return EmptyIterator.instance();
- }
-
- public JpaStructureNode structureNode(int offset) {
- //TODO astRoot, possibly get this instead of rebuilding it
- CompilationUnit astRoot = this.resourcePersistentType.getMember().astRoot();
-
- for (Iterator<JavaPersistentAttribute> i = attributes(); i.hasNext();) {
- JavaPersistentAttribute persistentAttribute = i.next();
- if (persistentAttribute.contains(offset, astRoot)) {
- return persistentAttribute;
- }
- }
-
- return this;
- }
-
- public boolean contains(int offset, CompilationUnit astRoot) {
- TextRange fullTextRange = this.fullTextRange(astRoot);
- if (fullTextRange == null) {
- //This happens if the attribute no longer exists in the java.
- //The text selection event is fired before the update from java so our
- //model has not yet had a chance to update appropriately. The list of
- //JavaPersistentAttriubtes is stale at this point. For now, we are trying
- //to avoid the NPE, not sure of the ultimate solution to these 2 threads accessing
- //our model
- return false;
- }
- return fullTextRange.includes(offset);
- }
-
-
- public TextRange fullTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.textRange(astRoot);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return this.selectionTextRange(astRoot);
- }
-
- public TextRange selectionTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.nameTextRange(astRoot);
- }
-
- public TextRange selectionTextRange() {
- return this.selectionTextRange(this.resourcePersistentType.getMember().astRoot());
- }
-
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.parentPersistentType();
- }
- };
- }
-
- public PersistentType parentPersistentType() {
- return this.parentPersistentType;
- }
-
- public boolean hasAnyAttributeMappingAnnotations() {
- if (this.resourcePersistentType.hasAnyAttributeAnnotations()) {
- return true;
- }
- return false;
- }
-
- // ******************** Updating **********************
- protected void initialize(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- this.parentPersistentType = this.parentPersistentType(resourcePersistentType);
- this.access = this.access(resourcePersistentType);
- this.name = this.name(resourcePersistentType);
- this.initializeMapping(resourcePersistentType);
- this.initializePersistentAttributes(resourcePersistentType);
- }
-
- protected void initializeMapping(JavaResourcePersistentType persistentTypeResource) {
- this.mapping = jpaPlatform().buildJavaTypeMappingFromAnnotation(this.javaMappingAnnotationName(persistentTypeResource), this);
- this.mapping.initializeFromResource(persistentTypeResource);
- }
-
- protected void initializePersistentAttributes(JavaResourcePersistentType persistentTypeResource) {
- Iterator<JavaResourcePersistentAttribute> resourceAttributes = persistentTypeResource.fields();
- if (access() == AccessType.PROPERTY) {
- resourceAttributes = persistentTypeResource.properties();
- }
-
- while (resourceAttributes.hasNext()) {
- this.attributes.add(createAttribute(resourceAttributes.next()));
- }
- }
-
- public void update(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- this.resourcePersistentType.resourceModel().addRootStructureNode(this);
- updateParentPersistentType(resourcePersistentType);
- updateAccess(resourcePersistentType);
- updateName(resourcePersistentType);
- updateMapping(resourcePersistentType);
- updatePersistentAttributes(resourcePersistentType);
- }
-
- protected void updateAccess(JavaResourcePersistentType resourcePersistentType) {
- this.setAccess(this.access(resourcePersistentType));
- }
-
- /**
- * Check the access "specified" by the java resource model.
- * Check xml mapping specified access first
- * If still null check java annotations if the xml is not metadata-complete = true
- * If still null then set to parentPersistentType access.
- * If still null check entity-mappings specified access setting if this persistent-type is listed in an orm.xml file
- * If still null check the persistence-unit default Access
- * Default to FIELD if all else fails.
- */
- protected AccessType access(JavaResourcePersistentType resourcePersistentType) {
- AccessType javaAccess = null;
- boolean metadataComplete = false;
- if (ormPersistentType() != null) {
- javaAccess = ormPersistentType().getMapping().getSpecifiedAccess();
- metadataComplete = ormPersistentType().getMapping().isMetadataComplete();
- }
- if (javaAccess == null && !metadataComplete) {
- javaAccess = AccessType.fromJavaResourceModel(resourcePersistentType.getAccess());
- }
- if (javaAccess == null) {
- if (parentPersistentType() != null) {
- javaAccess = parentPersistentType().access();
- }
- }
- if (javaAccess == null) {
- if (entityMappings() != null) {
- javaAccess = entityMappings().getAccess();
- }
- }
- if (javaAccess == null) {
- //have to check persistence-unit separately in the case where it is not listed directly in an orm.xml
- //if it is listed in an orm.xml then the entityMappings().getAccess() check will cover persistence-unit.defaultAccess
- if (persistenceUnit() != null) {
- javaAccess = persistenceUnit().getDefaultAccess();
- }
- }
- if (javaAccess == null) {
- javaAccess = AccessType.FIELD;
- }
- return javaAccess;
- }
-
- protected void updateName(JavaResourcePersistentType resourcePersistentType) {
- this.setName(this.name(resourcePersistentType));
- }
-
- protected String name(JavaResourcePersistentType resourcePersistentType) {
- return resourcePersistentType.getQualifiedName();
- }
-
- protected void updateMapping(JavaResourcePersistentType resourcePersistentType) {
- String javaMappingAnnotationName = this.javaMappingAnnotationName(resourcePersistentType);
- if (getMapping().annotationName() != javaMappingAnnotationName) {
- setMapping(createJavaTypeMappingFromAnnotation(javaMappingAnnotationName, resourcePersistentType));
- }
- else {
- getMapping().update(resourcePersistentType);
- }
- }
-
- protected JavaTypeMapping createJavaTypeMappingFromMappingKey(String key) {
- return jpaPlatform().buildJavaTypeMappingFromMappingKey(key, this);
- }
-
- protected JavaTypeMapping createJavaTypeMappingFromAnnotation(String annotationName, JavaResourcePersistentType resourcePersistentType) {
- JavaTypeMapping mapping = jpaPlatform().buildJavaTypeMappingFromAnnotation(annotationName, this);
- mapping.initializeFromResource(resourcePersistentType);
- return mapping;
- }
-
- protected String javaMappingAnnotationName(JavaResourcePersistentType resourcePersistentType) {
- Annotation mappingAnnotation = (Annotation) resourcePersistentType.mappingAnnotation();
- if (mappingAnnotation != null) {
- return mappingAnnotation.getAnnotationName();
- }
- return null;
- }
-
- protected void updatePersistentAttributes(JavaResourcePersistentType resourcePersistentType) {
- ListIterator<JavaPersistentAttribute> contextAttributes = attributes();
- Iterator<JavaResourcePersistentAttribute> resourceAttributes = resourcePersistentType.fields();
- if (access() == AccessType.PROPERTY) {
- resourceAttributes = resourcePersistentType.properties();
- }
-
- while (contextAttributes.hasNext()) {
- JavaPersistentAttribute persistentAttribute = contextAttributes.next();
- if (resourceAttributes.hasNext()) {
- persistentAttribute.update(resourceAttributes.next());
- }
- else {
- removeAttribute(persistentAttribute);
- }
- }
-
- while (resourceAttributes.hasNext()) {
- addAttribute(createAttribute(resourceAttributes.next()));
- }
- }
-
- protected JavaPersistentAttribute createAttribute(JavaResourcePersistentAttribute persistentAttributeResource) {
- JavaPersistentAttribute javaPersistentAttribute = jpaFactory().buildJavaPersistentAttribute(this);
- javaPersistentAttribute.initializeFromResource(persistentAttributeResource);
- return javaPersistentAttribute;
- }
-
- public void updateParentPersistentType(JavaResourcePersistentType persistentTypeResource) {
- //TODO do we need any change notification for this?
- this.parentPersistentType = parentPersistentType(persistentTypeResource);
- }
-
- protected PersistentType parentPersistentType(JavaResourcePersistentType persistentTypeResource) {
- return parentPersistentType(persistentTypeResource.getSuperClassQualifiedName());
- }
-
- protected PersistentType parentPersistentType(String fullyQualifiedTypeName) {
- PersistentType possibleParent = possibleParent(fullyQualifiedTypeName);
- if (possibleParent == null) {
- return null;
- }
- if (possibleParent.isMapped()) {
- return possibleParent;
- }
- return possibleParent.parentPersistentType();
- }
-
- /**
- * JPA spec supports the case where there are non-persistent types in the hierarchy
- * This will check for a PersistentType with the given name in this PersistenceUnit.
- * If it is not found then find the JavaPersistentTypeResource and look for its parent type
- */
- protected PersistentType possibleParent(String fullyQualifiedTypeName) {
- PersistentType possibleParent = persistentType(fullyQualifiedTypeName);
- if (possibleParent != null) {
- return possibleParent;
- }
- JavaResourcePersistentType resourcePersistentType = jpaProject().javaPersistentTypeResource(fullyQualifiedTypeName);
- if (resourcePersistentType != null) {
- return possibleParent(resourcePersistentType.getSuperClassQualifiedName());
- }
- return null;
- }
-
- protected PersistentType persistentType(String fullyQualifiedTypeName) {
- return persistenceUnit().persistentType(fullyQualifiedTypeName);
- }
-
- //*************** Validation ******************************************
- public void addToMessages(List<IMessage> messages) {
- //get astRoot here to pass down
- addToMessages(messages, this.resourcePersistentType.getMember().astRoot());
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- this.mapping.addToMessages(messages, astRoot);
- addAttributeMessages(messages, astRoot);
- }
-
- protected void addAttributeMessages(List<IMessage> messages, CompilationUnit astRoot) {
- for (JavaPersistentAttribute attributeContext : this.attributes) {
- attributeContext.addToMessages(messages, astRoot);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java
deleted file mode 100644
index 0d2edc34c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaAbstractJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public class GenericJavaPrimaryKeyJoinColumn extends AbstractJavaNamedColumn<PrimaryKeyJoinColumnAnnotation>
- implements JavaPrimaryKeyJoinColumn
-{
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumnResource;
-
- public GenericJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaAbstractJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initializeFromResource(PrimaryKeyJoinColumnAnnotation column) {
- this.primaryKeyJoinColumnResource = column;
- super.initializeFromResource(column);
- this.specifiedReferencedColumnName = this.specifiedReferencedColumnName(column);
- this.defaultReferencedColumnName = this.defaultReferencedColumnName();
- }
-
- //************** JavaNamedColumn implementation ***************
- @Override
- public JavaAbstractJoinColumn.Owner owner() {
- return (JavaAbstractJoinColumn.Owner) super.owner();
- }
-
- @Override
- protected PrimaryKeyJoinColumnAnnotation columnResource() {
- return this.primaryKeyJoinColumnResource;
- }
-
- //************** IAbstractJoinColumn implementation ***************
-
- public String getReferencedColumnName() {
- return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName;
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- columnResource().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- @Override
- protected String tableName() {
- return this.owner().typeMapping().tableName();
- }
-
- public Column dbReferencedColumn() {
- Table table = this.dbReferencedColumnTable();
- return (table == null) ? null : table.columnNamed(this.getReferencedColumnName());
- }
-
- public Table dbReferencedColumnTable() {
- return owner().dbReferencedColumnTable();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.columnResource().referencedColumnNameTouches(pos, astRoot);
- }
-
- private Iterator<String> candidateReferencedColumnNames() {
- Table table = this.owner().dbReferencedColumnTable();
- return (table != null) ? table.columnNames() : EmptyIterator.<String> instance();
- }
-
- private Iterator<String> candidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterator<String, String>(this.candidateReferencedColumnNames(), filter);
- }
-
- private Iterator<String> quotedCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.quote(this.candidateReferencedColumnNames(filter));
- }
-
- @Override
- public Iterator<String> connectedCandidateValuesFor(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedCandidateValuesFor(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.referencedColumnNameTouches(pos, astRoot)) {
- return this.quotedCandidateReferencedColumnNames(filter);
- }
- return null;
- }
-
- public boolean isReferencedColumnResolved() {
- return dbReferencedColumn() != null;
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.columnResource().referencedColumnNameTextRange(astRoot);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- TextRange textRange = columnResource().textRange(astRoot);
- return (textRange != null) ? textRange : this.owner().validationTextRange(astRoot);
- }
-
- @Override
- public void update(PrimaryKeyJoinColumnAnnotation column) {
- this.primaryKeyJoinColumnResource = column;
- super.update(column);
- this.setSpecifiedReferencedColumnName_(this.specifiedReferencedColumnName(column));
- this.setDefaultReferencedColumnName(this.defaultReferencedColumnName());
- }
-
- protected String specifiedReferencedColumnName(PrimaryKeyJoinColumnAnnotation column) {
- return column.getReferencedColumnName();
- }
-
- //TODO not correct when we start supporting primaryKeyJoinColumns in 1-1 mappings
- protected String defaultReferencedColumnName() {
- return defaultName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.java
deleted file mode 100644
index 14665cbedc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaQueryHint.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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-
-public class GenericJavaQueryHint extends AbstractJavaJpaContextNode implements JavaQueryHint
-{
- protected String name;
-
- protected String value;
-
- protected QueryHintAnnotation queryHint;
-
- public GenericJavaQueryHint(JavaQuery parent) {
- super(parent);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.queryHint.setName(newName);
- firePropertyChanged(QueryHint.NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.queryHint.setValue(newValue);
- firePropertyChanged(QueryHint.VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- public void initializeFromResource(QueryHintAnnotation queryHint) {
- this.queryHint = queryHint;
- this.name = queryHint.getName();
- this.value = queryHint.getValue();
- }
-
- public void update(QueryHintAnnotation queryHint) {
- this.queryHint = queryHint;
- this.setName(queryHint.getName());
- this.setValue(queryHint.getValue());
- }
-
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java
deleted file mode 100644
index b19ac134a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSecondaryTable.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAbstractJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-public class GenericJavaSecondaryTable extends AbstractJavaTable
- implements JavaSecondaryTable
-{
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected SecondaryTableAnnotation secondaryTableResource;
-
- public GenericJavaSecondaryTable(JavaEntity parent) {
- super(parent);
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- }
-
- @Override
- public JavaEntity parent() {
- return (JavaEntity) super.parent();
- }
-
- //***************** AbstractJavaTable implementation ********************
-
- @Override
- protected String annotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected SecondaryTableAnnotation tableResource() {
- return this.secondaryTableResource;
- }
-
- @Override
- protected String defaultName() {
- return null;
- }
-
- //***************** ISecondaryTable implementation ********************
-
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumns() : this.defaultPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- return this.defaultPrimaryKeyJoinColumn;
- }
-
- protected void setDefaultPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn newPkJoinColumn) {
- JavaPrimaryKeyJoinColumn oldPkJoinColumn = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = newPkJoinColumn;
- firePropertyChanged(SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldPkJoinColumn, newPkJoinColumn);
- }
-
- protected ListIterator<JavaPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- if (this.defaultPrimaryKeyJoinColumn != null) {
- return new SingleElementListIterator<JavaPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultPrimaryKeyJoinColumnsSize() {
- return (this.defaultPrimaryKeyJoinColumn == null) ? 0 : 1;
- }
-
- public JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn oldDefaultPkJoinColumn = this.getDefaultPrimaryKeyJoinColumn();
- if (oldDefaultPkJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultPrimaryKeyJoinColumn = null;
- }
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = this.secondaryTableResource.addPkJoinColumn(index);
- primaryKeyJoinColumn.initializeFromResource(pkJoinColumnResource);
- this.fireItemAdded(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return primaryKeyJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn joinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultPrimaryKeyJoinColumn = createPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumn(this.secondaryTableResource));
- }
- this.secondaryTableResource.removePkJoinColumn(index);
- fireItemRemoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (this.defaultPrimaryKeyJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, null, this.defaultPrimaryKeyJoinColumn);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.secondaryTableResource.movePkJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public JavaEntity javaEntity() {
- return parent();
- }
-
-
- //********************* updating ************************
-
- public void initializeFromResource(SecondaryTableAnnotation secondaryTable) {
- super.initializeFromResource(secondaryTable);
- this.secondaryTableResource = secondaryTable;
- this.initializeSpecifiedPrimaryKeyJoinColumns(secondaryTable);
- this.initializeDefaultPrimaryKeyJoinColumn(secondaryTable);
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns(SecondaryTableAnnotation secondaryTable) {
- ListIterator<PrimaryKeyJoinColumnAnnotation> annotations = secondaryTable.pkJoinColumns();
-
- while(annotations.hasNext()) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initializeFromResource(annotations.next());
- this.specifiedPrimaryKeyJoinColumns.add(primaryKeyJoinColumn);
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn(SecondaryTableAnnotation secondaryTable) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = this.jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.defaultPrimaryKeyJoinColumn.initializeFromResource(new NullPrimaryKeyJoinColumn(secondaryTable));
- }
-
-
- public void update(SecondaryTableAnnotation secondaryTableResource) {
- this.secondaryTableResource = secondaryTableResource;
- super.update(secondaryTableResource);
- this.updateSpecifiedPrimaryKeyJoinColumns(secondaryTableResource);
- this.updateDefaultPrimaryKeyJoinColumn(secondaryTableResource);
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(SecondaryTableAnnotation secondaryTableResource) {
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<PrimaryKeyJoinColumnAnnotation> resourcePrimaryKeyJoinColumns = secondaryTableResource.pkJoinColumns();
-
- while (primaryKeyJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update(resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(specifiedPrimaryKeyJoinColumnsSize(), createPrimaryKeyJoinColumn(resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn(SecondaryTableAnnotation secondaryTableResource) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- JavaPrimaryKeyJoinColumn joinColumn = this.jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- joinColumn.initializeFromResource(new NullPrimaryKeyJoinColumn(secondaryTableResource));
- this.setDefaultPrimaryKeyJoinColumn(joinColumn);
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumn(secondaryTableResource));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumnResource) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildJavaPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initializeFromResource(primaryKeyJoinColumnResource);
- return primaryKeyJoinColumn;
- }
-
- protected JavaAbstractJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
-
- //********************* code completion ************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaPrimaryKeyJoinColumn column : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- class PrimaryKeyJoinColumnOwner implements JavaAbstractJoinColumn.Owner
- {
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return GenericJavaSecondaryTable.this.validationTextRange(astRoot);
- }
-
- public TypeMapping typeMapping() {
- return GenericJavaSecondaryTable.this.javaEntity();
- }
-
- public Table dbTable(String tableName) {
- return GenericJavaSecondaryTable.this.dbTable();
- }
-
- public Table dbReferencedColumnTable() {
- return typeMapping().primaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericJavaSecondaryTable.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericJavaSecondaryTable.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String defaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return javaEntity().primaryKeyColumnName();
-
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java
deleted file mode 100644
index 75bc5d129c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaSequenceGenerator.java
+++ /dev/null
@@ -1,75 +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.internal.context.java;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-
-
-public class GenericJavaSequenceGenerator extends AbstractJavaGenerator
- implements JavaSequenceGenerator
-{
- protected String specifiedSequenceName;
-
- public GenericJavaSequenceGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected SequenceGeneratorAnnotation generatorResource() {
- return (SequenceGeneratorAnnotation) super.generatorResource();
- }
-
- public void initializeFromResource(SequenceGeneratorAnnotation sequenceGenerator) {
- super.initializeFromResource(sequenceGenerator);
- this.specifiedSequenceName = this.specifiedSequenceName(sequenceGenerator);
- }
-
- public Integer getDefaultInitialValue() {
- return SequenceGenerator.DEFAULT_INITIAL_VALUE;
- }
-
- public String getSequenceName() {
- return (this.getSpecifiedSequenceName() == null) ? getDefaultSequenceName() : this.getSpecifiedSequenceName();
- }
-
- public String getSpecifiedSequenceName() {
- return this.specifiedSequenceName;
- }
-
- public void setSpecifiedSequenceName(String newSpecifiedSequenceName) {
- String oldSpecifiedSequenceName = this.specifiedSequenceName;
- this.specifiedSequenceName = newSpecifiedSequenceName;
- generatorResource().setSequenceName(newSpecifiedSequenceName);
- firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, oldSpecifiedSequenceName, newSpecifiedSequenceName);
- }
-
- protected void setSpecifiedSequenceName_(String newSpecifiedSequenceName) {
- String oldSpecifiedSequenceName = this.specifiedSequenceName;
- this.specifiedSequenceName = newSpecifiedSequenceName;
- firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, oldSpecifiedSequenceName, newSpecifiedSequenceName);
- }
-
- public String getDefaultSequenceName() {
- return null;
- }
-
- public void update(SequenceGeneratorAnnotation sequenceGenerator) {
- super.update(sequenceGenerator);
- this.setSpecifiedSequenceName_(this.specifiedSequenceName(sequenceGenerator));
- }
-
- protected String specifiedSequenceName(SequenceGeneratorAnnotation generatorResource) {
- return generatorResource.getSequenceName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.java
deleted file mode 100644
index f6d1d4460f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTable.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-
-public class GenericJavaTable extends AbstractJavaTable implements JavaTable
-{
- protected JavaResourcePersistentMember persistentResource;
-
- public GenericJavaTable(JavaEntity parent) {
- super(parent);
- }
-
- public void initializeFromResource(JavaResourcePersistentMember persistentResource) {
- this.persistentResource = persistentResource;
- initializeFromResource(tableResource());
- }
-
-
- //query for the table resource every time on setters.
- //call one setter and the tableResource could change.
- //You could call more than one setter before this object has received any notification
- //from the java resource model
- @Override
- protected TableAnnotation tableResource() {
- //TODO get the NullTable from the resource model or build it here in the context model??
- return (TableAnnotation) this.persistentResource.nonNullAnnotation(annotationName());
- }
-
- @Override
- protected String annotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaEntity parent() {
- return (JavaEntity) super.parent();
- }
-
- protected JavaEntity javaEntity() {
- return parent();
- }
-
- protected Entity rootEntity() {
- return javaEntity().rootEntity();
- }
-
- @Override
- /**
- * Table name default to the owning java entity name.
- * If this entity is part of a single table inheritance hierarchy, table
- * name defaults to the root entity's table name.
- */
- protected String defaultName() {
- if (javaEntity().getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- if (rootEntity() != javaEntity()) {
- return rootEntity().getTable().getName();
- }
- }
- return javaEntity().getName();
- }
-
- @Override
- protected String defaultSchema() {
- if (javaEntity().getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- if (rootEntity() != javaEntity()) {
- return rootEntity().getTable().getSchema();
- }
- }
- return super.defaultSchema();
- }
-
- @Override
- protected String defaultCatalog() {
- if (javaEntity().getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- if (rootEntity() != javaEntity()) {
- return rootEntity().getTable().getCatalog();
- }
- }
- return super.defaultCatalog();
- }
-
-// @Override
-// protected JavaUniqueConstraint createJavaUniqueConstraint(int index) {
-// return JavaUniqueConstraint.createTableUniqueConstraint(new UniqueConstraintOwner(this), this.getMember(), index);
-// }
-
-
- public void update(JavaResourcePersistentMember persistentResource) {
- this.persistentResource = persistentResource;
- this.update(tableResource());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java
deleted file mode 100644
index 318a319af4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTableGenerator.java
+++ /dev/null
@@ -1,340 +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.internal.context.java;
-
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-
-public class GenericJavaTableGenerator extends AbstractJavaGenerator
- implements JavaTableGenerator
-{
-
- protected String specifiedTable;
-
- protected String defaultTable;
-
- protected String specifiedCatalog;
-
- protected String defaultCatalog;
-
- protected String specifiedSchema;
-
- protected String defaultSchema;
-
- protected String specifiedPkColumnName;
-
- protected String defaultPkColumnName;
-
- protected String specifiedValueColumnName;
-
- protected String defaultValueColumnName;
-
- protected String specifiedPkColumnValue;
-
- protected String defaultPkColumnValue;
-
-// protected EList<IUniqueConstraint> uniqueConstraints;
-
- public GenericJavaTableGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected TableGeneratorAnnotation generatorResource() {
- return (TableGeneratorAnnotation) super.generatorResource();
- }
-
- public void initializeFromResource(TableGeneratorAnnotation tableGenerator) {
- super.initializeFromResource(tableGenerator);
- this.specifiedTable = this.specifiedTable(tableGenerator);
- this.specifiedCatalog = this.specifiedCatalog(tableGenerator);
- this.specifiedSchema = this.specifiedSchema(tableGenerator);
- this.specifiedPkColumnName = this.specifiedPkColumnName(tableGenerator);
- this.specifiedValueColumnName = this.specifiedValueColumnName(tableGenerator);
- this.specifiedPkColumnValue = this.specifiedPkColumnValue(tableGenerator);
- //this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- public Integer getDefaultInitialValue() {
- return TableGenerator.DEFAULT_INITIAL_VALUE;
- }
-
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- generatorResource().setTable(newSpecifiedTable);
- firePropertyChanged(SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- public String getCatalog() {
- return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog();
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- generatorResource().setCatalog(newSpecifiedCatalog);
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- protected void setSpecifiedCatalog_(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- public String getSchema() {
- return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema();
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- generatorResource().setSchema(newSpecifiedSchema);
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- protected void setSpecifiedSchema_(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, oldDefaultSchema, newDefaultSchema);
- }
-
- public String getPkColumnName() {
- return (this.getSpecifiedPkColumnName() == null) ? getDefaultPkColumnName() : this.getSpecifiedPkColumnName();
- }
-
- public String getSpecifiedPkColumnName() {
- return this.specifiedPkColumnName;
- }
-
- public void setSpecifiedPkColumnName(String newSpecifiedPkColumnName) {
- String oldSpecifiedPkColumnName = this.specifiedPkColumnName;
- this.specifiedPkColumnName = newSpecifiedPkColumnName;
- generatorResource().setPkColumnName(newSpecifiedPkColumnName);
- firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, oldSpecifiedPkColumnName, newSpecifiedPkColumnName);
- }
-
- protected void setSpecifiedPkColumnName_(String newSpecifiedPkColumnName) {
- String oldSpecifiedPkColumnName = this.specifiedPkColumnName;
- this.specifiedPkColumnName = newSpecifiedPkColumnName;
- firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, oldSpecifiedPkColumnName, newSpecifiedPkColumnName);
- }
-
- public String getDefaultPkColumnName() {
- return this.defaultPkColumnName;
- }
-
- public String getValueColumnName() {
- return (this.getSpecifiedValueColumnName() == null) ? getDefaultValueColumnName() : this.getSpecifiedValueColumnName();
- }
-
- public String getSpecifiedValueColumnName() {
- return this.specifiedValueColumnName;
- }
-
- public void setSpecifiedValueColumnName(String newSpecifiedValueColumnName) {
- String oldSpecifiedValueColumnName = this.specifiedValueColumnName;
- this.specifiedValueColumnName = newSpecifiedValueColumnName;
- generatorResource().setValueColumnName(newSpecifiedValueColumnName);
- firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, oldSpecifiedValueColumnName, newSpecifiedValueColumnName);
- }
-
- protected void setSpecifiedValueColumnName_(String newSpecifiedValueColumnName) {
- String oldSpecifiedValueColumnName = this.specifiedValueColumnName;
- this.specifiedValueColumnName = newSpecifiedValueColumnName;
- firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, oldSpecifiedValueColumnName, newSpecifiedValueColumnName);
- }
-
- public String getDefaultValueColumnName() {
- return this.defaultValueColumnName;
- }
-
- public String getPkColumnValue() {
- return (this.getSpecifiedPkColumnValue() == null) ? getDefaultPkColumnValue() : this.getSpecifiedPkColumnValue();
- }
-
- public String getSpecifiedPkColumnValue() {
- return this.specifiedPkColumnValue;
- }
-
- public void setSpecifiedPkColumnValue(String newSpecifiedPkColumnValue) {
- String oldSpecifiedPkColumnValue = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = newSpecifiedPkColumnValue;
- generatorResource().setPkColumnValue(newSpecifiedPkColumnValue);
- firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, oldSpecifiedPkColumnValue, newSpecifiedPkColumnValue);
- }
-
- public void setSpecifiedPkColumnValue_(String newSpecifiedPkColumnValue) {
- String oldSpecifiedPkColumnValue = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = newSpecifiedPkColumnValue;
- firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, oldSpecifiedPkColumnValue, newSpecifiedPkColumnValue);
- }
-
- public String getDefaultPkColumnValue() {
- return this.defaultPkColumnValue;
- }
-
-
-// public EList<IUniqueConstraint> getUniqueConstraints() {
-// if (uniqueConstraints == null) {
-// uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
-// }
-// return uniqueConstraints;
-// }
-
-
-
- // ********** java resource model -> context model model **********
- public void update(TableGeneratorAnnotation tableGenerator) {
- super.update(tableGenerator);
- this.setSpecifiedTable_(this.specifiedTable(tableGenerator));
- this.setSpecifiedCatalog_(this.specifiedCatalog(tableGenerator));
- this.setSpecifiedSchema_(this.specifiedSchema(tableGenerator));
- this.setSpecifiedPkColumnName_(this.specifiedPkColumnName(tableGenerator));
- this.setSpecifiedValueColumnName_(this.specifiedValueColumnName(tableGenerator));
- this.setSpecifiedPkColumnValue_(this.specifiedPkColumnValue(tableGenerator));
- //this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String specifiedTable(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getTable();
- }
-
- protected String specifiedCatalog(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getCatalog();
- }
-
- protected String specifiedSchema(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getSchema();
- }
-
- protected String specifiedPkColumnName(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getPkColumnName();
- }
-
- protected String specifiedValueColumnName(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getValueColumnName();
- }
-
- protected String specifiedPkColumnValue(TableGeneratorAnnotation tableGenerator) {
- return tableGenerator.getPkColumnValue();
- }
-
-
-// /**
-// * here we just worry about getting the unique constraints lists the same size;
-// * then we delegate to the unique constraints to synch themselves up
-// */
-// private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
-// // synchronize the model join columns with the Java source
-// List<IUniqueConstraint> constraints = this.getUniqueConstraints();
-// int persSize = constraints.size();
-// int javaSize = 0;
-// boolean allJavaAnnotationsFound = false;
-// for (int i = 0; i < persSize; i++) {
-// JavaUniqueConstraint uniqueConstraint = (JavaUniqueConstraint) constraints.get(i);
-// if (uniqueConstraint.annotation(astRoot) == null) {
-// allJavaAnnotationsFound = true;
-// break; // no need to go any further
-// }
-// uniqueConstraint.updateFromJava(astRoot);
-// javaSize++;
-// }
-// if (allJavaAnnotationsFound) {
-// // remove any model join columns beyond those that correspond to the Java annotations
-// while (persSize > javaSize) {
-// persSize--;
-// constraints.remove(persSize);
-// }
-// }
-// else {
-// // add new model join columns until they match the Java annotations
-// while (!allJavaAnnotationsFound) {
-// JavaUniqueConstraint uniqueConstraint = this.createJavaUniqueConstraint(javaSize);
-// if (uniqueConstraint.annotation(astRoot) == null) {
-// allJavaAnnotationsFound = true;
-// }
-// else {
-// this.getUniqueConstraints().add(uniqueConstraint);
-// uniqueConstraint.updateFromJava(astRoot);
-// javaSize++;
-// }
-// }
-// }
-// }
-//
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// setDefaultSchema((String) defaultsContext.getDefault(GenericJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY));
-// }
-//
-// public IUniqueConstraint createUniqueConstraint(int index) {
-// return createJavaUniqueConstraint(index);
-// }
-//
-// protected JavaUniqueConstraint createJavaUniqueConstraint(int index) {
-// return JavaUniqueConstraint.createTableGeneratorUniqueConstraint(new UniqueConstraintOwner(this), this.getMember(), index);
-// }
-
- public Table dbTable() {
- Schema schema = this.dbSchema();
- return (schema == null) ? null : schema.tableNamed(this.getTable());
- }
-
- public Schema dbSchema() {
- return this.database().schemaNamed(this.getSchema());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java
deleted file mode 100644
index 0920211a59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaTransientMapping.java
+++ /dev/null
@@ -1,47 +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.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.resource.java.Transient;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaTransientMapping extends AbstractJavaAttributeMapping
- implements JavaTransientMapping
-{
- public GenericJavaTransientMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Transient.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java
deleted file mode 100644
index bd9eda6a93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaVersionMapping.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Temporal;
-import org.eclipse.jpt.core.resource.java.Version;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaVersionMapping extends AbstractJavaAttributeMapping implements JavaVersionMapping
-{
- protected final JavaColumn column;
-
- protected TemporalType temporal;
-
- public GenericJavaVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = createJavaColumn();
- }
-
- protected JavaColumn createJavaColumn() {
- return jpaFactory().buildJavaColumn(this, this);
- }
-
- @Override
- public void initializeFromResource(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.initializeFromResource(persistentAttributeResource);
- this.column.initializeFromResource(this.columnResource());
- this.temporal = this.temporal(this.temporalResource());
- }
-
- protected Temporal temporalResource() {
- return (Temporal) this.persistentAttributeResource.nonNullAnnotation(Temporal.ANNOTATION_NAME);
- }
-
- public ColumnAnnotation columnResource() {
- return (ColumnAnnotation) this.persistentAttributeResource.nonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** IJavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Version.ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return new ArrayIterator<String>(
- JPA.COLUMN,
- JPA.TEMPORAL);
- }
-
- //************** INamedColumn.Owner implementation ***************
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- //************** IVersionMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.temporalResource().setValue(TemporalType.toJavaResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- @Override
- public void update(JavaResourcePersistentAttribute persistentAttributeResource) {
- super.update(persistentAttributeResource);
- this.column.update(this.columnResource());
- this.setTemporal(this.temporal(this.temporalResource()));
- }
-
- protected TemporalType temporal(Temporal temporal) {
- return TemporalType.fromJavaResourceModel(temporal.getValue());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- //*********** Validation ******************************
-
- @Override
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- super.addToMessages(messages, astRoot);
-
- addColumnMessages(messages, astRoot);
- }
-
- protected void addColumnMessages(List<IMessage> messages, CompilationUnit astRoot) {
- JavaColumn column = this.getColumn();
- String table = column.getTable();
- boolean doContinue = entityOwned() && column.isConnected();
-
- if (doContinue && this.typeMapping().tableNameIsInvalid(table)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {table, column.getName()},
- column, column.tableTextRange(astRoot))
- );
- doContinue = false;
- }
-
- if (doContinue && ! column.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName()},
- column, column.nameTextRange(astRoot))
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.java
deleted file mode 100644
index 99e4dcd3a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Basic;
-
-public class JavaBasicMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaBasicMappingProvider INSTANCE = new JavaBasicMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaBasicMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Basic.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaBasicMapping(parent);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourcePersistentAttribute().typeIsBasic();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java
deleted file mode 100644
index f79ff37f60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaCascade.java
+++ /dev/null
@@ -1,112 +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.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-
-public class JavaCascade extends AbstractJavaJpaContextNode implements Cascade
-{
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
- protected RelationshipMappingAnnotation relationshipMapping;
-
- protected JavaCascade(JavaRelationshipMapping parent) {
- super(parent);
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- this.relationshipMapping.setCascadeAll(newAll);
- firePropertyChanged(Cascade.ALL_PROPERTY, oldAll, newAll);
- }
-
- public boolean isPersist() {
- return this.persist;
- }
-
- public void setPersist(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- this.relationshipMapping.setCascadePersist(newPersist);
- firePropertyChanged(Cascade.PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- public boolean isMerge() {
- return this.merge;
- }
-
- public void setMerge(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- this.relationshipMapping.setCascadeMerge(newMerge);
- firePropertyChanged(Cascade.MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- public boolean isRemove() {
- return this.remove;
- }
-
- public void setRemove(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- this.relationshipMapping.setCascadeRemove(newRemove);
- firePropertyChanged(Cascade.REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- public boolean isRefresh() {
- return this.refresh;
- }
-
- public void setRefresh(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- this.relationshipMapping.setCascadeRefresh(newRefresh);
- firePropertyChanged(Cascade.REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- public TextRange validationTextRange(CompilationUnit astRoot) {
- return this.relationshipMapping.cascadeTextRange(astRoot);
- }
-
- public void initialize(RelationshipMappingAnnotation relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- this.all = relationshipMapping.isCascadeAll();
- this.persist = relationshipMapping.isCascadePersist();
- this.merge = relationshipMapping.isCascadeMerge();
- this.remove = relationshipMapping.isCascadeRemove();
- this.refresh = relationshipMapping.isCascadeRefresh();
- }
-
- public void update(RelationshipMappingAnnotation relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- this.setAll(relationshipMapping.isCascadeAll());
- this.setPersist(relationshipMapping.isCascadePersist());
- this.setMerge(relationshipMapping.isCascadeMerge());
- this.setRemove(relationshipMapping.isCascadeRemove());
- this.setRefresh(relationshipMapping.isCascadeRefresh());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.java
deleted file mode 100644
index 847ef62ca2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-
-public class JavaEmbeddableProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddableProvider INSTANCE = new JavaEmbeddableProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaEmbeddableProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEmbeddable buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaEmbeddable(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.java
deleted file mode 100644
index a5895c924b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.EmbeddedId;
-
-public class JavaEmbeddedIdMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddedIdMappingProvider INSTANCE = new JavaEmbeddedIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaEmbeddedIdMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return EmbeddedId.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaEmbeddedIdMapping(parent);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return GenericJavaEmbeddedMapping.embeddableFor(persistentAttribute) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.java
deleted file mode 100644
index 1c88e6cf1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Embedded;
-
-public class JavaEmbeddedMappingProvider
- implements DefaultJavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaEmbeddedMappingProvider INSTANCE = new JavaEmbeddedMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaEmbeddedMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Embedded.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaEmbeddedMapping(parent);
- }
-
- public boolean defaultApplies(JavaPersistentAttribute persistentAttribute) {
- return GenericJavaEmbeddedMapping.embeddableFor(persistentAttribute) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.java
deleted file mode 100644
index 7ac9c1bbca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-
-/**
- *
- */
-public class JavaEntityProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaEntityProvider INSTANCE = new JavaEntityProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaEntityProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEntity buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaEntity(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.java
deleted file mode 100644
index e91187f5cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Id;
-
-public class JavaIdMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaIdMappingProvider INSTANCE = new JavaIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaIdMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Id.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaIdMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.java
deleted file mode 100644
index 02c517dbb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToMany;
-
-public class JavaManyToManyMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaManyToManyMappingProvider INSTANCE = new JavaManyToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaManyToManyMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return ManyToMany.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaManyToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.java
deleted file mode 100644
index 1b178a561c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToOne;
-
-public class JavaManyToOneMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaManyToOneMappingProvider INSTANCE = new JavaManyToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaManyToOneMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return ManyToOne.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaManyToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.java
deleted file mode 100644
index 0fd9fff9d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-
-public class JavaMappedSuperclassProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaMappedSuperclassProvider INSTANCE = new JavaMappedSuperclassProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaMappedSuperclassProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
- public JavaMappedSuperclass buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaMappedSuperclass(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.java
deleted file mode 100644
index 14ac6e15ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullAttributeMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-/**
- * This mapping provider implementation is used to create a JavaNullAttributeMapping.
- * A JavaNullAttributeMapping should be used when no "mapping" annotation
- * exists on a Java attribute *and* no default mapping applies.
- */
-public class JavaNullAttributeMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaNullAttributeMappingProvider INSTANCE = new JavaNullAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaNullAttributeMappingProvider() {
- super();
- }
-
- public String key() {
- return null;
- }
-
- public String annotationName() {
- return null;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaNullAttributeMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java
deleted file mode 100644
index 9d4618bcfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class JavaNullTypeMapping extends AbstractJavaTypeMapping
-{
- public JavaNullTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- public String annotationName() {
- return null;
- }
-
- public String getKey() {
- return MappingKeys.NULL_TYPE_MAPPING_KEY;
- }
-
- public boolean isMapped() {
- return false;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- return EmptyIterator.instance();
- }
-
- public void addToMessages(List<IMessage> messages, CompilationUnit astRoot) {
- // no-op, nothing to really add
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.java
deleted file mode 100644
index cdfa70f090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-
-/**
- * This mapping provider implementation is used to create a JavaNullAttributeMapping.
- * A JavaNullAttributeMapping should be used when no "mapping" annotation
- * exists on a Java type.
- */
-public class JavaNullTypeMappingProvider
- implements JavaTypeMappingProvider
-{
-
- // singleton
- private static final JavaNullTypeMappingProvider INSTANCE = new JavaNullTypeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaNullTypeMappingProvider() {
- super();
- }
-
- public String key() {
- return null;
- }
-
- public String annotationName() {
- return null;
- }
-
- public JavaTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaNullTypeMapping(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.java
deleted file mode 100644
index f7920a492d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToMany;
-
-public class JavaOneToManyMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaOneToManyMappingProvider INSTANCE = new JavaOneToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaOneToManyMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return OneToMany.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaOneToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.java
deleted file mode 100644
index b9037cd1ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToOne;
-
-public class JavaOneToOneMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaOneToOneMappingProvider INSTANCE = new JavaOneToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaOneToOneMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return OneToOne.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaOneToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.java
deleted file mode 100644
index b9cf4faf51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Transient;
-
-public class JavaTransientMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaTransientMappingProvider INSTANCE = new JavaTransientMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaTransientMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Transient.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaTransientMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.java
deleted file mode 100644
index 5ced0cc831..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingProvider.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.Version;
-
-public class JavaVersionMappingProvider
- implements JavaAttributeMappingProvider
-{
-
- // singleton
- private static final JavaVersionMappingProvider INSTANCE = new JavaVersionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaVersionMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return Version.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaVersionMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java
deleted file mode 100644
index d0e58f29cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java
+++ /dev/null
@@ -1,334 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractOrmAttributeMapping<T extends XmlAttributeMapping> extends AbstractOrmJpaContextNode
- implements OrmAttributeMapping
-{
- protected String name;
-
- protected T attributeMapping;
-
- protected JavaPersistentAttribute javaPersistentAttribute;
-
- protected AbstractOrmAttributeMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public JavaPersistentAttribute getJavaPersistentAttribute() {
- return this.javaPersistentAttribute;
- }
-
- protected void setJavaPersistentAttribute(JavaPersistentAttribute newJavaPersistentAttribute) {
- JavaPersistentAttribute oldJavaPersistentAttribute = this.javaPersistentAttribute;
- this.javaPersistentAttribute = newJavaPersistentAttribute;
- firePropertyChanged(OrmAttributeMapping.JAVA_PERSISTENT_ATTRIBUTE_PROPERTY, oldJavaPersistentAttribute, newJavaPersistentAttribute);
-
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.attributeMapping.setName(newName);
- firePropertyChanged(OrmAttributeMapping.NAME_PROPERTY, oldName, newName);
- persistentAttribute().nameChanged(oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(OrmAttributeMapping.NAME_PROPERTY, oldName, newName);
- persistentAttribute().nameChanged(oldName, newName);
- }
-
- public OrmPersistentAttribute persistentAttribute() {
- return (OrmPersistentAttribute) parent();
- }
-
- public String attributeName() {
- return this.persistentAttribute().getName();
- }
-
- public boolean isDefault() {
- return false;
- }
-
- public void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping) {
- setName(oldMapping.getName());
- }
-
- public void initializeFromXmlColumnMapping(OrmColumnMapping oldMapping) {
- initializeFromOrmAttributeMapping((OrmAttributeMapping) oldMapping);
- }
-
- public void initializeFromXmlNonOwningMapping(NonOwningMapping oldMapping) {
- initializeFromOrmAttributeMapping((OrmAttributeMapping) oldMapping);
- }
-
- public void initializeFromOrmBasicMapping(OrmBasicMapping oldMapping) {
- initializeFromXmlColumnMapping(oldMapping);
- }
-
- public void initializeFromOrmIdMapping(OrmIdMapping oldMapping) {
- initializeFromXmlColumnMapping(oldMapping);
- }
-
- public void initializeFromOrmTransientMapping(OrmTransientMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmEmbeddedMapping(OrmEmbeddedMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmEmbeddedIdMapping(OrmEmbeddedIdMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmVersionMapping(OrmVersionMapping oldMapping) {
- initializeFromXmlColumnMapping(oldMapping);
- }
-
- public void initializeFromXmlRelationshipMapping(OrmRelationshipMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromXmlMulitRelationshipMapping(OrmMultiRelationshipMapping oldMapping) {
- initializeFromXmlRelationshipMapping(oldMapping);
- }
-
- public void initializeFromXmlSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- initializeFromXmlRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToManyMapping(OrmOneToManyMapping oldMapping) {
- initializeFromXmlNonOwningMapping(oldMapping);
- initializeFromXmlMulitRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToOneMapping(OrmManyToOneMapping oldMapping) {
- initializeFromXmlSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToOneMapping(OrmOneToOneMapping oldMapping) {
- initializeFromXmlNonOwningMapping(oldMapping);
- initializeFromXmlSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToManyMapping(OrmManyToManyMapping oldMapping) {
- initializeFromXmlNonOwningMapping(oldMapping);
- initializeFromXmlMulitRelationshipMapping(oldMapping);
- }
-
- public String primaryKeyColumnName() {
- return null;
- }
-
- public OrmTypeMapping typeMapping() {
- return this.persistentAttribute().typeMapping();
- }
-
-
- public boolean isOverridableAttributeMapping() {
- return false;
- }
-
- public boolean isOverridableAssociationMapping() {
- return false;
- }
-
- public boolean isIdMapping() {
- return false;
- }
-
- protected T attributeMapping() {
- return this.attributeMapping;
- }
-
- public void initialize(T attributeMapping) {
- this.attributeMapping = attributeMapping;
- this.name = attributeMapping.getName();
- this.javaPersistentAttribute = javaPersistentAttribute();
- }
-
- public void update(T attributeMapping) {
- this.attributeMapping = attributeMapping;
- this.setName_(attributeMapping.getName());
- this.setJavaPersistentAttribute(javaPersistentAttribute());
- }
-
- protected JavaPersistentAttribute javaPersistentAttribute() {
- JavaPersistentType javaPersistentType = persistentAttribute().persistentType().javaPersistentType();
- if (javaPersistentType != null && getName() != null) {
- return javaPersistentType.attributeNamed(getName());
- }
- return null;
- }
-
-
- protected boolean entityOwned() {
- return typeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public boolean contains(int textOffset) {
- return this.attributeMapping.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- return this.attributeMapping.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- return (this.persistentAttribute().isVirtual()) ? this.typeMapping().attributesTextRange() : this.attributeMapping.validationTextRange();
- }
-
- public TextRange nameTextRange() {
- return this.attributeMapping.nameTextRange();
- }
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addAttributeMessages(messages);
- addInvalidMappingMessage(messages);
- }
-
- protected void addAttributeMessages(List<IMessage> messages) {
- addUnspecifiedAttributeMessage(messages);
- addUnresolvedAttributeMessage(messages);
- addModifierMessages(messages);
- }
-
- protected void addUnspecifiedAttributeMessage(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(getName())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME,
- this,
- validationTextRange())
- );
- }
- }
-
- protected void addUnresolvedAttributeMessage(List<IMessage> messages) {
- if (! StringTools.stringIsEmpty(getName())
- && javaPersistentAttribute() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME,
- new String[] {getName(), persistentAttribute().persistentType().getMapping().getClass_()},
- this,
- nameTextRange())
- );
- }
- }
-
- protected void addModifierMessages(List<IMessage> messages) {
- if (getKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- return;
- }
-
- if (getJavaPersistentAttribute() == null) {
- return;
- }
- JavaResourcePersistentAttribute resourcePersistentAttribute = getJavaPersistentAttribute().getResourcePersistentAttribute();
- if (resourcePersistentAttribute== null) {
- return;
- }
-
- if (resourcePersistentAttribute.isForField()) {
- int flags;
- try {
- flags = resourcePersistentAttribute.getMember().getJdtMember().getFlags();
- } catch (JavaModelException jme) {
- /* no error to log, in that case */
- return;
- }
- //TODO validation : need to have a validation message for final methods as well.
- //From the JPA spec : No methods or persistent instance variables of the entity class may be final.
- if (Flags.isFinal(flags)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD,
- new String[] {getName()},
- persistentAttribute(),
- persistentAttribute().validationTextRange())
- );
- }
-
- if (Flags.isPublic(flags)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD,
- new String[] {getName()},
- persistentAttribute(),
- persistentAttribute().validationTextRange())
- );
-
- }
- }
- }
-
- //TODO validation message - i think more info is needed in this message. include type mapping type?
- protected void addInvalidMappingMessage(List<IMessage> messages) {
- if (! typeMapping().attributeMappingKeyAllowed(getKey())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING,
- new String[] {getName()},
- this,
- validationTextRange())
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmColumn.java
deleted file mode 100644
index 6b3ab287ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmColumn.java
+++ /dev/null
@@ -1,308 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractColumn;
-import org.eclipse.jpt.core.context.orm.OrmAbstractColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAbstractColumn;
-
-
-public abstract class AbstractOrmColumn<T extends XmlAbstractColumn> extends AbstractOrmNamedColumn<T>
- implements OrmAbstractColumn
-{
- protected String specifiedTable;
-
- protected String defaultTable;
-
- protected Boolean specifiedUnique;
-
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
- protected AbstractOrmColumn(OrmJpaContextNode parent, OrmAbstractColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initializeFrom(AbstractColumn oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedTable(oldColumn.getSpecifiedTable());
- setSpecifiedUnique(oldColumn.getSpecifiedUnique());
- setSpecifiedNullable(oldColumn.getSpecifiedNullable());
- setSpecifiedInsertable(oldColumn.getSpecifiedInsertable());
- setSpecifiedUpdatable(oldColumn.getSpecifiedUpdatable());
- }
-
- @Override
- public OrmAbstractColumn.Owner owner() {
- return (OrmAbstractColumn.Owner) super.owner();
- }
-
-// @Override
-// protected void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds) {
-// super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE);
-// }
-
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- if (oldSpecifiedTable != newSpecifiedTable) {
- if (this.columnResource() != null) {
- this.columnResource().setTable(newSpecifiedTable);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedTable != null) {
- addColumnResource();
- columnResource().setTable(newSpecifiedTable);
- }
- }
- firePropertyChanged(AbstractColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(AbstractColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String newDefaultTable) {
- String oldDefaultTable = this.defaultTable;
- this.defaultTable = newDefaultTable;
- firePropertyChanged(AbstractColumn.DEFAULT_TABLE_PROPERTY, oldDefaultTable, newDefaultTable);
- }
-
- public Boolean getUnique() {
- return (this.getSpecifiedUnique() == null) ? this.getDefaultUnique() : this.getSpecifiedUnique();
- }
-
- public Boolean getDefaultUnique() {
- return AbstractColumn.DEFAULT_UNIQUE;
- }
-
- public Boolean getSpecifiedUnique() {
- return this.specifiedUnique;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- if (oldSpecifiedUnique != newSpecifiedUnique) {
- if (this.columnResource() != null) {
- this.columnResource().setUnique(newSpecifiedUnique);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedUnique != null) {
- addColumnResource();
- columnResource().setUnique(newSpecifiedUnique);
- }
- }
- firePropertyChanged(AbstractColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- protected void setSpecifiedUnique_(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- firePropertyChanged(AbstractColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- public Boolean getNullable() {
- return (this.getSpecifiedNullable() == null) ? this.getDefaultNullable() : this.getSpecifiedNullable();
- }
-
- public Boolean getDefaultNullable() {
- return AbstractColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- if (oldSpecifiedNullable != newSpecifiedNullable) {
- if (this.columnResource() != null) {
- this.columnResource().setNullable(newSpecifiedNullable);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedNullable != null) {
- addColumnResource();
- columnResource().setNullable(newSpecifiedNullable);
- }
- }
- firePropertyChanged(AbstractColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(AbstractColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- public Boolean getInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.getDefaultInsertable() : this.getSpecifiedInsertable();
- }
-
- public Boolean getDefaultInsertable() {
- return AbstractColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- if (oldSpecifiedInsertable != newSpecifiedInsertable) {
- if (this.columnResource() != null) {
- this.columnResource().setInsertable(newSpecifiedInsertable);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedInsertable != null) {
- addColumnResource();
- columnResource().setInsertable(newSpecifiedInsertable);
- }
- }
- firePropertyChanged(AbstractColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(AbstractColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- public Boolean getUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.getDefaultUpdatable() : this.getSpecifiedUpdatable();
- }
-
- public Boolean getDefaultUpdatable() {
- return AbstractColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- if (oldSpecifiedUpdatable != newSpecifiedUpdatable) {
- if (this.columnResource() != null) {
- this.columnResource().setUpdatable(newSpecifiedUpdatable);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedUpdatable != null) {
- addColumnResource();
- columnResource().setUpdatable(newSpecifiedUpdatable);
- }
- }
- firePropertyChanged(AbstractColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(AbstractColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- @Override
- protected String tableName() {
- return this.getTable();
- }
-
-
- public TextRange tableTextRange() {
- if (columnResource() != null) {
- TextRange textRange = columnResource().tableTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return this.parent().validationTextRange();
- }
-
- @Override
- protected void initialize(T column) {
- super.initialize(column);
- this.specifiedTable = this.specifiedTable(column);
- this.defaultTable = this.defaultTable();
- //TODO default from java for all of these settings
- this.specifiedNullable = this.specifiedNullable(column);
- this.specifiedUpdatable = this.specifiedUpdatable(column);
- this.specifiedUnique = this.specifiedUnique(column);
- this.specifiedInsertable = this.specifiedInsertable(column);
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- setSpecifiedTable_(this.specifiedTable(column));
- setDefaultTable(this.defaultTable());
- setSpecifiedNullable_(this.specifiedNullable(column));
- setSpecifiedUpdatable_(this.specifiedUpdatable(column));
- setSpecifiedUnique_(this.specifiedUnique(column));
- setSpecifiedInsertable_(this.specifiedInsertable(column));
- }
-
- protected String specifiedTable(T column) {
- return column == null ? null : column.getTable();
- }
-
- protected Boolean specifiedNullable(T column) {
- return column == null ? null : column.getNullable();
- }
-
- protected Boolean specifiedUpdatable(T column) {
- return column == null ? null : column.getUpdatable();
- }
-
- protected Boolean specifiedUnique(T column) {
- return column == null ? null : column.getUnique();
- }
-
- protected Boolean specifiedInsertable(T column) {
- return column == null ? null : column.getInsertable();
- }
-
- protected String defaultTable() {
- return owner().defaultTableName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
deleted file mode 100644
index 8e1df6fed7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
+++ /dev/null
@@ -1,150 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlGenerator;
-
-
-public abstract class AbstractOrmGenerator<T extends XmlGenerator> extends AbstractOrmJpaContextNode implements Generator
-{
-
- protected String name;
-
- protected Integer specifiedInitialValue;
- protected Integer defaultInitialValue;
-
- protected Integer specifiedAllocationSize;
- protected Integer defaultAllocationSize;
-
- protected T generatorResource;
-
- protected AbstractOrmGenerator(OrmJpaContextNode parent) {
- super(parent);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- generatorResource().setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public Integer getInitialValue() {
- return (this.getSpecifiedInitialValue() == null) ? this.getDefaultInitialValue() : this.getSpecifiedInitialValue();
- }
-
- public Integer getSpecifiedInitialValue() {
- return this.specifiedInitialValue;
- }
-
- public void setSpecifiedInitialValue(Integer newSpecifiedInitialValue) {
- Integer oldSpecifiedInitialValue = this.specifiedInitialValue;
- this.specifiedInitialValue = newSpecifiedInitialValue;
- generatorResource().setInitialValue(newSpecifiedInitialValue);
- firePropertyChanged(SPECIFIED_INITIAL_VALUE_PROPERTY, oldSpecifiedInitialValue, newSpecifiedInitialValue);
- }
-
- protected void setSpecifiedInitialValue_(Integer newSpecifiedInitialValue) {
- Integer oldSpecifiedInitialValue = this.specifiedInitialValue;
- this.specifiedInitialValue = newSpecifiedInitialValue;
- firePropertyChanged(SPECIFIED_INITIAL_VALUE_PROPERTY, oldSpecifiedInitialValue, newSpecifiedInitialValue);
- }
-
- public Integer getDefaultInitialValue() {
- return this.defaultInitialValue;
- }
-
- protected void setDefaultInitialValue(Integer newDefaultInitialValue) {
- Integer oldSpecifiedInitialValue = this.defaultInitialValue;
- this.defaultInitialValue = newDefaultInitialValue;
- firePropertyChanged(DEFAULT_INITIAL_VALUE_PROPERTY, oldSpecifiedInitialValue, newDefaultInitialValue);
- }
-
- public Integer getAllocationSize() {
- return (this.getSpecifiedAllocationSize() == null) ? this.getDefaultAllocationSize() : this.getSpecifiedAllocationSize();
- }
-
- public Integer getSpecifiedAllocationSize() {
- return this.specifiedAllocationSize;
- }
-
- public void setSpecifiedAllocationSize(Integer newSpecifiedAllocationSize) {
- Integer oldSpecifiedAllocationSize = this.specifiedAllocationSize;
- this.specifiedAllocationSize = newSpecifiedAllocationSize;
- generatorResource().setAllocationSize(newSpecifiedAllocationSize);
- firePropertyChanged(SPECIFIED_ALLOCATION_SIZE_PROPERTY, oldSpecifiedAllocationSize, newSpecifiedAllocationSize);
- }
-
- protected void setSpecifiedAllocationSize_(Integer newSpecifiedAllocationSize) {
- Integer oldSpecifiedAllocationSize = this.specifiedAllocationSize;
- this.specifiedAllocationSize = newSpecifiedAllocationSize;
- firePropertyChanged(SPECIFIED_ALLOCATION_SIZE_PROPERTY, oldSpecifiedAllocationSize, newSpecifiedAllocationSize);
- }
-
- public Integer getDefaultAllocationSize() {
- return this.defaultAllocationSize;
- }
-
- protected void setDefaultAllocationSize(Integer newDefaultAllocationSize) {
- Integer oldSpecifiedAllocationSize = this.defaultAllocationSize;
- this.defaultAllocationSize = newDefaultAllocationSize;
- firePropertyChanged(DEFAULT_ALLOCATION_SIZE_PROPERTY, oldSpecifiedAllocationSize, newDefaultAllocationSize);
- }
-
-
- public void initialize(T generatorResource) {
- this.generatorResource = generatorResource;
- this.name = this.name(generatorResource);
- this.specifiedInitialValue = this.specifiedInitialValue(generatorResource);
- this.specifiedAllocationSize = this.specifiedAllocationSize(generatorResource);
- //TODO defaults
- }
-
- public void update(T generatorResource) {
- this.generatorResource = generatorResource;
- this.setName_(this.name(generatorResource));
- this.setSpecifiedInitialValue_(this.specifiedInitialValue(generatorResource));
- this.setSpecifiedAllocationSize_(this.specifiedAllocationSize(generatorResource));
- //TODO defaults
- }
-
- protected T generatorResource() {
- return this.generatorResource;
- }
-
- protected String name(XmlGenerator generatorResource) {
- return generatorResource.getName();
- }
-
- protected Integer specifiedInitialValue(XmlGenerator generatorResource) {
- return generatorResource.getInitialValue();
- }
-
- protected Integer specifiedAllocationSize(XmlGenerator generatorResource) {
- return generatorResource.getAllocationSize();
- }
-
- public TextRange validationTextRange() {
- return this.generatorResource().validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJpaContextNode.java
deleted file mode 100644
index cdcb1f0a0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJpaContextNode.java
+++ /dev/null
@@ -1,36 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractOrmJpaContextNode extends AbstractJpaContextNode implements OrmJpaContextNode
-{
- // ********** constructor **********
-
- protected AbstractOrmJpaContextNode(JpaNode parent) {
- super(parent);
- }
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #addToMessages(List<IMessage>)}
- * should be preceded by a "super" call to this method
- */
- public void addToMessages(List<IMessage> messages) {
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
deleted file mode 100644
index 0fcb56be4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ /dev/null
@@ -1,297 +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.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping;
-
-
-public abstract class AbstractOrmMultiRelationshipMapping<T extends XmlMultiRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T>
- implements OrmMultiRelationshipMapping
-{
-
- protected String mappedBy;
-
- protected String orderBy;//TODO change this to defaultOrderBy and specifiedOrderBy?
-
- protected boolean isNoOrdering;
-
- protected boolean isPkOrdering;
-
- protected boolean isCustomOrdering;
-
- protected final OrmJoinTable joinTable;
-
- protected String mapKey;
-
- protected AbstractOrmMultiRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.joinTable = jpaFactory().buildOrmJoinTable(this);
- }
-
- @Override
- public void initializeFromXmlMulitRelationshipMapping(OrmMultiRelationshipMapping oldMapping) {
- super.initializeFromXmlMulitRelationshipMapping(oldMapping);
- getJoinTable().initializeFrom(oldMapping.getJoinTable());
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public FetchType getDefaultFetch() {
- return MultiRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- attributeMapping().setMappedBy(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected void setMappedBy_(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public String getOrderBy() {
- return this.orderBy;
- }
-
- public void setOrderBy(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- attributeMapping().setOrderBy(newOrderBy);
- firePropertyChanged(ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- protected void setOrderBy_(String newOrderBy) {
- String oldOrderBy = this.orderBy;
- this.orderBy = newOrderBy;
- firePropertyChanged(ORDER_BY_PROPERTY, oldOrderBy, newOrderBy);
- }
-
- public boolean isNoOrdering() {
- return this.isNoOrdering;
- }
-
- public void setNoOrdering(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- if (newNoOrdering) {
- attributeMapping().setOrderBy(null);
- }
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- protected void setNoOrdering_(boolean newNoOrdering) {
- boolean oldNoOrdering = this.isNoOrdering;
- this.isNoOrdering = newNoOrdering;
- firePropertyChanged(NO_ORDERING_PROPERTY, oldNoOrdering, newNoOrdering);
- }
-
- public boolean isPkOrdering() {
- return this.isPkOrdering;
- }
-
- public void setPkOrdering(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- if (newPkOrdering) {
- attributeMapping().setOrderBy("");
- }
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- protected void setPkOrdering_(boolean newPkOrdering) {
- boolean oldPkOrdering = this.isPkOrdering;
- this.isPkOrdering = newPkOrdering;
- firePropertyChanged(PK_ORDERING_PROPERTY, oldPkOrdering, newPkOrdering);
- }
-
- public boolean isCustomOrdering() {
- return this.isCustomOrdering;
- }
-
- public void setCustomOrdering(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- if (newCustomOrdering) {
- setOrderBy("");
- }
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
- protected void setCustomOrdering_(boolean newCustomOrdering) {
- boolean oldCustomOrdering = this.isCustomOrdering;
- this.isCustomOrdering = newCustomOrdering;
- firePropertyChanged(CUSTOM_ORDERING_PROPERTY, oldCustomOrdering, newCustomOrdering);
- }
-
-// public ITextRange mappedByTextRange() {
-// if (node == null) {
-// return typeMapping().validationTextRange();
-// }
-// IDOMNode mappedByNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.MAPPED_BY);
-// return (mappedByNode == null) ? validationTextRange() : buildTextRange(mappedByNode);
-// }
-
- public OrmJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- public boolean isJoinTableSpecified() {
- return getJoinTable().isSpecified();
- }
-
- public String getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- if (oldMapKey != newMapKey) {
- if (this.mapKeyResource() != null) {
- this.mapKeyResource().setName(newMapKey);
- if (this.mapKeyResource().isAllFeaturesUnset()) {
- removeMapKeyResource();
- }
- }
- else if (newMapKey != null) {
- addMapKeyResource();
- mapKeyResource().setName(newMapKey);
- }
- }
- firePropertyChanged(MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected void setMapKey_(String newMapKey) {
- String oldMapKey = this.mapKey;
- this.mapKey = newMapKey;
- firePropertyChanged(MAP_KEY_PROPERTY, oldMapKey, newMapKey);
- }
-
- protected MapKey mapKeyResource() {
- return attributeMapping().getMapKey();
- }
-
- protected void removeMapKeyResource() {
- attributeMapping().setMapKey(null);
- }
-
- protected void addMapKeyResource() {
- attributeMapping().setMapKey(OrmFactory.eINSTANCE.createMapKeyImpl());
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// super.refreshDefaults(defaultsContext);
-// // TODO
-// // if (isOrderByPk()) {
-// // refreshDefaultOrderBy(defaultsContext);
-// // }
-// }
-//
-// //primary key ordering when just the @OrderBy annotation is present
-// protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) {
-// IEntity targetEntity = getResolvedTargetEntity();
-// if (targetEntity != null) {
-// setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC");
-// }
-// }
-//
-// //TODO copied from JavaMultiRelationshipMapping
-// /**
-// * extract the element type from the specified container signature and
-// * convert it into a reference entity type name;
-// * return null if the type is not a valid reference entity type (e.g. it's
-// * another container or an array or a primitive or other Basic type)
-// */
-// @Override
-// protected String javaDefaultTargetEntity(ITypeBinding typeBinding) {
-// String typeName = super.javaDefaultTargetEntity(typeBinding);
-// return JavaRelationshipMapping.typeNamedIsContainer(typeName) ? this.javaDefaultTargetEntityFromContainer(typeBinding) : null;
-// }
-//
-// protected String javaDefaultTargetEntityFromContainer(ITypeBinding typeBinding) {
-// return JavaMultiRelationshipMapping.javaDefaultTargetEntityFromContainer(typeBinding);
-// }
-
- public TextRange mappedByTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void initialize(T multiRelationshipMapping) {
- super.initialize(multiRelationshipMapping);
- this.mappedBy = multiRelationshipMapping.getMappedBy();
- this.mapKey = this.mapKey(multiRelationshipMapping);
- this.orderBy = this.orderBy(multiRelationshipMapping);
- if (this.orderBy == null) {
- this.isNoOrdering = true;
- }
- else {
- this.isCustomOrdering = true;
- }
- this.joinTable.initialize(multiRelationshipMapping);
- }
-
- @Override
- public void update(T multiRelationshipMapping) {
- super.update(multiRelationshipMapping);
- this.setMappedBy_(multiRelationshipMapping.getMappedBy());
- this.setMapKey_(this.mapKey(multiRelationshipMapping));
- this.setOrderBy_(this.orderBy(multiRelationshipMapping));
- if (getOrderBy() == null) {
- setNoOrdering_(true);
- setPkOrdering_(false);
- setCustomOrdering_(false);
- }
- else {
- setNoOrdering_(false);
- setPkOrdering_(false);
- setCustomOrdering_(true);
- }
- this.joinTable.update(multiRelationshipMapping);
- }
-
- protected String mapKey(T multiRelationshipMapping) {
- return multiRelationshipMapping.getMapKey() == null ? null : multiRelationshipMapping.getMapKey().getName();
- }
-
- protected String orderBy(T multiRelationshipMapping) {
- return multiRelationshipMapping.getOrderBy();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
deleted file mode 100644
index 7f042863ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
+++ /dev/null
@@ -1,195 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.resource.orm.XmlNamedColumn;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-
-
-public abstract class AbstractOrmNamedColumn<T extends XmlNamedColumn> extends AbstractOrmJpaContextNode
- implements OrmNamedColumn
-{
- protected Owner owner;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String columnDefinition;
-
- protected AbstractOrmNamedColumn(OrmJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- @Override
- public OrmJpaContextNode parent() {
- return (OrmJpaContextNode) super.parent();
- }
-
- public void initializeFrom(NamedColumn oldColumn) {
- setSpecifiedName(oldColumn.getSpecifiedName());
- setColumnDefinition(oldColumn.getColumnDefinition());
- }
-
- protected abstract T columnResource();
-
- protected abstract void removeColumnResource();
-
- protected abstract void addColumnResource();
-
- public Owner owner() {
- return this.owner;
- }
-
-// @Override
-// protected void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds) {
-// super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.INAMED_COLUMN__DEFAULT_NAME);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.INAMED_COLUMN__NAME);
-// }
-
-
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- if (oldSpecifiedName != newSpecifiedName) {
- if (this.columnResource() != null) {
- this.columnResource().setName(newSpecifiedName);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedName != null) {
- addColumnResource();
- columnResource().setName(newSpecifiedName);
- }
- }
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- if (oldColumnDefinition != newColumnDefinition) {
- if (this.columnResource() != null) {
- this.columnResource().setColumnDefinition(newColumnDefinition);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newColumnDefinition != null) {
- addColumnResource();
- columnResource().setColumnDefinition(newColumnDefinition);
- }
- }
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- protected void setColumnDefinition_(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public Column dbColumn() {
- Table table = this.dbTable();
- return (table == null) ? null : table.columnNamed(getName());
- }
-
- public Table dbTable() {
- return owner().dbTable(this.tableName());
- }
-
- protected abstract String tableName();
-
- public boolean isResolved() {
- return dbColumn() != null;
- }
-
- public TextRange nameTextRange() {
- if (columnResource() != null) {
- TextRange textRange = columnResource().nameTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return this.parent().validationTextRange();
- }
-
- public TextRange validationTextRange() {
- return columnResource().validationTextRange();
- }
-
-
- // ******************* initialization from orm xml resource model ********************
-
- protected void initialize(T column) {
- this.specifiedName = this.specifiedName(column);
- this.defaultName = this.defaultName();
- this.columnDefinition = this.specifiedColumnDefinition(column);
- }
-
- protected void update(T column) {
- setSpecifiedName_(this.specifiedName(column));
- setDefaultName(this.defaultName());
- setColumnDefinition_(this.specifiedColumnDefinition(column));
- }
-
- protected String specifiedName(T column) {
- return column == null ? null : column.getName();
- }
-
- protected String specifiedColumnDefinition(T column) {
- return column == null ? null : column.getColumnDefinition();
- }
-
- /**
- * Return the default column name.
- */
- protected String defaultName() {
- return this.owner().defaultColumnName();
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
deleted file mode 100644
index c2dddcfa46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlQuery;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-
-public abstract class AbstractOrmQuery<E extends XmlQuery> extends AbstractOrmJpaContextNode implements OrmQuery
-{
-
- protected String name;
-
- protected String query;
-
- protected final List<OrmQueryHint> hints;
-
- protected E queryResource;
-
- protected AbstractOrmQuery(OrmJpaContextNode parent) {
- super(parent);
- this.hints = new ArrayList<OrmQueryHint>();
- }
-
- protected E queryResource() {
- return this.queryResource;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.queryResource().setName(newName);
- firePropertyChanged(Query.NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- this.queryResource().setQuery(newQuery);
- firePropertyChanged(Query.QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<OrmQueryHint> hints() {
- return new CloneListIterator<OrmQueryHint>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public OrmQueryHint addHint(int index) {
- OrmQueryHint queryHint = jpaFactory().buildOrmQueryHint(this);
- this.hints.add(index, queryHint);
- this.queryResource().getHints().add(index, OrmFactory.eINSTANCE.createXmlQueryHint());
- this.fireItemAdded(Query.HINTS_LIST, index, queryHint);
- return queryHint;
- }
-
- protected void addHint(int index, OrmQueryHint queryHint) {
- addItemToList(index, queryHint, this.hints, Query.HINTS_LIST);
- }
-
- public void removeHint(QueryHint queryHint) {
- removeHint(this.hints.indexOf(queryHint));
- }
-
- public void removeHint(int index) {
- OrmQueryHint queryHint = this.hints.remove(index);
- this.queryResource.getHints().remove(index);
- fireItemRemoved(Query.HINTS_LIST, index, queryHint);
- }
-
- protected void removeHint_(OrmQueryHint queryHint) {
- removeItemFromList(queryHint, this.hints, Query.HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- this.queryResource.getHints().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.hints, Query.HINTS_LIST);
-
- }
-
-
- public void initialize(E queryResource) {
- this.queryResource = queryResource;
- this.name = queryResource.getName();
- this.query = queryResource.getQuery();
- this.initializeHints(queryResource);
- }
-
- protected void initializeHints(E queryResource) {
- for (XmlQueryHint queryhint : queryResource.getHints()) {
- this.hints.add(createHint(queryhint));
- }
- }
-
- protected OrmQueryHint createHint(XmlQueryHint queryHint) {
- OrmQueryHint ormQueryHint = jpaFactory().buildOrmQueryHint(this);
- ormQueryHint.initialize(queryHint);
- return ormQueryHint;
- }
-
- public void update(E queryResource) {
- this.queryResource = queryResource;
- this.setName(queryResource.getName());
- this.setQuery(queryResource.getQuery());
- this.updateHints(queryResource);
- }
-
- protected void updateHints(E queryResource) {
- ListIterator<OrmQueryHint> hints = hints();
- ListIterator<XmlQueryHint> resourceHints = queryResource.getHints().listIterator();
-
- while (hints.hasNext()) {
- OrmQueryHint hint = hints.next();
- if (resourceHints.hasNext()) {
- hint.update(resourceHints.next());
- }
- else {
- removeHint_(hint);
- }
- }
-
- while (resourceHints.hasNext()) {
- addHint(hintsSize(), createHint(resourceHints.next()));
- }
- }
-
- public TextRange validationTextRange() {
- return this.queryResource.validationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java
deleted file mode 100644
index c4611dbe4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.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.core.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public abstract class AbstractOrmRelationshipMapping<T extends XmlRelationshipMapping> extends AbstractOrmAttributeMapping<T>
- implements OrmRelationshipMapping
-{
-
- protected String specifiedTargetEntity;
-
- protected String defaultTargetEntity;
-
- protected Entity resolvedTargetEntity;
-
- protected FetchType specifiedFetch;
-
- protected final OrmCascade cascade;
-
-
- protected AbstractOrmRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.cascade = new OrmCascade(this);
- }
-
- public String getTargetEntity() {
- return (this.getSpecifiedTargetEntity() == null) ? getDefaultTargetEntity() : this.getSpecifiedTargetEntity();
- }
-
- public String getSpecifiedTargetEntity() {
- return this.specifiedTargetEntity;
- }
-
- public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) {
- String oldSpecifiedTargetEntity = this.specifiedTargetEntity;
- this.specifiedTargetEntity = newSpecifiedTargetEntity;
- attributeMapping().setTargetEntity(newSpecifiedTargetEntity);
- firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, oldSpecifiedTargetEntity, newSpecifiedTargetEntity);
- }
-
- protected void setSpecifiedTargetEntity_(String newSpecifiedTargetEntity) {
- String oldSpecifiedTargetEntity = this.specifiedTargetEntity;
- this.specifiedTargetEntity = newSpecifiedTargetEntity;
- firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, oldSpecifiedTargetEntity, newSpecifiedTargetEntity);
- }
-
- public String getDefaultTargetEntity() {
- return this.defaultTargetEntity;
- }
-
- protected void setDefaultTargetEntity(String newDefaultTargetEntity) {
- String oldDefaultTargetEntity = this.defaultTargetEntity;
- this.defaultTargetEntity = newDefaultTargetEntity;
- firePropertyChanged(DEFAULT_TARGET_ENTITY_PROPERTY, oldDefaultTargetEntity, newDefaultTargetEntity);
- }
-
- public Entity getResolvedTargetEntity() {
- return this.resolvedTargetEntity;
- }
-
- protected void setResolvedTargetEntity(Entity newResolvedTargetEntity) {
- Entity oldResolvedTargetEntity = this.resolvedTargetEntity;
- this.resolvedTargetEntity = newResolvedTargetEntity;
- firePropertyChanged(RESOLVED_TARGET_ENTITY_PROPERTY, oldResolvedTargetEntity, newResolvedTargetEntity);
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.attributeMapping().setFetch(FetchType.toOrmResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- public OrmCascade getCascade() {
- return this.cascade;
- }
-
-
- @Override
- public void initializeFromXmlRelationshipMapping(OrmRelationshipMapping oldMapping) {
- super.initializeFromXmlRelationshipMapping(oldMapping);
- setSpecifiedTargetEntity(oldMapping.getSpecifiedTargetEntity());
- setSpecifiedFetch(oldMapping.getSpecifiedFetch());
- getCascade().initializeFrom(oldMapping.getCascade());
- }
- //TODO should we set the fetch type from a BasicMapping??
-
-
-// public boolean targetEntityIsValid(String targetEntity) {
-// return RelationshipMappingTools.targetEntityIsValid(targetEntity);
-// }
-//
-// public IEntity getEntity() {
-// ITypeMapping typeMapping = getPersistentType().getMapping();
-// if (typeMapping instanceof IEntity) {
-// return (IEntity) typeMapping;
-// }
-// return null;
-// }
-//
-// public String fullyQualifiedTargetEntity(CompilationUnit astRoot) {
-// if (getTargetEntity() == null) {
-// return null;
-// }
-// if (targetEntityIncludesPackage()) {
-// return getTargetEntity();
-// }
-// String package_ = persistentType().getMapping().getEntityMappings().getPackage();
-// if (package_ != null) {
-// return package_ + '.' + getTargetEntity();
-// }
-// return getTargetEntity();
-// }
-//
-// private boolean targetEntityIncludesPackage() {
-// return getTargetEntity().lastIndexOf('.') != -1;
-// }
-
- public Iterator<String> allTargetEntityAttributeNames() {
- Entity targetEntity = this.getResolvedTargetEntity();
- return (targetEntity == null) ? EmptyIterator.<String> instance() : targetEntity.persistentType().allAttributeNames();
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-// @Override
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// super.refreshDefaults(defaultsContext);
-// setDefaultTargetEntity((String) defaultsContext.getDefault(GenericJpaPlatform.DEFAULT_TARGET_ENTITY_KEY));
-// String targetEntity = fullyQualifiedTargetEntity(defaultsContext.astRoot());
-// if (targetEntity != null) {
-// IPersistentType persistentType = defaultsContext.persistentType(targetEntity);
-// if (persistentType != null) {
-// if (persistentType.getMapping() instanceof IEntity) {
-// setResolvedTargetEntity((IEntity) persistentType.getMapping());
-// return;
-// }
-// }
-// }
-// setResolvedTargetEntity(null);
-// }
-//
-// /**
-// * the default 'targetEntity' is calculated from the attribute type;
-// * return null if the attribute type cannot possibly be an entity
-// */
-// public String javaDefaultTargetEntity(CompilationUnit astRoot) {
-// ITypeBinding typeBinding = this.getPersistentAttribute().getAttribute().typeBinding(astRoot);
-// if (typeBinding != null) {
-// return this.javaDefaultTargetEntity(typeBinding);
-// }
-// return null;
-// }
-//
-// protected String javaDefaultTargetEntity(ITypeBinding typeBinding) {
-// return buildReferenceEntityTypeName(typeBinding);
-// }
-//
-// protected String buildReferenceEntityTypeName(ITypeBinding typeBinding) {
-// return JavaRelationshipMapping.buildReferenceEntityTypeName(typeBinding);
-// }
-
- public Entity getEntity() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean targetEntityIsValid(String targetEntity) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void initialize(T relationshipMapping) {
- super.initialize(relationshipMapping);
- this.specifiedTargetEntity = relationshipMapping.getTargetEntity();
- this.defaultTargetEntity = null;//TODO default target entity
- this.specifiedFetch = this.specifiedFetch(relationshipMapping);
- this.cascade.initialize(relationshipMapping);
- }
-
- @Override
- public void update(T relationshipMapping) {
- super.update(relationshipMapping);
- this.setSpecifiedTargetEntity_(relationshipMapping.getTargetEntity());
- this.setDefaultTargetEntity(null);//TODO default target entity
- this.setSpecifiedFetch_(this.specifiedFetch(relationshipMapping));
- this.cascade.update(relationshipMapping);
- }
-
- protected FetchType specifiedFetch(XmlRelationshipMapping relationshipMapping) {
- return FetchType.fromOrmResourceModel(relationshipMapping.getFetch());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
deleted file mode 100644
index 0eea5c7c1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
+++ /dev/null
@@ -1,284 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-
-public abstract class AbstractOrmSingleRelationshipMapping<T extends XmlSingleRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T> implements OrmSingleRelationshipMapping
-{
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
-
- protected final List<OrmJoinColumn> defaultJoinColumns;
-
- protected Boolean specifiedOptional;
-
- protected AbstractOrmSingleRelationshipMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- this.defaultJoinColumns = new ArrayList<OrmJoinColumn>();
-
- //this.getDefaultJoinColumns().add(this.createJoinColumn(new JoinColumnOwner(this)));
- }
-
- @Override
- public void initializeFromXmlSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- super.initializeFromXmlSingleRelationshipMapping(oldMapping);
- int index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldMapping.specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- public FetchType getDefaultFetch() {
- return SingleRelationshipMapping.DEFAULT_FETCH_TYPE;
- }
-
- //***************** ISingleRelationshipMapping implementation *****************
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public OrmJoinColumn getDefaultJoinColumn() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- public ListIterator<OrmJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- OrmJoinColumn joinColumn = jpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- this.attributeMapping().getJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- this.fireItemAdded(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- this.attributeMapping().getJoinColumns().remove(index);
- fireItemRemoved(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedJoinColumn_(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.attributeMapping().getJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public Boolean getOptional() {
- return getSpecifiedOptional() == null ? getDefaultOptional() : getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldSpecifiedOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- attributeMapping().setOptional(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldSpecifiedOptional, newSpecifiedOptional);
- }
-
- protected void setSpecifiedOptional_(Boolean newSpecifiedOptional) {
- Boolean oldSpecifiedOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldSpecifiedOptional, newSpecifiedOptional);
- }
-//
-// public boolean containsSpecifiedJoinColumns() {
-// return !this.getSpecifiedJoinColumns().isEmpty();
-// }
-
- @Override
- public void initialize(T singleRelationshipMapping) {
- super.initialize(singleRelationshipMapping);
- this.specifiedOptional = singleRelationshipMapping.getOptional();
- //TODO defaultOptional
- this.initializeSpecifiedJoinColumns(singleRelationshipMapping);
- }
-
- protected void initializeSpecifiedJoinColumns(T singleRelationshipMapping) {
- if (singleRelationshipMapping == null) {
- return;
- }
- for (XmlJoinColumn joinColumn : singleRelationshipMapping.getJoinColumns()) {
- this.specifiedJoinColumns.add(createJoinColumn(joinColumn));
- }
- }
-
- protected OrmJoinColumn createJoinColumn(XmlJoinColumn joinColumn) {
- OrmJoinColumn ormJoinColumn = jpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner());
- ormJoinColumn.initialize(joinColumn);
- return ormJoinColumn;
- }
-
- @Override
- public void update(T singleRelationshipMapping) {
- super.update(singleRelationshipMapping);
- this.setSpecifiedOptional_(singleRelationshipMapping.getOptional());
- this.updateSpecifiedJoinColumns(singleRelationshipMapping);
- }
-
- protected void updateSpecifiedJoinColumns(T singleRelationshipMapping) {
- ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
- if (singleRelationshipMapping != null) {
- resourceJoinColumns = singleRelationshipMapping.getJoinColumns().listIterator();
- }
-
- while (joinColumns.hasNext()) {
- OrmJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
-
- public class JoinColumnOwner implements OrmJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String defaultTableName() {
- return AbstractOrmSingleRelationshipMapping.this.typeMapping().tableName();
- }
-
- public Entity targetEntity() {
- return AbstractOrmSingleRelationshipMapping.this.getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return AbstractOrmSingleRelationshipMapping.this.getName();
- }
-
- public RelationshipMapping relationshipMapping() {
- return AbstractOrmSingleRelationshipMapping.this;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractOrmSingleRelationshipMapping.this.typeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping typeMapping() {
- return AbstractOrmSingleRelationshipMapping.this.typeMapping();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return AbstractOrmSingleRelationshipMapping.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return AbstractOrmSingleRelationshipMapping.this.joinColumnsSize();
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java
deleted file mode 100644
index 75906aa5eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java
+++ /dev/null
@@ -1,287 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlBaseTable;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.internal.NameTools;
-
-public abstract class AbstractOrmTable extends AbstractOrmJpaContextNode implements Table
-{
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String specifiedCatalog;
-
- protected String defaultCatalog;
-
- protected String specifiedSchema;
-
- protected String defaultSchema;
-
-// protected EList<IUniqueConstraint> uniqueConstraints;
-
- protected AbstractOrmTable(OrmJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- public OrmJpaContextNode parent() {
- return (OrmJpaContextNode) super.parent();
- }
-
- public void initializeFrom(Table oldTable) {
- setSpecifiedName(oldTable.getSpecifiedName());
- setSpecifiedCatalog(oldTable.getSpecifiedCatalog());
- setSpecifiedSchema(oldTable.getSpecifiedSchema());
- }
-
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? this.getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- /**
- * Return null if no table resource element exists
- */
- protected abstract XmlBaseTable table();
-
- protected abstract void removeTableResource();
-
- protected abstract void addTableResource();
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- if (oldSpecifiedName != newSpecifiedName) {
- if (this.table() != null) {
- this.table().setName(newSpecifiedName);
- if (this.table().isAllFeaturesUnset()) {
- removeTableResource();
- }
- }
- else if (newSpecifiedName != null) {
- addTableResource();
- table().setName(newSpecifiedName);
- }
- }
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public String getCatalog() {
- return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog();
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- if (oldSpecifiedCatalog != newSpecifiedCatalog) {
- if (this.table() != null) {
- this.table().setCatalog(newSpecifiedCatalog);
- if (this.table().isAllFeaturesUnset()) {
- removeTableResource();
- }
- }
- else if (newSpecifiedCatalog != null) {
- addTableResource();
- table().setCatalog(newSpecifiedCatalog);
- }
- }
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- protected void setSpecifiedCatalog_(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String newDefaultCatalog) {
- String oldDefaultCatalog = this.defaultCatalog;
- this.defaultCatalog = newDefaultCatalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, oldDefaultCatalog, newDefaultCatalog);
- }
-
- public String getSchema() {
- return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema();
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- if (oldSpecifiedSchema != newSpecifiedSchema) {
- if (this.table() != null) {
- this.table().setSchema(newSpecifiedSchema);
- if (this.table().isAllFeaturesUnset()) {
- removeTableResource();
- }
- }
- else if (newSpecifiedSchema != null) {
- addTableResource();
- table().setSchema(newSpecifiedSchema);
- }
- }
-
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- protected void setSpecifiedSchema_(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, oldDefaultSchema, newDefaultSchema);
- }
-
-// public EList<IUniqueConstraint> getUniqueConstraints() {
-// if (uniqueConstraints == null) {
-// uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS);
-// }
-// return uniqueConstraints;
-// }
-
- public org.eclipse.jpt.db.internal.Table dbTable() {
- Schema schema = this.dbSchema();
- return (schema == null) ? null : schema.tableNamed(getName());
- }
-
- public Schema dbSchema() {
- return connectionProfile().getDatabase().schemaNamed(getSchema());
- }
-
- public boolean hasResolvedSchema() {
- return dbSchema() != null;
- }
-
- public boolean isResolved() {
- return dbTable() != null;
- }
-
- protected void initialize(XmlBaseTable table) {
- this.specifiedName = this.specifiedName(table);
- this.specifiedSchema = this.specifiedSchema(table);
- this.specifiedCatalog = this.specifiedCatalog(table);
- this.defaultName = this.defaultName();
- this.defaultSchema = this.defaultSchema();
- this.defaultCatalog = this.defaultCatalog();
- }
-
- protected void update(XmlBaseTable table) {
- this.setSpecifiedName_(this.specifiedName(table));
- this.setSpecifiedSchema_(this.specifiedSchema(table));
- this.setSpecifiedCatalog_(this.specifiedCatalog(table));
- this.setDefaultName(this.defaultName());
- this.setDefaultSchema(this.defaultSchema());
- this.setDefaultCatalog(this.defaultCatalog());
- }
-
- protected String specifiedName(XmlBaseTable table) {
- return table == null ? null : table.getName();
- }
-
- protected String specifiedSchema(XmlBaseTable table) {
- return table == null ? null : table.getSchema();
- }
-
- protected String specifiedCatalog(XmlBaseTable table) {
- return table == null ? null : table.getCatalog();
- }
-
- protected abstract String defaultName();
-
- protected abstract String defaultSchema();
-
- protected abstract String defaultCatalog();
-
- public String qualifiedName() {
- return NameTools.buildQualifiedDatabaseObjectName(this.getCatalog(), this.getSchema(), this.getName());
- }
-
- protected TextRange nameTextRange() {
- if (table() != null) {
- return table().nameTextRange();
- }
- return this.parent().validationTextRange();
- }
-
- protected TextRange catalogTextRange() {
- if (table() != null) {
- return table().catalogTextRange();
- }
- return this.parent().validationTextRange();
- }
-
- protected TextRange schemaTextRange() {
- if (table() != null) {
- return table().schemaTextRange();
- }
- return this.parent().validationTextRange();
- }
-
- public TextRange validationTextRange() {
- return this.table().validationTextRange();
- }
-
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(qualifiedName());
- }
-
- @Override
- public String displayString() {
- return qualifiedName();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java
deleted file mode 100644
index b2bf08a556..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public abstract class AbstractOrmTypeMapping<T extends AbstractXmlTypeMapping> extends AbstractOrmJpaContextNode implements OrmTypeMapping
-{
-
- protected String class_;
-
- public AccessType defaultAccess;
-
- protected AccessType specifiedAccess;
-
- public boolean defaultMetadataComplete;
-
- protected Boolean specifiedMetadataComplete;
-
- protected JavaPersistentType javaPersistentType;
-
- protected T typeMapping;
-
- protected AbstractOrmTypeMapping(OrmPersistentType parent) {
- super(parent);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String tableName() {
- return null;
- }
-
- public String getClass_() {
- return this.class_;
- }
-
- public void setClass(String newClass) {
- String oldClass = this.class_;
- this.class_ = newClass;
- this.typeMappingResource().setClassName(newClass);
- firePropertyChanged(CLASS_PROPERTY, oldClass, newClass);
- persistentType().classChanged(oldClass, newClass);
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType newDefaultAccess) {
- AccessType oldDefaultAccess = this.defaultAccess;
- this.defaultAccess = newDefaultAccess;
- firePropertyChanged(DEFAULT_ACCESS_PROPERTY, oldDefaultAccess, newDefaultAccess);
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- AccessType oldSpecifiedAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- this.typeMappingResource().setAccess(AccessType.toXmlResourceModel(newSpecifiedAccess));
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldSpecifiedAccess, newSpecifiedAccess);
- }
-
- public AccessType getAccess() {
- return (this.getSpecifiedAccess() == null) ? this.getDefaultAccess() : this.getSpecifiedAccess();
- }
-
- public boolean isMetadataComplete() {
- if (isDefaultMetadataComplete()) {
- //entity-mappings/persistence-unit-metadata/xml-mapping-metadata-complete is specified, then it overrides
- //anything set here
- return true;
- }
- return (this.getSpecifiedMetadataComplete() == null) ? this.isDefaultMetadataComplete() : this.getSpecifiedMetadataComplete();
- }
-
- public boolean isDefaultMetadataComplete() {
- return this.defaultMetadataComplete;
- }
-
- protected void setDefaultMetadataComplete(boolean newDefaultMetadataComplete) {
- boolean oldMetadataComplete = this.defaultMetadataComplete;
- this.defaultMetadataComplete = newDefaultMetadataComplete;
- firePropertyChanged(DEFAULT_METADATA_COMPLETE_PROPERTY, oldMetadataComplete, newDefaultMetadataComplete);
- }
-
- public Boolean getSpecifiedMetadataComplete() {
- return this.specifiedMetadataComplete;
- }
-
- public void setSpecifiedMetadataComplete(Boolean newSpecifiedMetadataComplete) {
- Boolean oldMetadataComplete = this.specifiedMetadataComplete;
- this.specifiedMetadataComplete = newSpecifiedMetadataComplete;
- this.typeMappingResource().setMetadataComplete(newSpecifiedMetadataComplete);
- firePropertyChanged(SPECIFIED_METADATA_COMPLETE_PROPERTY, oldMetadataComplete, newSpecifiedMetadataComplete);
- }
-
- public OrmPersistentType persistentType() {
- return (OrmPersistentType) parent();
- }
-
- /**
- * ITypeMapping is changed and various ITypeMappings may have
- * common settings. In this method initialize the new ITypeMapping (this)
- * fromthe old ITypeMapping (oldMapping)
- * @param oldMapping
- */
- public void initializeFrom(OrmTypeMapping oldMapping) {
- this.setClass(oldMapping.getClass_());
- this.setSpecifiedAccess(oldMapping.getSpecifiedAccess());
- this.setSpecifiedMetadataComplete(oldMapping.getSpecifiedMetadataComplete());
- this.setDefaultAccess(oldMapping.getDefaultAccess());
- this.setDefaultMetadataComplete(oldMapping.isDefaultMetadataComplete());
- }
-
- public Table primaryDbTable() {
- return null;
- }
-
- public Table dbTable(String tableName) {
- return null;
- }
-
- public Schema dbSchema() {
- return null;
- }
-
- /**
- * @see TypeMapping#attributeMappingKeyAllowed(String)
- *
- * Default implementation: override where needed
- */
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return true;
- }
-
- public Iterator<String> overridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> overridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return EmptyIterator.instance();
- }
-
- public T typeMappingResource() {
- return this.typeMapping;
- }
-
- protected PersistenceUnitMetadata persistenceUnitMetadata() {
- return entityMappings().getPersistenceUnitMetadata();
- }
-
- protected boolean defaultMetadataComplete() {
- return persistenceUnitMetadata().isXmlMappingMetadataComplete();
- }
-
- protected AccessType defaultAccess() {
- if (!isMetadataComplete()) {
- if (getJavaPersistentType() != null) {
- if (getJavaPersistentType().hasAnyAttributeMappingAnnotations()) {
- return getJavaPersistentType().access();
- }
- if (persistentType().parentPersistentType() != null) {
- return persistentType().parentPersistentType().access();
- }
- }
- }
- return entityMappings().getAccess();
- }
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType newJavaPersistentType) {
- JavaPersistentType oldJavaPersistentType = this.javaPersistentType;
- this.javaPersistentType = newJavaPersistentType;
- firePropertyChanged(JAVA_PERSISTENT_TYPE_PROPERTY, oldJavaPersistentType, newJavaPersistentType);
- }
-
- protected void initializeJavaPersistentType() {
- JavaResourcePersistentType persistentTypeResource = jpaProject().javaPersistentTypeResource(getClass_());
- if (persistentTypeResource != null) {
- this.javaPersistentType = buildJavaPersistentType(persistentTypeResource);
- }
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType persistentTypeResource = jpaProject().javaPersistentTypeResource(getClass_());
- if (persistentTypeResource == null) {
- setJavaPersistentType(null);
- }
- else {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().update(persistentTypeResource);
- }
- else {
- setJavaPersistentType(buildJavaPersistentType(persistentTypeResource));
- }
- }
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType resourcePersistentType) {
- return jpaFactory().buildJavaPersistentType(this, resourcePersistentType);
- }
-
- public void initialize(T typeMapping) {
- this.typeMapping = typeMapping;
- this.class_ = typeMapping.getClassName();
- this.initializeJavaPersistentType();
- this.specifiedMetadataComplete = this.metadataComplete(typeMapping);
- this.defaultMetadataComplete = this.defaultMetadataComplete();
- this.specifiedAccess = AccessType.fromXmlResourceModel(typeMapping.getAccess());
- this.defaultAccess = this.defaultAccess();
- }
-
- public void update(T typeMapping) {
- this.typeMapping = typeMapping;
- this.setClass(typeMapping.getClassName());
- this.updateJavaPersistentType();
- this.setSpecifiedMetadataComplete(this.metadataComplete(typeMapping));
- this.setDefaultMetadataComplete(this.defaultMetadataComplete());
- this.setSpecifiedAccess(AccessType.fromXmlResourceModel(typeMapping.getAccess()));
- this.setDefaultAccess(this.defaultAccess());
- }
-
- protected Boolean metadataComplete(AbstractXmlTypeMapping typeMapping) {
- return typeMapping.getMetadataComplete();
- }
-
-
-
- // *************************************************************************
-
- public JpaStructureNode structureNode(int offset) {
- if (this.typeMapping.containsOffset(offset)) {
- return persistentType();
- }
- return null;
- }
-
- public TextRange selectionTextRange() {
- return this.typeMapping.selectionTextRange();
- }
-
- public TextRange classTextRange() {
- return this.typeMapping.classTextRange();
- }
-
- public TextRange attributesTextRange() {
- return this.typeMapping.attributesTextRange();
- }
-
- public boolean containsOffset(int textOffset) {
- if (typeMapping == null) {
- return false;
- }
- return typeMapping.containsOffset(textOffset);
- }
-
- //************************* validation ************************
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addClassMessages(messages);
- }
- protected void addClassMessages(List<IMessage> messages) {
- addUnspecifiedClassMessage(messages);
- addUnresolvedClassMessage(messages);
- }
-
- protected void addUnspecifiedClassMessage(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(getClass_())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS,
- this,
- this.classTextRange())
- );
- }
- }
-
- protected void addUnresolvedClassMessage(List<IMessage> messages) {
- if (! StringTools.stringIsEmpty(getClass_())
- && getJavaPersistentType() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS,
- new String[] {getClass_()},
- this,
- this.classTextRange())
- );
- }
- }
-
- public TextRange validationTextRange() {
- return this.typeMapping.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
deleted file mode 100644
index d0106d82e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java
+++ /dev/null
@@ -1,744 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericEntityMappings extends AbstractOrmJpaContextNode implements EntityMappings
-{
- protected XmlEntityMappings xmlEntityMappings;
-
- protected String version;
-
- protected String description;
-
- protected String package_;
-
- protected String defaultSchema;
-
- protected String specifiedSchema;
-
- protected String defaultCatalog;
-
- protected String specifiedCatalog;
-
- protected AccessType defaultAccess;
-
- protected AccessType specifiedAccess;
-
- protected final PersistenceUnitMetadata persistenceUnitMetadata;
-
- protected final List<OrmPersistentType> persistentTypes;
-
- protected final List<OrmSequenceGenerator> sequenceGenerators;
-
- protected final List<OrmTableGenerator> tableGenerators;
-
- protected final List<OrmNamedQuery> namedQueries;
-
- protected final List<OrmNamedNativeQuery> namedNativeQueries;
-
-
- public GenericEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.persistenceUnitMetadata = jpaFactory().buildPersistenceUnitMetadata(this, xmlEntityMappings);
- this.persistentTypes = new ArrayList<OrmPersistentType>();
- this.sequenceGenerators = new ArrayList<OrmSequenceGenerator>();
- this.tableGenerators = new ArrayList<OrmTableGenerator>();
- this.namedQueries = new ArrayList<OrmNamedQuery>();
- this.namedNativeQueries = new ArrayList<OrmNamedNativeQuery>();
- this.initialize(xmlEntityMappings);
- }
-
- public String getId() {
- return OrmStructureNodes.ENTITY_MAPPINGS_ID;
- }
-
- @Override
- public EntityMappings entityMappings() {
- return this;
- }
-
- public OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName) {
- for (OrmPersistentType ormPersistentType : CollectionTools.iterable(ormPersistentTypes())) {
- if (ormPersistentType.isFor(fullyQualifiedTypeName)) {
- return ormPersistentType;
- }
- }
- return null;
- }
-
- public PersistenceUnitMetadata getPersistenceUnitMetadata() {
- return this.persistenceUnitMetadata;
- }
-
- public String getPackage() {
- return this.package_;
- }
-
- public void setPackage(String newPackage) {
- String oldPackage = this.package_;
- this.package_ = newPackage;
- this.xmlEntityMappings.setPackage(newPackage);
- firePropertyChanged(PACKAGE_PROPERTY, oldPackage, newPackage);
- }
-
- public String getVersion() {
- return this.version;
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String newDescription) {
- String oldDescription = this.description;
- this.description = newDescription;
- this.xmlEntityMappings.setDescription(newDescription);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldDescription, newDescription);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, oldDefaultSchema, newDefaultSchema);
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- this.xmlEntityMappings.setSchema(newSpecifiedSchema);
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getSchema() {
- return (this.getSpecifiedSchema() == null) ? this.getDefaultSchema() : this.getSpecifiedSchema();
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String newDefaultCatalog) {
- String oldDefaultCatalog = this.defaultCatalog;
- this.defaultCatalog = newDefaultCatalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, oldDefaultCatalog, newDefaultCatalog);
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- this.xmlEntityMappings.setCatalog(newSpecifiedCatalog);
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getCatalog() {
- return (this.getSpecifiedCatalog() == null) ? this.getDefaultCatalog() : this.getSpecifiedCatalog();
- }
-
- public AccessType getAccess() {
- return (this.getSpecifiedAccess() == null) ? this.getDefaultAccess() : this.getSpecifiedAccess();
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType newDefaultAccess) {
- AccessType oldDefaultAccess = this.defaultAccess;
- this.defaultAccess = newDefaultAccess;
- firePropertyChanged(DEFAULT_ACCESS_PROPERTY, oldDefaultAccess, newDefaultAccess);
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- AccessType oldSpecifiedAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- this.xmlEntityMappings.setAccess(AccessType.toXmlResourceModel(newSpecifiedAccess));
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldSpecifiedAccess, newSpecifiedAccess);
- }
-
- public ListIterator<OrmPersistentType> ormPersistentTypes() {
- return new CloneListIterator<OrmPersistentType>(this.persistentTypes);
- }
-
- public int ormPersistentTypesSize() {
- return this.persistentTypes.size();
- }
-
- public OrmPersistentType addOrmPersistentType(String mappingKey, String className) {
- OrmPersistentType persistentType = jpaFactory().buildOrmPersistentType(this, mappingKey);
- int index = insertionIndex(persistentType);
- this.persistentTypes.add(index, persistentType);
- if (className.startsWith(getPackage() + ".")) {
- // adds short name if package name is specified
- className = className.substring(getPackage().length() + 1);
- }
- AbstractXmlTypeMapping typeMapping = persistentType.getMapping().addToResourceModel(this.xmlEntityMappings);
- typeMapping.setClassName(className);
- fireItemAdded(PERSISTENT_TYPES_LIST, index, persistentType);
- return persistentType;
- }
-
- protected void addOrmPersistentType(OrmPersistentType ormPersistentType) {
- addItemToList(ormPersistentType, this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
- protected int insertionIndex(OrmPersistentType ormPersistentType) {
- return CollectionTools.insertionIndexOf(this.persistentTypes, ormPersistentType, buildMappingComparator());
- }
-
- private Comparator<OrmPersistentType> buildMappingComparator() {
- return new Comparator<OrmPersistentType>() {
- public int compare(OrmPersistentType o1, OrmPersistentType o2) {
- int o1Sequence = o1.getMapping().xmlSequence();
- int o2Sequence = o2.getMapping().xmlSequence();
- if (o1Sequence < o2Sequence) {
- return -1;
- }
- if (o1Sequence == o2Sequence) {
- return 0;
- }
- return 1;
- }
- };
- }
-
- public void removeOrmPersistentType(int index) {
- OrmPersistentType ormPersistentType = this.persistentTypes.get(index);
- this.persistentTypes.remove(index);
- ormPersistentType.getMapping().removeFromResourceModel(this.xmlEntityMappings);
- fireItemRemoved(PERSISTENT_TYPES_LIST, index, ormPersistentType);
- }
-
- public void removeOrmPersistentType(OrmPersistentType ormPersistentType) {
- removeOrmPersistentType(this.persistentTypes.indexOf(ormPersistentType));
- }
-
- protected void removeOrmPersistentType_(OrmPersistentType ormPersistentType) {
- removeItemFromList(ormPersistentType, this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
- public void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping) {
- int sourceIndex = this.persistentTypes.indexOf(ormPersistentType);
- this.persistentTypes.remove(sourceIndex);
- oldMapping.removeFromResourceModel(this.xmlEntityMappings);
- int targetIndex = insertionIndex(ormPersistentType);
- this.persistentTypes.add(targetIndex, ormPersistentType);
- newMapping.addToResourceModel(this.xmlEntityMappings);
- newMapping.initializeFrom(oldMapping);
- //TODO are the source and target correct in this case, or is target off by one???
- fireItemMoved(PERSISTENT_TYPES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmSequenceGenerator> sequenceGenerators() {
- return new CloneListIterator<OrmSequenceGenerator>(this.sequenceGenerators);
- }
-
- public int sequenceGeneratorsSize() {
- return this.sequenceGenerators.size();
- }
-
- public SequenceGenerator addSequenceGenerator(int index) {
- OrmSequenceGenerator ormSequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- this.sequenceGenerators.add(index, ormSequenceGenerator);
- XmlSequenceGenerator sequenceGenerator = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- ormSequenceGenerator.initialize(sequenceGenerator);
- this.xmlEntityMappings.getSequenceGenerators().add(index, sequenceGenerator);
- fireItemAdded(SEQUENCE_GENERATORS_LIST, index, ormSequenceGenerator);
- return ormSequenceGenerator;
- }
-
- protected void addSequenceGenerator(int index, OrmSequenceGenerator sequenceGenerator) {
- addItemToList(index, sequenceGenerator, this.sequenceGenerators, EntityMappings.SEQUENCE_GENERATORS_LIST);
- }
-
- public void removeSequenceGenerator(SequenceGenerator sequenceGenerator) {
- removeSequenceGenerator(this.sequenceGenerators.indexOf(sequenceGenerator));
- }
-
- public void removeSequenceGenerator(int index) {
- OrmSequenceGenerator removedSequenceGenerator = this.sequenceGenerators.remove(index);
- fireItemRemoved(SEQUENCE_GENERATORS_LIST, index, removedSequenceGenerator);
- this.xmlEntityMappings.getSequenceGenerators().remove(index);
- }
-
- protected void removeSequenceGenerator_(OrmSequenceGenerator sequenceGenerator) {
- removeItemFromList(sequenceGenerator, this.sequenceGenerators, EntityMappings.SEQUENCE_GENERATORS_LIST);
- }
-
- public void moveSequenceGenerator(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.sequenceGenerators, targetIndex, sourceIndex);
- this.xmlEntityMappings.getSequenceGenerators().move(targetIndex, sourceIndex);
- fireItemMoved(EntityMappings.SEQUENCE_GENERATORS_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmTableGenerator> tableGenerators() {
- return new CloneListIterator<OrmTableGenerator>(this.tableGenerators);
- }
-
- public int tableGeneratorsSize() {
- return this.tableGenerators.size();
- }
-
- public TableGenerator addTableGenerator(int index) {
- OrmTableGenerator xmlTableGenerator = jpaFactory().buildOrmTableGenerator(this);
- this.tableGenerators.add(index, xmlTableGenerator);
- XmlTableGenerator tableGenerator = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- xmlTableGenerator.initialize(tableGenerator);
- this.xmlEntityMappings.getTableGenerators().add(index, tableGenerator);
- fireItemAdded(TABLE_GENERATORS_LIST, index, xmlTableGenerator);
- return xmlTableGenerator;
- }
-
- protected void addTableGenerator(int index, OrmTableGenerator tableGenerator) {
- addItemToList(index, tableGenerator, this.tableGenerators, EntityMappings.TABLE_GENERATORS_LIST);
- }
-
- public void removeTableGenerator(TableGenerator tableGenerator) {
- removeTableGenerator(this.tableGenerators.indexOf(tableGenerator));
- }
-
- public void removeTableGenerator(int index) {
- OrmTableGenerator removedTableGenerator = this.tableGenerators.remove(index);
- this.xmlEntityMappings.getTableGenerators().remove(index);
- fireItemRemoved(TABLE_GENERATORS_LIST, index, removedTableGenerator);
- }
-
- protected void removeTableGenerator_(OrmTableGenerator tableGenerator) {
- removeItemFromList(tableGenerator, this.tableGenerators, EntityMappings.TABLE_GENERATORS_LIST);
- }
-
- public void moveTableGenerator(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.tableGenerators, targetIndex, sourceIndex);
- this.xmlEntityMappings.getTableGenerators().move(targetIndex, sourceIndex);
- fireItemMoved(EntityMappings.TABLE_GENERATORS_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmNamedQuery> namedQueries() {
- return new CloneListIterator<OrmNamedQuery>(this.namedQueries);
- }
-
- public int namedQueriesSize() {
- return this.namedQueries.size();
- }
-
- public OrmNamedQuery addNamedQuery(int index) {
- OrmNamedQuery namedQuery = jpaFactory().buildOrmNamedQuery(this);
- this.namedQueries.add(index, namedQuery);
- this.xmlEntityMappings.getNamedQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedQuery());
- this.fireItemAdded(EntityMappings.NAMED_QUERIES_LIST, index, namedQuery);
- return namedQuery;
- }
-
- protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);
- }
-
- public void removeNamedQuery(OrmNamedQuery namedQuery) {
- this.removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- OrmNamedQuery namedQuery = this.namedQueries.remove(index);
- this.xmlEntityMappings.getNamedQueries().remove(index);
- fireItemRemoved(EntityMappings.NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- this.xmlEntityMappings.getNamedQueries().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);
- }
-
- public ListIterator<OrmNamedNativeQuery> namedNativeQueries() {
- return new CloneListIterator<OrmNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int namedNativeQueriesSize() {
- return this.namedNativeQueries.size();
- }
-
- public OrmNamedNativeQuery addNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = jpaFactory().buildOrmNamedNativeQuery(this);
- this.namedNativeQueries.add(index, namedNativeQuery);
- this.xmlEntityMappings.getNamedNativeQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- this.fireItemAdded(EntityMappings.NAMED_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void removeNamedNativeQuery(OrmNamedNativeQuery namedNativeQuery) {
- removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
- this.xmlEntityMappings.getNamedNativeQueries().remove(index);
- fireItemRemoved(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- this.xmlEntityMappings.getNamedNativeQueries().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);
- }
-
- //TODO what about qualified name? package + class
- //this needs to be handled both for className and persistentType.getName().
- //moving on for now since I am just trying to get the ui compiled! just a warning that this isn't good api
- public boolean containsPersistentType(String className) {
- for (OrmPersistentType persistentType : CollectionTools.iterable(ormPersistentTypes())) {
- if (persistentType.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- public PersistenceUnitDefaults persistenceUnitDefaults() {
- return getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- protected void initialize(XmlEntityMappings entityMappings) {
- this.xmlEntityMappings = entityMappings;
- this.version = entityMappings.getVersion();
- this.description = entityMappings.getDescription();
- this.package_ = entityMappings.getPackage();
- this.specifiedSchema = entityMappings.getSchema();
- this.specifiedCatalog = entityMappings.getCatalog();
- this.specifiedAccess = this.specifiedAccess(entityMappings);
- this.defaultAccess = persistenceUnit().getDefaultAccess();
- this.defaultCatalog = persistenceUnit().getDefaultCatalog();
- this.defaultSchema = persistenceUnit().getDefaultSchema();
- this.initializePersistentTypes(entityMappings);
- this.initializeTableGenerators(entityMappings);
- this.initializeSequenceGenerators(entityMappings);
- this.initializeNamedQueries(entityMappings);
- this.initializeNamedNativeQueries(entityMappings);
- }
-
- protected void initializePersistentTypes(XmlEntityMappings entityMappings) {
- this.initializeMappedSuperclasses(entityMappings);
- this.initializeEntities(entityMappings);
- this.initializeEmbeddables(entityMappings);
- }
-
- protected void initializeMappedSuperclasses(XmlEntityMappings entityMappings) {
- for (XmlMappedSuperclass mappedSuperclass : entityMappings.getMappedSuperclasses()) {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(mappedSuperclass);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- protected void initializeEntities(XmlEntityMappings entityMappings) {
- for (XmlEntity entity : entityMappings.getEntities()) {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(entity);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- protected void initializeEmbeddables(XmlEntityMappings entityMappings) {
- for (XmlEmbeddable embeddable : entityMappings.getEmbeddables()) {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(embeddable);
- this.persistentTypes.add(ormPersistentType);
- }
- }
-
- protected void initializeTableGenerators(XmlEntityMappings entityMappings) {
- for (XmlTableGenerator tableGenerator : entityMappings.getTableGenerators()) {
- this.tableGenerators.add(buildTableGenerator(tableGenerator));
- }
- }
-
- protected void initializeSequenceGenerators(XmlEntityMappings entityMappings) {
- for (XmlSequenceGenerator sequenceGenerator : entityMappings.getSequenceGenerators()) {
- this.sequenceGenerators.add(buildSequenceGenerator(sequenceGenerator));
- }
- }
-
- protected void initializeNamedQueries(XmlEntityMappings entityMappings) {
- for (XmlNamedQuery namedQuery : entityMappings.getNamedQueries()) {
- this.namedQueries.add(buildNamedQuery(namedQuery));
- }
- }
-
- protected void initializeNamedNativeQueries(XmlEntityMappings entityMappings) {
- for (XmlNamedNativeQuery namedNativeQuery : entityMappings.getNamedNativeQueries()) {
- this.namedNativeQueries.add(buildNamedNativeQuery(namedNativeQuery));
- }
- }
-
- public void update(XmlEntityMappings entityMappings) {
- this.xmlEntityMappings = entityMappings;
- this.setDescription(entityMappings.getDescription());
- this.setPackage(entityMappings.getPackage());
- this.setSpecifiedSchema(entityMappings.getSchema());
- this.setSpecifiedCatalog(entityMappings.getCatalog());
- this.setSpecifiedAccess(this.specifiedAccess(entityMappings));
- this.persistenceUnitMetadata.update(entityMappings);
- this.setDefaultAccess(persistenceUnit().getDefaultAccess());
- this.setDefaultCatalog(persistenceUnit().getDefaultCatalog());
- this.setDefaultSchema(persistenceUnit().getDefaultSchema());
- this.updatePersistentTypes(entityMappings);
- this.updateTableGenerators(entityMappings);
- this.updateSequenceGenerators(entityMappings);
- this.updateNamedQueries(entityMappings);
- this.updateNamedNativeQueries(entityMappings);
- }
-
- protected AccessType specifiedAccess(XmlEntityMappings entityMappings) {
- return AccessType.fromXmlResourceModel(entityMappings.getAccess());
- }
-
- protected void updatePersistentTypes(XmlEntityMappings entityMappings) {
- ListIterator<OrmPersistentType> ormPersistentTypes = this.ormPersistentTypes();
- this.updateMappedSuperclasses(entityMappings, ormPersistentTypes);
- this.updateEntities(entityMappings, ormPersistentTypes);
- this.updateEmbeddables(entityMappings, ormPersistentTypes);
-
- while (ormPersistentTypes.hasNext()) {
- this.removeOrmPersistentType(ormPersistentTypes.next());
- }
- }
-
- protected void updateMappedSuperclasses(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlMappedSuperclass mappedSuperclass : entityMappings.getMappedSuperclasses()) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(mappedSuperclass);
- }
- else {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(mappedSuperclass);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateEntities(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlEntity entity : entityMappings.getEntities()) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(entity);
- }
- else {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(entity);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateEmbeddables(XmlEntityMappings entityMappings, ListIterator<OrmPersistentType> ormPersistentTypes) {
- for (XmlEmbeddable embeddable : entityMappings.getEmbeddables()) {
- if (ormPersistentTypes.hasNext()) {
- ormPersistentTypes.next().update(embeddable);
- }
- else {
- OrmPersistentType ormPersistentType = jpaFactory().buildOrmPersistentType(this, MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- ormPersistentType.initialize(embeddable);
- addOrmPersistentType(ormPersistentType);
- }
- }
- }
-
- protected void updateTableGenerators(XmlEntityMappings entityMappings) {
- ListIterator<OrmTableGenerator> tableGenerators = tableGenerators();
- ListIterator<XmlTableGenerator> resourceTableGenerators = entityMappings.getTableGenerators().listIterator();
- while (tableGenerators.hasNext()) {
- OrmTableGenerator tableGenerator = tableGenerators.next();
- if (resourceTableGenerators.hasNext()) {
- tableGenerator.update(resourceTableGenerators.next());
- }
- else {
- removeTableGenerator(tableGenerator);
- }
- }
-
- while (resourceTableGenerators.hasNext()) {
- addTableGenerator(tableGeneratorsSize(), buildTableGenerator(resourceTableGenerators.next()));
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator tableGeneratorResource) {
- OrmTableGenerator tableGenerator = jpaFactory().buildOrmTableGenerator(this);
- tableGenerator.initialize(tableGeneratorResource);
- return tableGenerator;
- }
-
- protected void updateSequenceGenerators(XmlEntityMappings entityMappings) {
- ListIterator<OrmSequenceGenerator> sequenceGenerators = sequenceGenerators();
- ListIterator<XmlSequenceGenerator> resourceSequenceGenerators = entityMappings.getSequenceGenerators().listIterator();
- while (sequenceGenerators.hasNext()) {
- OrmSequenceGenerator sequenceGenerator = sequenceGenerators.next();
- if (resourceSequenceGenerators.hasNext()) {
- sequenceGenerator.update(resourceSequenceGenerators.next());
- }
- else {
- removeSequenceGenerator(sequenceGenerator);
- }
- }
-
- while (resourceSequenceGenerators.hasNext()) {
- addSequenceGenerator(sequenceGeneratorsSize(), buildSequenceGenerator(resourceSequenceGenerators.next()));
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator sequenceGeneratorResource) {
- OrmSequenceGenerator sequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- sequenceGenerator.initialize(sequenceGeneratorResource);
- return sequenceGenerator;
- }
-
- protected void updateNamedQueries(XmlEntityMappings entityMappings) {
- ListIterator<OrmNamedQuery> namedQueries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = entityMappings.getNamedQueries().listIterator();
-
- while (namedQueries.hasNext()) {
- OrmNamedQuery namedQuery = namedQueries.next();
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update(resourceNamedQueries.next());
- }
- else {
- removeNamedQuery(namedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(namedQueriesSize(), buildNamedQuery(resourceNamedQueries.next()));
- }
- }
-
- protected OrmNamedQuery buildNamedQuery(XmlNamedQuery namedQuery) {
- OrmNamedQuery ormNamedQuery = jpaFactory().buildOrmNamedQuery(this);
- ormNamedQuery.initialize(namedQuery);
- return ormNamedQuery;
- }
-
- protected void updateNamedNativeQueries(XmlEntityMappings entityMappings) {
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = entityMappings.getNamedNativeQueries().listIterator();
-
- while (namedNativeQueries.hasNext()) {
- OrmNamedNativeQuery namedQuery = namedNativeQueries.next();
- if (resourceNamedNativeQueries.hasNext()) {
- namedQuery.update(resourceNamedNativeQueries.next());
- }
- else {
- removeNamedNativeQuery(namedQuery);
- }
- }
-
- while (resourceNamedNativeQueries.hasNext()) {
- addNamedNativeQuery(namedQueriesSize(), buildNamedNativeQuery(resourceNamedNativeQueries.next()));
- }
- }
-
- protected OrmNamedNativeQuery buildNamedNativeQuery(XmlNamedNativeQuery namedQuery) {
- OrmNamedNativeQuery ormNamedNativeQuery =jpaFactory().buildOrmNamedNativeQuery(this);
- ormNamedNativeQuery.initialize(namedQuery);
- return ormNamedNativeQuery;
- }
-
-
- // *************************************************************************
-
- public JpaStructureNode structureNode(int textOffset) {
- for (OrmPersistentType persistentType: CollectionTools.iterable(ormPersistentTypes())) {
- if (persistentType.contains(textOffset)) {
- return persistentType.structureNode(textOffset);
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (xmlEntityMappings == null) {
- return false;
- }
- return xmlEntityMappings.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- return xmlEntityMappings.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- return null;
- }
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- for (OrmPersistentType ormPersistentType : CollectionTools.iterable(this.ormPersistentTypes())) {
- ormPersistentType.addToMessages(messages);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
deleted file mode 100644
index 24674f613e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAssociationOverride.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class GenericOrmAssociationOverride extends AbstractOrmJpaContextNode
- implements OrmAssociationOverride
-{
-
- protected String name;
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
-
- protected final List<OrmJoinColumn> defaultJoinColumns;
-
- private final AssociationOverride.Owner owner;
-
- protected XmlAssociationOverride associationOverride;
-
-
- public GenericOrmAssociationOverride(OrmJpaContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride associationOverride) {
- super(parent);
- this.owner = owner;
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- this.defaultJoinColumns = new ArrayList<OrmJoinColumn>();
- this.initialize(associationOverride);
- }
-
- public Owner owner() {
- return this.owner;
- }
-
- // ********** IAssociationOverride implementation **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.associationOverride.setName(newName);
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public ListIterator<OrmJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- OrmJoinColumn joinColumn = jpaFactory().buildOrmJoinColumn(this, createJoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- this.associationOverride.getJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- this.fireItemAdded(AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected OrmJoinColumn.Owner createJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- this.associationOverride.getJoinColumns().remove(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- this.associationOverride.getJoinColumns().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.specifiedJoinColumns, AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- protected void initialize(XmlAssociationOverride associationOverride) {
- this.associationOverride = associationOverride;
- this.name = associationOverride.getName();
- initializeSpecifiedJoinColumns(associationOverride);
- }
-
- protected void initializeSpecifiedJoinColumns(XmlAssociationOverride associationOverride) {
- for (XmlJoinColumn joinColumn : associationOverride.getJoinColumns()) {
- this.specifiedJoinColumns.add(createJoinColumn(joinColumn));
- }
- }
-
- public void update(XmlAssociationOverride associationOverride) {
- this.associationOverride = associationOverride;
- this.setName(associationOverride.getName());
- updateSpecifiedJoinColumns(associationOverride);
- }
-
- protected void updateSpecifiedJoinColumns(XmlAssociationOverride associationOverride) {
- ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = associationOverride.getJoinColumns().listIterator();
-
- while (joinColumns.hasNext()) {
- OrmJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected OrmJoinColumn createJoinColumn(XmlJoinColumn joinColumn) {
- OrmJoinColumn ormJoinColumn = jpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner());
- ormJoinColumn.initialize(joinColumn);
- return ormJoinColumn;
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- class JoinColumnOwner implements OrmJoinColumn.Owner
- {
-
- public JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String defaultTableName() {
- return GenericOrmAssociationOverride.this.owner.typeMapping().tableName();
- }
-
- public String defaultColumnName() {
- return null;
- }
-
- public Entity targetEntity() {
- RelationshipMapping relationshipMapping = relationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return GenericOrmAssociationOverride.this.getName();
- }
-
- public RelationshipMapping relationshipMapping() {
- return GenericOrmAssociationOverride.this.owner.relationshipMapping(GenericOrmAssociationOverride.this.getName());
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return typeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public TypeMapping typeMapping() {
- return GenericOrmAssociationOverride.this.owner.typeMapping();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericOrmAssociationOverride.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public int joinColumnsSize() {
- return GenericOrmAssociationOverride.this.joinColumnsSize();
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java
deleted file mode 100644
index 4f78c2f513..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmAttributeOverride.java
+++ /dev/null
@@ -1,133 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.db.internal.Table;
-
-
-public class GenericOrmAttributeOverride extends AbstractOrmJpaContextNode
- implements OrmAttributeOverride, OrmColumn.Owner
-{
-
- protected String name;
-
- private final Owner owner;
-
- protected XmlAttributeOverride attributeOverride;
-
-
- protected final OrmColumn column;
-
- public GenericOrmAttributeOverride(OrmJpaContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
- super(parent);
- this.owner = owner;
- this.column = jpaFactory().buildOrmColumn(this, this);
- this.initialize(xmlAttributeOverride);
- }
-
- public Owner owner() {
- return this.owner;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.attributeOverride.setName(newName);
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public TypeMapping typeMapping() {
- return owner().typeMapping();
- }
-
- public Table dbTable(String tablename) {
- return this.typeMapping().dbTable(getColumn().getTable());
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String defaultTableName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
-// @Override
-// public ITextRange validationTextRange() {
-// if (node == null) {
-// return getOwner().validationTextRange();
-// }
-// return super.validationTextRange();
-// }
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- //***************** IXmlColumn.Owner implementation ****************
-
- public XmlColumn columnResource() {
- return this.attributeOverride.getColumn();
- }
-
- public void addColumnResource() {
- this.attributeOverride.setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeColumnResource() {
- this.attributeOverride.setColumn(null);
- }
-
-
- //***************** updating ****************
-
- protected void initialize(XmlAttributeOverride attributeOverride) {
- this.attributeOverride = attributeOverride;
- this.name = attributeOverride.getName();
- this.column.initialize(attributeOverride.getColumn());
- }
-
- public void update(XmlAttributeOverride attributeOverride) {
- this.attributeOverride = attributeOverride;
- this.setName_(attributeOverride.getName());
- this.column.update(attributeOverride.getColumn());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.java
deleted file mode 100644
index d94b8f54df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmBasicMapping.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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmBasicMapping extends AbstractOrmAttributeMapping<XmlBasic>
- implements OrmBasicMapping
-{
- protected final OrmColumn column;
-
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected EnumType specifiedEnumerated;
-
- protected TemporalType temporal;
-
- protected boolean lob;
-
- public GenericOrmBasicMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = jpaFactory().buildOrmColumn(this, this);
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return BasicMapping.DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.attributeMapping().setFetch(FetchType.toOrmResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- public Boolean getOptional() {
- return (this.getSpecifiedOptional() == null) ? this.getDefaultOptional() : this.getSpecifiedOptional();
- }
-
- public Boolean getDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- this.attributeMapping().setOptional(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- protected void setSpecifiedOptional_(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- public boolean isLob() {
- return this.lob;
- }
-
- public void setLob(boolean newLob) {
- boolean oldLob = this.lob;
- this.lob = newLob;
- this.attributeMapping().setLob(newLob);
- firePropertyChanged(BasicMapping.LOB_PROPERTY, oldLob, newLob);
- }
-
- protected void setLob_(boolean newLob) {
- boolean oldLob = this.lob;
- this.lob = newLob;
- firePropertyChanged(BasicMapping.LOB_PROPERTY, oldLob, newLob);
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.attributeMapping().setTemporal(TemporalType.toOrmResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- protected void setTemporal_(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- public EnumType getEnumerated() {
- return (this.getSpecifiedEnumerated() == null) ? this.getDefaultEnumerated() : this.getSpecifiedEnumerated();
- }
-
- public EnumType getDefaultEnumerated() {
- return BasicMapping.DEFAULT_ENUMERATED;
- }
-
- public EnumType getSpecifiedEnumerated() {
- return this.specifiedEnumerated;
- }
-
- public void setSpecifiedEnumerated(EnumType newSpecifiedEnumerated) {
- EnumType oldEnumerated = this.specifiedEnumerated;
- this.specifiedEnumerated = newSpecifiedEnumerated;
- this.attributeMapping().setEnumerated(EnumType.toOrmResourceModel(newSpecifiedEnumerated));
- firePropertyChanged(BasicMapping.SPECIFIED_ENUMERATED_PROPERTY, oldEnumerated, newSpecifiedEnumerated);
- }
-
- protected void setSpecifiedEnumerated_(EnumType newSpecifiedEnumerated) {
- EnumType oldEnumerated = this.specifiedEnumerated;
- this.specifiedEnumerated = newSpecifiedEnumerated;
- firePropertyChanged(BasicMapping.SPECIFIED_ENUMERATED_PROPERTY, oldEnumerated, newSpecifiedEnumerated);
- }
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmBasicMapping(this);
- }
-
-
- @Override
- public void initializeFromXmlColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromXmlColumnMapping(oldMapping);
- setTemporal(oldMapping.getTemporal());
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
- public int xmlSequence() {
- return 1;
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- @Override
- public void initialize(XmlBasic basic) {
- super.initialize(basic);
- this.specifiedFetch = this.specifiedFetch(basic);
- this.specifiedOptional = this.specifiedOptional(basic);
- this.specifiedEnumerated = this.specifiedEnumerated(basic);
- this.temporal = this.specifiedTemporal(basic);
- this.lob = specifiedLob(basic);
- this.column.initialize(basic.getColumn());
- }
-
- @Override
- public void update(XmlBasic basic) {
- super.update(basic);
- this.setSpecifiedFetch_(this.specifiedFetch(basic));
- this.setSpecifiedOptional_(this.specifiedOptional(basic));
- this.setSpecifiedEnumerated_(this.specifiedEnumerated(basic));
- this.setTemporal_(this.specifiedTemporal(basic));
- this.setLob_(this.specifiedLob(basic));
- this.column.update(basic.getColumn());
- }
-
- protected Boolean specifiedOptional(XmlBasic basic) {
- return basic.getOptional();
- }
-
- protected FetchType specifiedFetch(XmlBasic basic) {
- return FetchType.fromOrmResourceModel(basic.getFetch());
- }
-
- protected EnumType specifiedEnumerated(XmlBasic basic) {
- return EnumType.fromOrmResourceModel(basic.getEnumerated());
- }
-
- protected TemporalType specifiedTemporal(XmlBasic basic) {
- return TemporalType.fromOrmResourceModel(basic.getTemporal());
- }
-
- protected boolean specifiedLob(XmlBasic basic) {
- return basic.isLob();
- }
-
- public XmlBasic addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlBasic basic = OrmFactory.eINSTANCE.createXmlBasicImpl();
- persistentAttribute().initialize(basic);
- typeMapping.getAttributes().getBasics().add(basic);
- return basic;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getBasics().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- //***************** IXmlColumn.Owner implementation ****************
-
- public XmlColumn columnResource() {
- return this.attributeMapping().getColumn();
- }
-
- public void addColumnResource() {
- this.attributeMapping().setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeColumnResource() {
- this.attributeMapping().setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- if (entityOwned()) {
- addColumnMessages(messages);
- }
- }
-
- protected void addColumnMessages(List<IMessage> messages) {
- OrmColumn column = getColumn();
- String table = column.getTable();
- boolean doContinue = isConnected();
-
- if (doContinue && typeMapping().tableNameIsInvalid(table)) {
- if (persistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE,
- new String[] {getName(), table, column.getName()},
- column,
- column.tableTextRange())
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_TABLE,
- new String[] {table, column.getName()},
- column,
- column.tableTextRange())
- );
- }
- doContinue = false;
- }
-
- if (doContinue && ! column.isResolved()) {
- if (persistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {getName(), column.getName()},
- column,
- column.nameTextRange())
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName()},
- column,
- column.nameTextRange())
- );
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java
deleted file mode 100644
index f2bfb623c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmColumn.java
+++ /dev/null
@@ -1,191 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-public class GenericOrmColumn extends AbstractOrmColumn<XmlColumn> implements OrmColumn
-{
- protected Integer specifiedLength;
-
- protected Integer specifiedPrecision;
-
- protected Integer specifiedScale;
-
- public GenericOrmColumn(OrmJpaContextNode parent, OrmColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public OrmColumn.Owner owner() {
- return (OrmColumn.Owner) super.owner();
- }
-
- public void initializeFrom(Column oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedLength(oldColumn.getSpecifiedLength());
- setSpecifiedPrecision(oldColumn.getSpecifiedPrecision());
- setSpecifiedScale(oldColumn.getSpecifiedScale());
- }
-
- public Integer getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return Column.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (oldSpecifiedLength != newSpecifiedLength) {
- if (this.columnResource() != null) {
- this.columnResource().setLength(newSpecifiedLength);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedLength != null) {
- addColumnResource();
- columnResource().setLength(newSpecifiedLength);
- }
- }
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- public Integer getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision();
- }
-
- public Integer getDefaultPrecision() {
- return Column.DEFAULT_PRECISION;
- }
-
- public Integer getSpecifiedPrecision() {
- return this.specifiedPrecision;
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- if (oldSpecifiedPrecision != newSpecifiedPrecision) {
- if (this.columnResource() != null) {
- this.columnResource().setPrecision(newSpecifiedPrecision);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedPrecision != null) {
- addColumnResource();
- columnResource().setPrecision(newSpecifiedPrecision);
- }
- }
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- protected void setSpecifiedPrecision_(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- public Integer getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale();
- }
-
- public Integer getDefaultScale() {
- return Column.DEFAULT_SCALE;
- }
-
- public Integer getSpecifiedScale() {
- return this.specifiedScale;
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- if (oldSpecifiedScale != newSpecifiedScale) {
- if (this.columnResource() != null) {
- this.columnResource().setScale(newSpecifiedScale);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedScale != null) {
- addColumnResource();
- columnResource().setScale(newSpecifiedScale);
- }
- }
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- protected void setSpecifiedScale_(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- @Override
- protected XmlColumn columnResource() {
- return owner().columnResource();
- }
-
- @Override
- protected void addColumnResource() {
- owner().addColumnResource();
- }
-
- @Override
- protected void removeColumnResource() {
- owner().removeColumnResource();
- }
-
- @Override
- public void initialize(XmlColumn column) {
- super.initialize(column);
- this.specifiedLength = this.specifiedLength(column);
- this.specifiedPrecision = this.specifiedPrecision(column);
- this.specifiedScale = this.specifiedScale(column);
- }
-
- @Override
- public void update(XmlColumn column) {
- super.update(column);
- this.setSpecifiedLength_(this.specifiedLength(column));
- this.setSpecifiedPrecision_(this.specifiedPrecision(column));
- this.setSpecifiedScale_(this.specifiedScale(column));
- }
-
- protected Integer specifiedLength(XmlColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected Integer specifiedPrecision(XmlColumn column) {
- return column == null ? null : column.getPrecision();
- }
-
- protected Integer specifiedScale(XmlColumn column) {
- return column == null ? null : column.getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.java
deleted file mode 100644
index ee6d11594f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmDiscriminatorColumn.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-public class GenericOrmDiscriminatorColumn extends AbstractOrmNamedColumn<XmlDiscriminatorColumn>
- implements OrmDiscriminatorColumn
-{
-
- protected DiscriminatorType specifiedDiscriminatorType;
-
- protected DiscriminatorType defaultDiscriminatorType;
-
-// protected static final int DEFAULT_LENGTH_EDEFAULT = 31;
-
- protected Integer defaultLength;
-
- protected Integer specifiedLength;
-
- protected XmlEntity entity;
-
- public GenericOrmDiscriminatorColumn(OrmJpaContextNode parent, OrmNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public DiscriminatorType getSpecifiedDiscriminatorType() {
- return this.specifiedDiscriminatorType;
- }
-
- public void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- if (oldDiscriminatorType != newSpecifiedDiscriminatorType) {
- if (this.columnResource() != null) {
- this.columnResource().setDiscriminatorType(DiscriminatorType.toOrmResourceModel(newSpecifiedDiscriminatorType));
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedDiscriminatorType != null) {
- addColumnResource();
- this.columnResource().setDiscriminatorType(DiscriminatorType.toOrmResourceModel(newSpecifiedDiscriminatorType));
- }
- }
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- protected void setSpecifiedDiscriminatorType_(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- public Integer getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength();
- }
-
- public Integer getDefaultLength() {
- return this.defaultLength;
- }
-
- protected void setDefaultLength(Integer newDefaultLength) {
- Integer oldDefaultLength = this.defaultLength;
- this.defaultLength = newDefaultLength;
- firePropertyChanged(DEFAULT_LENGTH_PROPERTY, oldDefaultLength, newDefaultLength);
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (oldSpecifiedLength != newSpecifiedLength) {
- if (this.columnResource() != null) {
- this.columnResource().setLength(newSpecifiedLength);
- if (this.columnResource().isAllFeaturesUnset()) {
- removeColumnResource();
- }
- }
- else if (newSpecifiedLength != null) {
- addColumnResource();
- columnResource().setLength(newSpecifiedLength);
- }
- }
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- @Override
- protected String tableName() {
- return this.owner().typeMapping().tableName();
- }
-
-
-
- @Override
- protected XmlDiscriminatorColumn columnResource() {
- return this.entity.getDiscriminatorColumn();
- }
-
- @Override
- protected void addColumnResource() {
- this.entity.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- }
-
- @Override
- protected void removeColumnResource() {
- this.entity.setDiscriminatorColumn(null);
- }
-
- public void initialize(XmlEntity entity) {
- this.entity = entity;
- this.initialize(this.columnResource());
- }
-
- public void update(XmlEntity entity) {
- this.entity = entity;
- this.update(this.columnResource());
- }
-
-
- @Override
- protected void initialize(XmlDiscriminatorColumn column) {
- super.initialize(column);
- this.specifiedLength = this.specifiedLength(column);
- this.specifiedDiscriminatorType = this.specifiedDiscriminatorType(column);
- //TODO defaultLength, discriminator type java column
- }
-
- @Override
- protected void update(XmlDiscriminatorColumn column) {
- super.update(column);
- this.setSpecifiedLength_(this.specifiedLength(column));
- this.setSpecifiedDiscriminatorType_(this.specifiedDiscriminatorType(column));
- //TODO defaultLength, scale, precision from java column
- }
-
- protected Integer specifiedLength(XmlDiscriminatorColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected DiscriminatorType specifiedDiscriminatorType(XmlDiscriminatorColumn column) {
- return column == null ? null : DiscriminatorType.fromOrmResourceModel(column.getDiscriminatorType());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java
deleted file mode 100644
index 4e24f52cb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddable.java
+++ /dev/null
@@ -1,71 +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.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public class GenericOrmEmbeddable extends AbstractOrmTypeMapping<XmlEmbeddable> implements OrmEmbeddable
-{
- public GenericOrmEmbeddable(OrmPersistentType parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public int xmlSequence() {
- return 2;
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- protected Boolean metadataComplete(XmlEmbeddable embeddable) {
- return embeddable.getMetadataComplete();
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEmbeddables().remove(this.typeMappingResource());
- }
-
- public XmlEmbeddable addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable();
- persistentType().initialize(embeddable);
- entityMappings.getEmbeddables().add(embeddable);
- return embeddable;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java
deleted file mode 100644
index bafe7784f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedIdMapping.java
+++ /dev/null
@@ -1,316 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public class GenericOrmEmbeddedIdMapping extends AbstractOrmAttributeMapping<XmlEmbeddedId> implements OrmEmbeddedIdMapping
-{
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> defaultAttributeOverrides;
-
- private Embeddable embeddable;
-
- public GenericOrmEmbeddedIdMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmEmbeddedIdMapping(this);
- }
-
- @Override
- public void initializeFromOrmEmbeddedMapping(OrmEmbeddedMapping oldMapping) {
- super.initializeFromOrmEmbeddedMapping(oldMapping);
- int index = 0;
- for (AttributeOverride attributeOverride : CollectionTools.iterable(oldMapping.specifiedAttributeOverrides())) {
- OrmAttributeOverride newAttributeOverride = addSpecifiedAttributeOverride(index++);
- newAttributeOverride.setName(attributeOverride.getName());
- newAttributeOverride.getColumn().initializeFrom(attributeOverride.getColumn());
- }
- }
-
- public int xmlSequence() {
- return 7;
- }
-
- //*************** AttributeMapping implementation *********************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
-
- //*************** EmbeddedIdMapping implementation *********************
- public ListIterator<OrmAttributeOverride> attributeOverrides() {
- //TODO attribute overrides
- return EmptyListIterator.instance();
- }
-
- public int attributeOverridesSize() {
- // TODO attributes overrides size
- return 0;
- }
-
- public ListIterator<OrmAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<OrmAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public OrmAttributeOverride addSpecifiedAttributeOverride(int index) {
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- OrmAttributeOverride attributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- this.attributeMapping().getAttributeOverrides().add(index, xmlAttributeOverride);
- this.fireItemAdded(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- OrmAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
- this.attributeMapping().getAttributeOverrides().remove(index);
- fireItemRemoved(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.attributeMapping().getAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(EmbeddedIdMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public boolean isVirtual(BaseOverride override) {
- return this.defaultAttributeOverrides.contains(override);
- }
-
- public ColumnMapping columnMapping(String attributeName) {
- return GenericJavaEmbeddedMapping.columnMapping(attributeName, embeddable());
- }
-
-//
-// public EList<IAttributeOverride> getAttributeOverrides() {
-// EList<IAttributeOverride> list = new EObjectEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
-// list.addAll(getSpecifiedAttributeOverrides());
-// list.addAll(getDefaultAttributeOverrides());
-// return list;
-// }
-//
-// public EList<IAttributeOverride> getSpecifiedAttributeOverrides() {
-// if (specifiedAttributeOverrides == null) {
-// specifiedAttributeOverrides = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES);
-// }
-// return specifiedAttributeOverrides;
-// }
-//
-// public EList<IAttributeOverride> getDefaultAttributeOverrides() {
-// if (defaultAttributeOverrides == null) {
-// defaultAttributeOverrides = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES);
-// }
-// return defaultAttributeOverrides;
-// }
-//
-// public IEmbeddable embeddable() {
-// return this.embeddable;
-// }
-//
-// public IAttributeOverride attributeOverrideNamed(String name) {
-// return (IAttributeOverride) overrideNamed(name, getAttributeOverrides());
-// }
-//
-// public boolean containsAttributeOverride(String name) {
-// return containsOverride(name, getAttributeOverrides());
-// }
-//
-// public boolean containsSpecifiedAttributeOverride(String name) {
-// return containsOverride(name, getSpecifiedAttributeOverrides());
-// }
-//
-// private IOverride overrideNamed(String name, List<? extends IOverride> overrides) {
-// for (IOverride override : overrides) {
-// String overrideName = override.getName();
-// if (overrideName == null && name == null) {
-// return override;
-// }
-// if (overrideName != null && overrideName.equals(name)) {
-// return override;
-// }
-// }
-// return null;
-// }
-//
-// private boolean containsOverride(String name, List<? extends IOverride> overrides) {
-// return overrideNamed(name, overrides) != null;
-// }
-//
-// public Iterator<String> allOverridableAttributeNames() {
-// return new TransformationIterator<IPersistentAttribute, String>(this.allOverridableAttributes()) {
-// @Override
-// protected String transform(IPersistentAttribute attribute) {
-// return attribute.getName();
-// }
-// };
-// }
-//
-// public Iterator<IPersistentAttribute> allOverridableAttributes() {
-// if (this.embeddable() == null) {
-// return EmptyIterator.instance();
-// }
-// return new FilteringIterator<IPersistentAttribute>(this.embeddable().getPersistentType().attributes()) {
-// @Override
-// protected boolean accept(Object o) {
-// return ((IPersistentAttribute) o).isOverridableAttribute();
-// }
-// };
-// }
-//
-// public IAttributeOverride createAttributeOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAttributeOverride(new AttributeOverrideOwner(this));
-// }
-//
-
-
- public Embeddable embeddable() {
- return this.embeddable;
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.embeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.embeddable().persistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public void initialize(XmlEmbeddedId embeddedId) {
- super.initialize(embeddedId);
- this.initializeSpecifiedAttributeOverrides(embeddedId);
- }
-
- protected void initializeSpecifiedAttributeOverrides(XmlEmbeddedId embeddedId) {
- for (XmlAttributeOverride attributeOverride : embeddedId.getAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return jpaFactory().buildOrmAttributeOverride(this, this, attributeOverride);
- }
-
-
- @Override
- public void update(XmlEmbeddedId embeddedId) {
- super.update(embeddedId);
- this.updateSpecifiedAttributeOverrides(embeddedId);
- }
-
- protected void updateSpecifiedAttributeOverrides(XmlEmbeddedId embeddedId) {
- ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = embeddedId.getAttributeOverrides().listIterator();
-
- while (attributeOverrides.hasNext()) {
- OrmAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update(resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), buildAttributeOverride(resourceAttributeOverrides.next()));
- }
- }
-
- public XmlEmbeddedId addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlEmbeddedId embeddedId = OrmFactory.eINSTANCE.createXmlEmbeddedIdImpl();
- persistentAttribute().initialize(embeddedId);
- typeMapping.getAttributes().getEmbeddedIds().add(embeddedId);
- return embeddedId;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getEmbeddedIds().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java
deleted file mode 100644
index 9124f44a41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEmbeddedMapping.java
+++ /dev/null
@@ -1,330 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public class GenericOrmEmbeddedMapping extends AbstractOrmAttributeMapping<XmlEmbedded> implements OrmEmbeddedMapping
-{
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> defaultAttributeOverrides;
-
- private Embeddable embeddable;
-
- public GenericOrmEmbeddedMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmEmbeddedMapping(this);
- }
-
- @Override
- public void initializeFromOrmEmbeddedIdMapping(OrmEmbeddedIdMapping oldMapping) {
- super.initializeFromOrmEmbeddedIdMapping(oldMapping);
- int index = 0;
- for (OrmAttributeOverride attributeOverride : CollectionTools.iterable(oldMapping.specifiedAttributeOverrides())) {
- OrmAttributeOverride newAttributeOverride = addSpecifiedAttributeOverride(index++);
- newAttributeOverride.setName(attributeOverride.getName());
- newAttributeOverride.getColumn().initializeFrom(attributeOverride.getColumn());
- }
- }
-
- public int xmlSequence() {
- return 7;
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<OrmAttributeOverride>(specifiedAttributeOverrides(), defaultAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public ListIterator<OrmAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<OrmAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public OrmAttributeOverride addSpecifiedAttributeOverride(int index) {
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- OrmAttributeOverride attributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- this.attributeMapping().getAttributeOverrides().add(index, xmlAttributeOverride);
- this.fireItemAdded(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- OrmAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
- this.attributeMapping().getAttributeOverrides().remove(index);
- fireItemRemoved(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.attributeMapping().getAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public boolean isVirtual(BaseOverride override) {
- return this.defaultAttributeOverrides.contains(override);
- }
-
- public ColumnMapping columnMapping(String attributeName) {
- return GenericJavaEmbeddedMapping.columnMapping(attributeName, embeddable());
- }
-
-//
-// public EList<IAttributeOverride> getAttributeOverrides() {
-// EList<IAttributeOverride> list = new EObjectEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
-// list.addAll(getSpecifiedAttributeOverrides());
-// list.addAll(getDefaultAttributeOverrides());
-// return list;
-// }
-//
-// public EList<IAttributeOverride> getSpecifiedAttributeOverrides() {
-// if (specifiedAttributeOverrides == null) {
-// specifiedAttributeOverrides = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__SPECIFIED_ATTRIBUTE_OVERRIDES);
-// }
-// return specifiedAttributeOverrides;
-// }
-//
-// public EList<IAttributeOverride> getDefaultAttributeOverrides() {
-// if (defaultAttributeOverrides == null) {
-// defaultAttributeOverrides = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__DEFAULT_ATTRIBUTE_OVERRIDES);
-// }
-// return defaultAttributeOverrides;
-// }
-//
-// public IEmbeddable embeddable() {
-// return this.embeddable;
-// }
-//
-// public IAttributeOverride attributeOverrideNamed(String name) {
-// return (IAttributeOverride) overrideNamed(name, getAttributeOverrides());
-// }
-//
-// public boolean containsAttributeOverride(String name) {
-// return containsOverride(name, getAttributeOverrides());
-// }
-//
-// public boolean containsSpecifiedAttributeOverride(String name) {
-// return containsOverride(name, getSpecifiedAttributeOverrides());
-// }
-//
-// private IOverride overrideNamed(String name, List<? extends IOverride> overrides) {
-// for (IOverride override : overrides) {
-// String overrideName = override.getName();
-// if (overrideName == null && name == null) {
-// return override;
-// }
-// if (overrideName != null && overrideName.equals(name)) {
-// return override;
-// }
-// }
-// return null;
-// }
-//
-// private boolean containsOverride(String name, List<? extends IOverride> overrides) {
-// return overrideNamed(name, overrides) != null;
-// }
-//
-// public Iterator<String> allOverridableAttributeNames() {
-// return new TransformationIterator<IPersistentAttribute, String>(this.allOverridableAttributes()) {
-// @Override
-// protected String transform(IPersistentAttribute attribute) {
-// return attribute.getName();
-// }
-// };
-// }
-//
-// public Iterator<IPersistentAttribute> allOverridableAttributes() {
-// if (this.embeddable() == null) {
-// return EmptyIterator.instance();
-// }
-// return new FilteringIterator<IPersistentAttribute>(this.embeddable().getPersistentType().attributes()) {
-// @Override
-// protected boolean accept(Object o) {
-// return ((IPersistentAttribute) o).isOverridableAttribute();
-// }
-// };
-// }
-//
-// public IAttributeOverride createAttributeOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAttributeOverride(new AttributeOverrideOwner(this));
-// }
-
-
- public Embeddable embeddable() {
- return this.embeddable;
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new TransformationIterator<PersistentAttribute, String>(this.allOverridableAttributes()) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public Iterator<PersistentAttribute> allOverridableAttributes() {
- if (this.embeddable() == null) {
- return EmptyIterator.instance();
- }
- return new FilteringIterator<PersistentAttribute, PersistentAttribute>(this.embeddable().persistentType().attributes()) {
- @Override
- protected boolean accept(PersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public void initialize(XmlEmbedded embedded) {
- super.initialize(embedded);
- this.embeddable = embeddableFor(javaPersistentAttribute());
- this.initializeSpecifiedAttributeOverrides(embedded);
- }
-
- protected void initializeSpecifiedAttributeOverrides(XmlEmbedded embedded) {
- for (XmlAttributeOverride attributeOverride : embedded.getAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-//
-// protected void initializeDefaultAttributeOverrides(JavaPersistentAttributeResource persistentAttributeResource) {
-// for (Iterator<String> i = allOverridableAttributeNames(); i.hasNext(); ) {
-// String attributeName = i.next();
-// XmlAttributeOverride attributeOverride = attributeOverrideNamed(attributeName);
-// if (attributeOverride == null) {
-// attributeOverride = createAttributeOverride(new NullAttributeOverride(persistentAttributeResource));
-// attributeOverride.setName(attributeName);
-// this.defaultAttributeOverrides.add(attributeOverride);
-// }
-// }
-// }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return jpaFactory().buildOrmAttributeOverride(this, this, attributeOverride);
- }
-
-
- @Override
- public void update(XmlEmbedded embedded) {
- super.update(embedded);
- this.embeddable = embeddableFor(javaPersistentAttribute());
- this.updateSpecifiedAttributeOverrides(embedded);
- }
-
- protected void updateSpecifiedAttributeOverrides(XmlEmbedded embedded) {
- ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = embedded.getAttributeOverrides().listIterator();
-
- while (attributeOverrides.hasNext()) {
- OrmAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update(resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), buildAttributeOverride(resourceAttributeOverrides.next()));
- }
- }
-
- public XmlEmbedded addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlEmbedded embedded = OrmFactory.eINSTANCE.createXmlEmbeddedImpl();
- persistentAttribute().initialize(embedded);
- typeMapping.getAttributes().getEmbeddeds().add(embedded);
- return embedded;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getEmbeddeds().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- //******* static methods *********
- public static Embeddable embeddableFor(JavaPersistentAttribute javaPersistentAttribute) {
- if (javaPersistentAttribute == null) {
- return null;
- }
- return GenericJavaEmbeddedMapping.embeddableFor(javaPersistentAttribute);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
deleted file mode 100644
index 903a0d5220..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmEntity.java
+++ /dev/null
@@ -1,1565 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmAbstractJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.IdClass;
-import org.eclipse.jpt.core.resource.orm.Inheritance;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmEntity extends AbstractOrmTypeMapping<XmlEntity> implements OrmEntity
-{
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String idClass;
-
- protected final OrmTable table;
-
- protected final List<OrmSecondaryTable> specifiedSecondaryTables;
-
- protected final List<OrmSecondaryTable> virtualSecondaryTables;
-
- protected final List<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected final List<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns;
-
- protected InheritanceType specifiedInheritanceStrategy;
-
- protected InheritanceType defaultInheritanceStrategy;
-
- protected String defaultDiscriminatorValue;
-
- protected String specifiedDiscriminatorValue;
-
- protected boolean discriminatorValueAllowed;
-
- protected final OrmDiscriminatorColumn discriminatorColumn;
-
- protected OrmSequenceGenerator sequenceGenerator;
-
- protected OrmTableGenerator tableGenerator;
-
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> defaultAttributeOverrides;
-
- protected final List<OrmAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<OrmAssociationOverride> defaultAssociationOverrides;
-
- protected final List<OrmNamedQuery> namedQueries;
-
- protected final List<OrmNamedNativeQuery> namedNativeQueries;
-
- public GenericOrmEntity(OrmPersistentType parent) {
- super(parent);
- this.table = jpaFactory().buildOrmTable(this);
- this.specifiedSecondaryTables = new ArrayList<OrmSecondaryTable>();
- this.virtualSecondaryTables = new ArrayList<OrmSecondaryTable>();
- this.discriminatorColumn = buildDiscriminatorColumn();
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- this.defaultPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- this.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.defaultAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.specifiedAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.defaultAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.namedQueries = new ArrayList<OrmNamedQuery>();
- this.namedNativeQueries = new ArrayList<OrmNamedNativeQuery>();
- }
-
- protected OrmDiscriminatorColumn buildDiscriminatorColumn() {
- return jpaFactory().buildOrmDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected OrmNamedColumn.Owner buildDiscriminatorColumnOwner() {
- return new OrmNamedColumn.Owner(){
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- return GenericOrmEntity.this.dbTable(tableName);
- }
-
- public TypeMapping typeMapping() {
- return GenericOrmEntity.this;
- }
-
- public String defaultColumnName() {
- //TODO default column name from java here or in XmlDiscriminatorColumn?
- return DiscriminatorColumn.DEFAULT_NAME;
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- };
- }
-
- // ******************* ITypeMapping implementation ********************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- @Override
- public String tableName() {
- return getTable().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table primaryDbTable() {
- return getTable().dbTable();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- for (Iterator<Table> stream = this.associatedTablesIncludingInherited(); stream.hasNext();) {
- org.eclipse.jpt.db.internal.Table dbTable = stream.next().dbTable();
- if (dbTable != null && dbTable.matchesShortJavaClassName(tableName)) {
- return dbTable;
- }
- }
- return null;
- }
-
- @Override
- public Schema dbSchema() {
- return getTable().dbSchema();
- }
-
- public JavaEntity javaEntity() {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.mappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (JavaEntity) javaPersistentType.getMapping();
- }
- return null;
- }
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- this.typeMappingResource().setName(newSpecifiedName);
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public OrmTable getTable() {
- return this.table;
- }
-
- public ListIterator<OrmSecondaryTable> secondaryTables() {
- if (specifiedSecondaryTablesSize() > 0) {
- return specifiedSecondaryTables();
- }
- return virtualSecondaryTables();
- }
-
- public int secondaryTablesSize() {
- if (specifiedSecondaryTablesSize() > 0) {
- return specifiedSecondaryTablesSize();
- }
- return virtualSecondaryTablesSize();
- }
-
- public ListIterator<OrmSecondaryTable> virtualSecondaryTables() {
- return new CloneListIterator<OrmSecondaryTable>(this.virtualSecondaryTables);
- }
-
- public int virtualSecondaryTablesSize() {
- return this.virtualSecondaryTables.size();
- }
-
- protected void addVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- addItemToList(secondaryTable, this.virtualSecondaryTables, OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST);
- }
-
- protected void removeVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.virtualSecondaryTables, OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST);
- }
-
- public ListIterator<OrmSecondaryTable> specifiedSecondaryTables() {
- return new CloneListIterator<OrmSecondaryTable>(this.specifiedSecondaryTables);
- }
-
- public int specifiedSecondaryTablesSize() {
- return this.specifiedSecondaryTables.size();
- }
-
- public OrmSecondaryTable addSpecifiedSecondaryTable(int index) {
- OrmSecondaryTable secondaryTable = jpaFactory().buildOrmSecondaryTable(this);
- this.specifiedSecondaryTables.add(index, secondaryTable);
- XmlSecondaryTable secondaryTableResource = OrmFactory.eINSTANCE.createXmlSecondaryTableImpl();
- secondaryTable.initialize(secondaryTableResource);
- typeMappingResource().getSecondaryTables().add(index, secondaryTableResource);
- fireItemAdded(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, secondaryTable);
- return secondaryTable;
- }
-
- protected void addSpecifiedSecondaryTable(int index, OrmSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable) {
- this.removeSpecifiedSecondaryTable(this.specifiedSecondaryTables.indexOf(secondaryTable));
- }
-
- public void removeSpecifiedSecondaryTable(int index) {
- OrmSecondaryTable removedSecondaryTable = this.specifiedSecondaryTables.remove(index);
- typeMappingResource().getSecondaryTables().remove(index);
- fireItemRemoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, removedSecondaryTable);
- }
-
- protected void removeSpecifiedSecondaryTable_(OrmSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedSecondaryTables, targetIndex, sourceIndex);
- this.typeMappingResource().getSecondaryTables().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, targetIndex, sourceIndex);
- }
-
- public boolean containsSecondaryTable(String name) {
- return containsSecondaryTable(name, secondaryTables());
- }
-
- public boolean containsSpecifiedSecondaryTable(String name) {
- return containsSecondaryTable(name, specifiedSecondaryTables());
- }
-
- public boolean containsVirtualSecondaryTable(String name) {
- return containsSecondaryTable(name, virtualSecondaryTables());
- }
-
- public boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- return this.virtualSecondaryTables.contains(secondaryTable);
- }
-
- protected boolean containsSecondaryTable(String name, ListIterator<OrmSecondaryTable> secondaryTables) {
- for (OrmSecondaryTable secondaryTable : CollectionTools.iterable(secondaryTables)) {
- String secondaryTableName = secondaryTable.getName();
- if (secondaryTableName != null && secondaryTableName.equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- protected Iterator<String> tableNames(Iterator<Table> tables) {
- return new TransformationIterator<Table, String>(tables) {
- @Override
- protected String transform(Table t) {
- return t.getName();
- }
- };
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return this.nonNullTableNames(this.associatedTablesIncludingInherited());
- }
-
- protected Iterator<String> nonNullTableNames(Iterator<Table> tables) {
- return new FilteringIterator<String, String>(this.tableNames(tables)) {
- @Override
- protected boolean accept(String o) {
- return o != null;
- }
- };
- }
-
- public Iterator<Table> associatedTables() {
- return new SingleElementIterator<Table>(getTable());
- //TODO return new CompositeIterator(this.getTable(), this.getSecondaryTables().iterator());
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return new CompositeIterator<Table>(new TransformationIterator<TypeMapping, Iterator<Table>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<Table> transform(TypeMapping mapping) {
- return new FilteringIterator<Table, Table>(mapping.associatedTables()) {
- @Override
- protected boolean accept(Table o) {
- return true;
- //TODO
- //filtering these out so as to avoid the duplicate table, root and children share the same table
- //return !(o instanceof SingleTableInheritanceChildTableImpl);
- }
- };
- }
- });
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return !CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- public InheritanceType getInheritanceStrategy() {
- return (this.getSpecifiedInheritanceStrategy() == null) ? this.getDefaultInheritanceStrategy() : this.getSpecifiedInheritanceStrategy();
- }
-
- public InheritanceType getDefaultInheritanceStrategy() {
- return this.defaultInheritanceStrategy;
- }
-
- protected void setDefaultInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.defaultInheritanceStrategy;
- this.defaultInheritanceStrategy = newInheritanceType;
- firePropertyChanged(DEFAULT_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public InheritanceType getSpecifiedInheritanceStrategy() {
- return this.specifiedInheritanceStrategy;
- }
-
- public void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- if (oldInheritanceType != newInheritanceType) {
- if (this.inheritanceResource() != null) {
- this.inheritanceResource().setStrategy(InheritanceType.toOrmResourceModel(newInheritanceType));
- if (this.inheritanceResource().isAllFeaturesUnset()) {
- removeInheritanceResource();
- }
- }
- else if (newInheritanceType != null) {
- addInheritanceResource();
- inheritanceResource().setStrategy(InheritanceType.toOrmResourceModel(newInheritanceType));
- }
- }
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- protected void setSpecifiedInheritanceStrategy_(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- protected Inheritance inheritanceResource() {
- return typeMappingResource().getInheritance();
- }
-
- protected void addInheritanceResource() {
- typeMappingResource().setInheritance(OrmFactory.eINSTANCE.createInheritance());
- }
-
- protected void removeInheritanceResource() {
- typeMappingResource().setInheritance(null);
- }
-
- public OrmDiscriminatorColumn getDiscriminatorColumn() {
- return this.discriminatorColumn;
- }
-
- public OrmSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists");
- }
- this.sequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- typeMappingResource().setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl());
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed");
- }
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.typeMappingResource().setSequenceGenerator(null);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, null);
- }
-
- public OrmSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(OrmSequenceGenerator newSequenceGenerator) {
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
- public OrmTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists");
- }
- this.tableGenerator = jpaFactory().buildOrmTableGenerator(this);
- typeMappingResource().setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl());
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed");
- }
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.typeMappingResource().setTableGenerator(null);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public OrmTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(OrmTableGenerator newTableGenerator) {
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
- public String getDefaultDiscriminatorValue() {
- return this.defaultDiscriminatorValue;
- }
-
- protected void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) {
- String oldDefaultDiscriminatorValue = this.defaultDiscriminatorValue;
- this.defaultDiscriminatorValue = newDefaultDiscriminatorValue;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, oldDefaultDiscriminatorValue, newDefaultDiscriminatorValue);
- }
-
- public String getSpecifiedDiscriminatorValue() {
- return this.specifiedDiscriminatorValue;
- }
-
- public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- typeMappingResource().setDiscriminatorValue(newSpecifiedDiscriminatorValue);
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- public String getDiscriminatorValue() {
- return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue();
- }
-
- public boolean isDiscriminatorValueAllowed() {
- return this.discriminatorValueAllowed;
- }
-
- protected void setDiscriminatorValueAllowed(boolean newDiscriminatorValueAllowed) {
- boolean oldDiscriminatorValueAllowed = this.discriminatorValueAllowed;
- this.discriminatorValueAllowed = newDiscriminatorValueAllowed;
- firePropertyChanged(Entity.DISCRIMINATOR_VALUE_ALLOWED_PROPERTY, oldDiscriminatorValueAllowed, newDiscriminatorValueAllowed);
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumns);
- }
-
- public int defaultPrimaryKeyJoinColumnsSize() {
- return this.defaultPrimaryKeyJoinColumns.size();
- }
-
- public OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.specifiedPrimaryKeyJoinColumns.isEmpty() ? this.defaultPrimaryKeyJoinColumns() : this.specifiedPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.isEmpty() ? this.defaultPrimaryKeyJoinColumnsSize() : this.specifiedPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- this.typeMappingResource().getPrimaryKeyJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- this.fireItemAdded(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- return primaryKeyJoinColumn;
- }
-
- protected OrmAbstractJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(primaryKeyJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- this.typeMappingResource().getPrimaryKeyJoinColumns().remove(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.typeMappingResource().getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<OrmAttributeOverride>(specifiedAttributeOverrides(), defaultAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.defaultAttributeOverridesSize();
- }
-
- public ListIterator<OrmAttributeOverride> defaultAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.defaultAttributeOverrides);
- }
-
- public int defaultAttributeOverridesSize() {
- return this.defaultAttributeOverrides.size();
- }
-
- public ListIterator<OrmAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- public OrmAttributeOverride addSpecifiedAttributeOverride(int index) {
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- OrmAttributeOverride attributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- this.typeMappingResource().getAttributeOverrides().add(index, xmlAttributeOverride);
- this.fireItemAdded(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAttributeOverride(AttributeOverride attributeOverride) {
- removeSpecifiedAttributeOverride(this.specifiedAttributeOverrides.indexOf(attributeOverride));
- }
-
- public void removeSpecifiedAttributeOverride(int index) {
- OrmAttributeOverride removedAttributeOverride = this.specifiedAttributeOverrides.remove(index);
- this.typeMappingResource().getAttributeOverrides().remove(index);
- fireItemRemoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, removedAttributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.typeMappingResource().getAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmAssociationOverride> associationOverrides() {
- return new CompositeListIterator<OrmAssociationOverride>(specifiedAssociationOverrides(), defaultAssociationOverrides());
- }
-
- public int associationOverridesSize() {
- return this.specifiedAssociationOverridesSize() + this.defaultAssociationOverridesSize();
- }
-
- public ListIterator<OrmAssociationOverride> defaultAssociationOverrides() {
- return new CloneListIterator<OrmAssociationOverride>(this.defaultAssociationOverrides);
- }
-
- public int defaultAssociationOverridesSize() {
- return this.defaultAssociationOverrides.size();
- }
-
- public ListIterator<OrmAssociationOverride> specifiedAssociationOverrides() {
- return new CloneListIterator<OrmAssociationOverride>(this.specifiedAssociationOverrides);
- }
-
- public int specifiedAssociationOverridesSize() {
- return this.specifiedAssociationOverrides.size();
- }
-
- public OrmAssociationOverride addSpecifiedAssociationOverride(int index) {
- XmlAssociationOverride xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- OrmAssociationOverride associationOverride = buildAssociationOverride(xmlAssociationOverride);
- this.specifiedAssociationOverrides.add(index, associationOverride);
- this.typeMappingResource().getAssociationOverrides().add(index, xmlAssociationOverride);
- this.fireItemAdded(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- return associationOverride;
- }
-
- protected void addSpecifiedAssociationOverride(int index, OrmAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void removeSpecifiedAssociationOverride(AssociationOverride associationOverride) {
- removeSpecifiedAssociationOverride(this.specifiedAssociationOverrides.indexOf(associationOverride));
- }
-
- public void removeSpecifiedAssociationOverride(int index) {
- OrmAssociationOverride removedAssociationOverride = this.specifiedAssociationOverrides.remove(index);
- this.typeMappingResource().getAssociationOverrides().remove(index);
- fireItemRemoved(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, removedAssociationOverride);
- }
-
- protected void removeSpecifiedAssociationOverride_(OrmAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.typeMappingResource().getAssociationOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmNamedQuery> namedQueries() {
- return new CloneListIterator<OrmNamedQuery>(this.namedQueries);
- }
-
- public int namedQueriesSize() {
- return this.namedQueries.size();
- }
-
- public OrmNamedQuery addNamedQuery(int index) {
- OrmNamedQuery namedQuery = jpaFactory().buildOrmNamedQuery(this);
- this.namedQueries.add(index, namedQuery);
- this.typeMappingResource().getNamedQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedQuery());
- this.fireItemAdded(Entity.NAMED_QUERIES_LIST, index, namedQuery);
- return namedQuery;
- }
-
- protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, Entity.NAMED_QUERIES_LIST);
- }
-
- public void removeNamedQuery(NamedQuery namedQuery) {
- removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- OrmNamedQuery namedQuery = this.namedQueries.remove(index);
- this.typeMappingResource().getNamedQueries().remove(index);
- fireItemRemoved(Entity.NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, Entity.NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.typeMappingResource().getNamedQueries().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.NAMED_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmNamedNativeQuery> namedNativeQueries() {
- return new CloneListIterator<OrmNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int namedNativeQueriesSize() {
- return this.namedNativeQueries.size();
- }
-
- public OrmNamedNativeQuery addNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = jpaFactory().buildOrmNamedNativeQuery(this);
- this.namedNativeQueries.add(index, namedNativeQuery);
- this.typeMappingResource().getNamedNativeQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- this.fireItemAdded(Entity.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, Entity.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
- this.removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
- this.typeMappingResource().getNamedNativeQueries().remove(index);
- fireItemRemoved(Entity.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, Entity.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.typeMappingResource().getNamedNativeQueries().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (oldIdClass != newIdClass) {
- if (this.idClassResource() != null) {
- this.idClassResource().setClassName(newIdClass);
- if (this.idClassResource().isAllFeaturesUnset()) {
- removeIdClassResource();
- }
- }
- else if (newIdClass != null) {
- addIdClassResource();
- idClassResource().setClassName(newIdClass);
- }
- }
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClass idClassResource() {
- return typeMappingResource().getIdClass();
- }
-
- protected void addIdClassResource() {
- typeMappingResource().setIdClass(OrmFactory.eINSTANCE.createIdClass());
- }
-
- protected void removeIdClassResource() {
- typeMappingResource().setIdClass(null);
- }
-
- public Entity parentEntity() {
- for (Iterator<PersistentType> i = persistentType().inheritanceHierarchy(); i.hasNext();) {
- TypeMapping typeMapping = i.next().getMapping();
- if (typeMapping != this && typeMapping instanceof Entity) {
- return (Entity) typeMapping;
- }
- }
- return this;
- }
-
- public Entity rootEntity() {
- Entity rootEntity = null;
- for (Iterator<PersistentType> i = persistentType().inheritanceHierarchy(); i.hasNext();) {
- PersistentType persistentType = i.next();
- if (persistentType.getMapping() instanceof Entity) {
- rootEntity = (Entity) persistentType.getMapping();
- }
- }
- return rootEntity;
- }
-
-// public String primaryKeyColumnName() {
-// String pkColumnName = null;
-// for (Iterator<IPersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
-// IPersistentAttribute attribute = stream.next();
-// String name = attribute.primaryKeyColumnName();
-// if (pkColumnName == null) {
-// pkColumnName = name;
-// }
-// else if (name != null) {
-// // if we encounter a composite primary key, return null
-// return null;
-// }
-// }
-// // if we encounter only a single primary key column name, return it
-// return pkColumnName;
-// }
-//
-// public String primaryKeyAttributeName() {
-// String pkColumnName = null;
-// String pkAttributeName = null;
-// for (Iterator<IPersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
-// IPersistentAttribute attribute = stream.next();
-// String name = attribute.primaryKeyColumnName();
-// if (pkColumnName == null) {
-// pkColumnName = name;
-// pkAttributeName = attribute.getName();
-// }
-// else if (name != null) {
-// // if we encounter a composite primary key, return null
-// return null;
-// }
-// }
-// // if we encounter only a single primary key column name, return it
-// return pkAttributeName;
-// }
-//
-
-
- public int xmlSequence() {
- return 1;
- }
-
- /**
- * Return an iterator of Entities, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- protected Iterator<TypeMapping> inheritanceHierarchy() {
- return new TransformationIterator<PersistentType, TypeMapping>(persistentType().inheritanceHierarchy()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- public Iterator<String> allOverridableAttributeNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAttributeNames();
- }
- });
- }
-
- @Override
- public Iterator<String> allOverridableAssociationNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAssociationNames();
- }
- });
- }
-
-//
-// public IAttributeOverride createAttributeOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAttributeOverride(new IEntity.AttributeOverrideOwner(this));
-// }
-//
-// public IAssociationOverride createAssociationOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAssociationOverride(new IEntity.AssociationOverrideOwner(this));
-// }
-//
-// public IAttributeOverride attributeOverrideNamed(String name) {
-// return (IAttributeOverride) overrideNamed(name, getAttributeOverrides());
-// }
-//
-// public boolean containsAttributeOverride(String name) {
-// return containsOverride(name, getAttributeOverrides());
-// }
-//
-// public boolean containsSpecifiedAttributeOverride(String name) {
-// return containsOverride(name, getSpecifiedAttributeOverrides());
-// }
-//
-// public boolean containsAssociationOverride(String name) {
-// return containsOverride(name, getAssociationOverrides());
-// }
-//
-// public boolean containsSpecifiedAssociationOverride(String name) {
-// return containsOverride(name, getSpecifiedAssociationOverrides());
-// }
-//
-// private IOverride overrideNamed(String name, List<? extends IOverride> overrides) {
-// for (IOverride override : overrides) {
-// String overrideName = override.getName();
-// if (overrideName == null && name == null) {
-// return override;
-// }
-// if (overrideName != null && overrideName.equals(name)) {
-// return override;
-// }
-// }
-// return null;
-// }
-//
-// private boolean containsOverride(String name, List<? extends IOverride> overrides) {
-// return overrideNamed(name, overrides) != null;
-// }
-//
-// public boolean containsSpecifiedPrimaryKeyJoinColumns() {
-// return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty();
-// }
-
-
- @Override
- public void initialize(XmlEntity entity) {
- super.initialize(entity);
- this.specifiedName = entity.getName();
- this.defaultName = this.defaultName();
- this.initializeInheritance(this.inheritanceResource());
- this.discriminatorColumn.initialize(entity);
- this.specifiedDiscriminatorValue = entity.getDiscriminatorValue();
- this.defaultDiscriminatorValue = this.defaultDiscriminatorValue();
- this.discriminatorValueAllowed = this.discriminatorValueIsAllowed();
- this.table.initialize(entity);
- this.initializeSpecifiedSecondaryTables(entity);
- this.initializeVirtualSecondaryTables();
- this.initializeSequenceGenerator(entity);
- this.initializeTableGenerator(entity);
- this.initializeSpecifiedPrimaryKeyJoinColumns(entity);
- this.initializeSpecifiedAttributeOverrides(entity);
- this.initializeSpecifiedAssociationOverrides(entity);
- this.initializeNamedQueries(entity);
- this.initializeNamedNativeQueries(entity);
- this.initializeIdClass(this.idClassResource());
- }
-
- protected void initializeInheritance(Inheritance inheritanceResource) {
- this.specifiedInheritanceStrategy = this.specifiedInheritanceStrategy(inheritanceResource);
- this.defaultInheritanceStrategy = this.defaultInheritanceStrategy();
- }
-
- protected void initializeSpecifiedSecondaryTables(XmlEntity entity) {
- for (XmlSecondaryTable secondaryTable : entity.getSecondaryTables()) {
- this.specifiedSecondaryTables.add(createSecondaryTable(secondaryTable));
- }
- }
-
- protected void initializeVirtualSecondaryTables() {
- if (isMetadataComplete()) {
- return;
- }
- if (javaEntity() == null) {
- return;
- }
- if (specifiedSecondaryTablesSize() > 0) {
- return;
- }
- ListIterator<JavaSecondaryTable> javaSecondaryTables = javaEntity().secondaryTables();
- while(javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- if (javaSecondaryTable.getName() != null) {
- this.virtualSecondaryTables.add(buildVirtualSecondaryTable(javaSecondaryTable));
- }
- }
- }
-
- protected void initializeTableGenerator(XmlEntity entity) {
- if (entity.getTableGenerator() != null) {
- this.tableGenerator = buildTableGenerator(entity.getTableGenerator());
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator tableGeneratorResource) {
- OrmTableGenerator tableGenerator = jpaFactory().buildOrmTableGenerator(this);
- tableGenerator.initialize(tableGeneratorResource);
- return tableGenerator;
- }
-
- protected void initializeSequenceGenerator(XmlEntity entity) {
- if (entity.getSequenceGenerator() != null) {
- this.sequenceGenerator = buildSequenceGenerator(entity.getSequenceGenerator());
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator xmlSequenceGenerator) {
- OrmSequenceGenerator sequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- sequenceGenerator.initialize(xmlSequenceGenerator);
- return sequenceGenerator;
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns(XmlEntity entity) {
- for (XmlPrimaryKeyJoinColumn primaryKeyJoinColumn : entity.getPrimaryKeyJoinColumns()) {
- this.specifiedPrimaryKeyJoinColumns.add(createPrimaryKeyJoinColumn(primaryKeyJoinColumn));
- }
- }
-
- protected void initializeSpecifiedAttributeOverrides(XmlEntity entity) {
- for (XmlAttributeOverride attributeOverride : entity.getAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-
- protected void initializeSpecifiedAssociationOverrides(XmlEntity entity) {
- for (XmlAssociationOverride associationOverride : entity.getAssociationOverrides()) {
- this.specifiedAssociationOverrides.add(buildAssociationOverride(associationOverride));
- }
- }
-
- protected void initializeNamedQueries(XmlEntity entity) {
- for (XmlNamedQuery namedQuery : entity.getNamedQueries()) {
- this.namedQueries.add(buildNamedQuery(namedQuery));
- }
- }
-
- protected void initializeNamedNativeQueries(XmlEntity entity) {
- for (XmlNamedNativeQuery namedNativeQuery : entity.getNamedNativeQueries()) {
- this.namedNativeQueries.add(buildNamedNativeQuery(namedNativeQuery));
- }
- }
-
- protected void initializeIdClass(IdClass idClassResource) {
- this.idClass = this.idClass(idClassResource);
- }
-
- protected String idClass(IdClass idClassResource) {
- return idClassResource == null ? null : idClassResource.getClassName();
- }
-
- @Override
- public void update(XmlEntity entity) {
- super.update(entity);
- this.setSpecifiedName(entity.getName());
- this.setDefaultName(this.defaultName());
- this.updateInheritance(this.inheritanceResource());
- this.discriminatorColumn.update(entity);
- this.setSpecifiedDiscriminatorValue(entity.getDiscriminatorValue());
- this.setDefaultDiscriminatorValue(defaultDiscriminatorValue());
- this.setDiscriminatorValueAllowed(this.discriminatorValueIsAllowed());
- this.table.update(entity);
- this.updateSpecifiedSecondaryTables(entity);
- this.updateVirtualSecondaryTables();
- this.updateSequenceGenerator(entity);
- this.updateTableGenerator(entity);
- this.updateSpecifiedPrimaryKeyJoinColumns(entity);
- this.updateSpecifiedAttributeOverrides(entity);
- this.updateSpecifiedAssociationOverrides(entity);
- this.updateNamedQueries(entity);
- this.updateNamedNativeQueries(entity);
- this.updateIdClass(this.idClassResource());
- }
-
- protected String defaultName() {
- //TODO add a test where the underyling java has a name set @Entity(name="foo")
- //just by having the entity specified in xml we are overriding that name setting
- String className = getClass_();
- if (className != null) {
- return ClassTools.shortNameForClassNamed(className);
- }
- return null;
- }
-
- protected String defaultDiscriminatorValue() {
- //TODO default discriminator value
- return null;
- }
-
- protected boolean discriminatorValueIsAllowed() {
- return javaEntity() == null ? false : javaEntity().isDiscriminatorValueAllowed();
- }
-
- protected void updateInheritance(Inheritance inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.specifiedInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.defaultInheritanceStrategy());
- }
-
- protected void updateSpecifiedSecondaryTables(XmlEntity entity) {
- ListIterator<OrmSecondaryTable> secondaryTables = specifiedSecondaryTables();
- ListIterator<XmlSecondaryTable> resourceSecondaryTables = entity.getSecondaryTables().listIterator();
-
- while (secondaryTables.hasNext()) {
- OrmSecondaryTable secondaryTable = secondaryTables.next();
- if (resourceSecondaryTables.hasNext()) {
- secondaryTable.update(resourceSecondaryTables.next());
- }
- else {
- removeSpecifiedSecondaryTable_(secondaryTable);
- }
- }
-
- while (resourceSecondaryTables.hasNext()) {
- addSpecifiedSecondaryTable(specifiedSecondaryTablesSize(), createSecondaryTable(resourceSecondaryTables.next()));
- }
- }
-
- //if any secondary-tables are specified in the xml file, then all of the java secondaryTables are overriden
- protected void updateVirtualSecondaryTables() {
- ListIterator<OrmSecondaryTable> secondaryTables = virtualSecondaryTables();
- ListIterator<JavaSecondaryTable> javaSecondaryTables = EmptyListIterator.instance();
-
- if (javaEntity() != null && !isMetadataComplete() && specifiedSecondaryTablesSize() == 0) {
- javaSecondaryTables = javaEntity().secondaryTables();
- }
- while (secondaryTables.hasNext()) {
- OrmSecondaryTable virtualSecondaryTable = secondaryTables.next();
- if (javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- virtualSecondaryTable.update(new VirtualXmlSecondaryTable(javaSecondaryTable));
- }
- else {
- removeVirtualSecondaryTable(virtualSecondaryTable);
- }
- }
-
- while (javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- addVirtualSecondaryTable(buildVirtualSecondaryTable(javaSecondaryTable));
- }
- }
-
- protected OrmSecondaryTable createSecondaryTable(XmlSecondaryTable secondaryTable) {
- OrmSecondaryTable ormSecondaryTable = jpaFactory().buildOrmSecondaryTable(this);
- ormSecondaryTable.initialize(secondaryTable);
- return ormSecondaryTable;
- }
-
- protected OrmSecondaryTable buildVirtualSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- OrmSecondaryTable virtualSecondaryTable = jpaFactory().buildOrmSecondaryTable(this);
- VirtualXmlSecondaryTable virtualXmlSecondaryTable = new VirtualXmlSecondaryTable(javaSecondaryTable);
- virtualSecondaryTable.initialize(virtualXmlSecondaryTable);
- return virtualSecondaryTable;
- }
-
- protected void updateTableGenerator(XmlEntity entity) {
- if (entity.getTableGenerator() == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(entity.getTableGenerator()));
- }
- else {
- getTableGenerator().update(entity.getTableGenerator());
- }
- }
- }
-
- protected void updateSequenceGenerator(XmlEntity entity) {
- if (entity.getSequenceGenerator() == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(entity.getSequenceGenerator()));
- }
- else {
- getSequenceGenerator().update(entity.getSequenceGenerator());
- }
- }
- }
-
- protected InheritanceType specifiedInheritanceStrategy(Inheritance inheritanceResource) {
- if (inheritanceResource == null) {
- return null;
- }
- return InheritanceType.fromOrmResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType defaultInheritanceStrategy() {
- if (inheritanceResource() == null && !isMetadataComplete()) {
- if (javaEntity() != null) {
- return javaEntity().getInheritanceStrategy();
- }
- }
- if (rootEntity() == this) {
- return InheritanceType.SINGLE_TABLE;
- }
- return rootEntity().getInheritanceStrategy();
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(XmlEntity entity) {
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = entity.getPrimaryKeyJoinColumns().listIterator();
-
- while (primaryKeyJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update(resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(specifiedPrimaryKeyJoinColumnsSize(), createPrimaryKeyJoinColumn(resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected OrmPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = jpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- ormPrimaryKeyJoinColumn.initialize(primaryKeyJoinColumn);
- return ormPrimaryKeyJoinColumn;
- }
-
- protected void updateSpecifiedAttributeOverrides(XmlEntity entity) {
- ListIterator<OrmAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- ListIterator<XmlAttributeOverride> resourceAttributeOverrides = entity.getAttributeOverrides().listIterator();
-
- while (attributeOverrides.hasNext()) {
- OrmAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update(resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(specifiedAttributeOverridesSize(), buildAttributeOverride(resourceAttributeOverrides.next()));
- }
- }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return jpaFactory().buildOrmAttributeOverride(this, createAttributeOverrideOwner(), attributeOverride);
- }
-
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
- protected void updateSpecifiedAssociationOverrides(XmlEntity entity) {
- ListIterator<OrmAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- ListIterator<XmlAssociationOverride> resourceAssociationOverrides = entity.getAssociationOverrides().listIterator();
-
- while (associationOverrides.hasNext()) {
- OrmAssociationOverride associationOverride = associationOverrides.next();
- if (resourceAssociationOverrides.hasNext()) {
- associationOverride.update(resourceAssociationOverrides.next());
- }
- else {
- removeSpecifiedAssociationOverride_(associationOverride);
- }
- }
-
- while (resourceAssociationOverrides.hasNext()) {
- addSpecifiedAssociationOverride(specifiedAssociationOverridesSize(), buildAssociationOverride(resourceAssociationOverrides.next()));
- }
- }
-
- protected OrmAssociationOverride buildAssociationOverride(XmlAssociationOverride associationOverride) {
- return jpaFactory().buildOrmAssociationOverride(this, createAssociationOverrideOwner(), associationOverride);
- }
-
- protected AssociationOverride.Owner createAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- protected void updateNamedQueries(XmlEntity entity) {
- ListIterator<OrmNamedQuery> namedQueries = namedQueries();
- ListIterator<XmlNamedQuery> resourceNamedQueries = entity.getNamedQueries().listIterator();
-
- while (namedQueries.hasNext()) {
- OrmNamedQuery namedQuery = namedQueries.next();
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update(resourceNamedQueries.next());
- }
- else {
- removeNamedQuery_(namedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(namedQueriesSize(), buildNamedQuery(resourceNamedQueries.next()));
- }
- }
-
- protected OrmNamedQuery buildNamedQuery(XmlNamedQuery namedQuery) {
- OrmNamedQuery ormNamedQuery = jpaFactory().buildOrmNamedQuery(this);
- ormNamedQuery.initialize(namedQuery);
- return ormNamedQuery;
- }
-
- protected void updateNamedNativeQueries(XmlEntity entity) {
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = namedNativeQueries();
- ListIterator<XmlNamedNativeQuery> resourceNamedNativeQueries = entity.getNamedNativeQueries().listIterator();
-
- while (namedNativeQueries.hasNext()) {
- OrmNamedNativeQuery namedQuery = namedNativeQueries.next();
- if (resourceNamedNativeQueries.hasNext()) {
- namedQuery.update(resourceNamedNativeQueries.next());
- }
- else {
- removeNamedNativeQuery_(namedQuery);
- }
- }
-
- while (resourceNamedNativeQueries.hasNext()) {
- addNamedNativeQuery(namedQueriesSize(), buildNamedNativeQuery(resourceNamedNativeQueries.next()));
- }
- }
-
- protected OrmNamedNativeQuery buildNamedNativeQuery(XmlNamedNativeQuery namedQuery) {
- OrmNamedNativeQuery ormNamedNativeQuery = jpaFactory().buildOrmNamedNativeQuery(this);
- ormNamedNativeQuery.initialize(namedQuery);
- return ormNamedNativeQuery;
- }
-
- protected void updateIdClass(IdClass idClassResource) {
- this.setIdClass_(this.idClass(idClassResource));
- }
-
- public String primaryKeyColumnName() {
- return GenericJavaEntity.primaryKeyColumnName(persistentType().allAttributes());
- }
-
-
- public ColumnMapping columnMapping(String attributeName) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- // TODO Auto-generated method stub
- return false;
- }
-
- //********** Validation **************************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- getTable().addToMessages(messages);
- addIdMessages(messages);
- //TODO what about virtual secondary tables??
- for (OrmSecondaryTable secondaryTable : CollectionTools.iterable(specifiedSecondaryTables())) {
- secondaryTable.addToMessages(messages);
- }
-
- for (Iterator<OrmAttributeOverride> stream = this.attributeOverrides(); stream.hasNext();) {
- stream.next().addToMessages(messages);
- }
-
- for (Iterator<OrmAssociationOverride> stream = this.associationOverrides(); stream.hasNext();) {
- stream.next().addToMessages(messages);
- }
-
- }
-
- protected void addIdMessages(List<IMessage> messages) {
- addNoIdMessage(messages);
-
- }
-
- protected void addNoIdMessage(List<IMessage> messages) {
- if (entityHasNoId()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NO_ID,
- new String[] {this.getName()},
- this,
- this.validationTextRange())
- );
- }
- }
-
- private boolean entityHasNoId() {
- return ! this.entityHasId();
- }
-
- private boolean entityHasId() {
- for (Iterator<PersistentAttribute> stream = this.persistentType().allAttributes(); stream.hasNext(); ) {
- if (stream.next().isIdAttribute()) {
- return true;
- }
- }
- return false;
- }
-
- public TypeMapping typeMapping() {
- return this;
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEntities().remove(this.typeMappingResource());
- }
-
- public XmlEntity addToResourceModel(XmlEntityMappings entityMappings) {
- XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity();
- persistentType().initialize(entity);
- entityMappings.getEntities().add(entity);
- return entity;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
- class PrimaryKeyJoinColumnOwner implements OrmAbstractJoinColumn.Owner
- {
- public TypeMapping typeMapping() {
- return GenericOrmEntity.this;
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- return GenericOrmEntity.this.dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- Entity parentEntity = GenericOrmEntity.this.parentEntity();
- return (parentEntity == null) ? null : parentEntity.primaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericOrmEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericOrmEntity.this.defaultPrimaryKeyJoinColumns.contains(joinColumn);
- }
-
- public String defaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return GenericOrmEntity.this.parentEntity().primaryKeyColumnName();
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
- }
-
- class AttributeOverrideOwner implements AttributeOverride.Owner {
-
- public ColumnMapping columnMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmEntity.this.defaultAttributeOverrides.contains(override);
- }
-
- public TypeMapping typeMapping() {
- return GenericOrmEntity.this;
- }
-
- }
-
- class AssociationOverrideOwner implements AssociationOverride.Owner {
-
- public RelationshipMapping relationshipMapping(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof RelationshipMapping) {
- return (RelationshipMapping) persAttribute.getMapping();
- }
- }
- }
- return null;
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmEntity.this.defaultAssociationOverrides.contains(override);
- }
-
- public TypeMapping typeMapping() {
- return GenericOrmEntity.this;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java
deleted file mode 100644
index ae316c0230..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmGeneratedValue.java
+++ /dev/null
@@ -1,130 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-
-public class GenericOrmGeneratedValue extends AbstractOrmJpaContextNode implements OrmGeneratedValue
-{
-
- protected GenerationType specifiedStrategy;
-
- protected String specifiedGenerator;
- protected String defaultGenerator;
-
- protected XmlGeneratedValue generatedValue;
-
- public GenericOrmGeneratedValue(OrmJpaContextNode parent) {
- super(parent);
- }
-
- public GenerationType getStrategy() {
- return (this.getSpecifiedStrategy() == null) ? this.getDefaultStrategy() : this.getSpecifiedStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.specifiedStrategy;
- }
-
- public void setSpecifiedStrategy(GenerationType newSpecifiedStrategy) {
- GenerationType oldStrategy = this.specifiedStrategy;
- this.specifiedStrategy = newSpecifiedStrategy;
- this.generatedValue.setStrategy(GenerationType.toOrmResourceModel(newSpecifiedStrategy));
- firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newSpecifiedStrategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType newSpecifiedStrategy) {
- GenerationType oldStrategy = this.specifiedStrategy;
- this.specifiedStrategy = newSpecifiedStrategy;
- firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, oldStrategy, newSpecifiedStrategy);
- }
-
- public String getGenerator() {
- return (this.getSpecifiedGenerator() == null) ? this.getDefaultGenerator() : this.getSpecifiedGenerator();
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- protected void setDefaultGenerator(String newDefaultGenerator) {
- String oldGenerator = this.defaultGenerator;
- this.defaultGenerator = newDefaultGenerator;
- firePropertyChanged(DEFAULT_GENERATOR_PROPERTY, oldGenerator, newDefaultGenerator);
- }
-
- public String getSpecifiedGenerator() {
- return this.specifiedGenerator;
- }
-
- public void setSpecifiedGenerator(String newSpecifiedGenerator) {
- String oldGenerator = this.specifiedGenerator;
- this.specifiedGenerator = newSpecifiedGenerator;
- this.generatedValue.setGenerator(newSpecifiedGenerator);
- firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newSpecifiedGenerator);
- }
-
- protected void setSpecifiedGenerator_(String newSpecifiedGenerator) {
- String oldGenerator = this.specifiedGenerator;
- this.specifiedGenerator = newSpecifiedGenerator;
- firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, oldGenerator, newSpecifiedGenerator);
- }
-
- public TextRange generatorTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-// public ITextRange generatorTextRange() {
-// if (node == null) {
-// return ((XmlEObject) eContainer()).validationTextRange();
-// }
-// IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.GENERATED_VALUE__GENERATOR);
-// return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode);
-// }
-
- // ********** resource model -> java context model **********
-
- public void initialize(XmlGeneratedValue generatedValue) {
- this.generatedValue = generatedValue;
- this.specifiedStrategy = this.strategy(generatedValue);
- this.specifiedGenerator = this.generator(generatedValue);
- //TODO
- this.defaultGenerator = null;
- }
-
- public void update(XmlGeneratedValue generatedValue) {
- this.generatedValue = generatedValue;
- this.setSpecifiedStrategy_(this.strategy(generatedValue));
- this.setSpecifiedGenerator_(this.generator(generatedValue));
- //TODO
- this.setDefaultGenerator(null);
- }
-
- protected GenerationType strategy(XmlGeneratedValue generatedValue) {
- return GenerationType.fromOrmResourceModel(generatedValue.getStrategy());
- }
-
- protected String generator(XmlGeneratedValue generatedValue) {
- return generatedValue.getGenerator();
- }
-
- public TextRange validationTextRange() {
- return this.generatedValue.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java
deleted file mode 100644
index abda6460d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdMapping.java
+++ /dev/null
@@ -1,347 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.db.internal.Table;
-
-
-public class GenericOrmIdMapping extends AbstractOrmAttributeMapping<XmlId>
- implements OrmIdMapping
-{
- protected final OrmColumn column;
-
- protected OrmGeneratedValue generatedValue;
-
- protected TemporalType temporal;
-
- protected OrmTableGenerator tableGenerator;
- protected OrmSequenceGenerator sequenceGenerator;
-
-
- public GenericOrmIdMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = jpaFactory().buildOrmColumn(this, this);
- }
-
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int xmlSequence() {
- return 0;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmIdMapping(this);
- }
-
- @Override
- public void initializeFromXmlColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromXmlColumnMapping(oldMapping);
- setTemporal(oldMapping.getTemporal());
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.attributeMapping().setTemporal(TemporalType.toOrmResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- protected void setTemporal_(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- public OrmGeneratedValue addGeneratedValue() {
- if (getGeneratedValue() != null) {
- throw new IllegalStateException("gemeratedValue already exists");
- }
- this.generatedValue = jpaFactory().buildOrmGeneratedValue(this);
- this.attributeMapping().setGeneratedValue(OrmFactory.eINSTANCE.createXmlGeneratedValueImpl());
- firePropertyChanged(GENERATED_VALUE_PROPERTY, null, this.generatedValue);
- return this.generatedValue;
- }
-
- public void removeGeneratedValue() {
- if (getGeneratedValue() == null) {
- throw new IllegalStateException("gemeratedValue does not exist, cannot be removed");
- }
- OrmGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = null;
- this.attributeMapping().setGeneratedValue(null);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, null);
- }
-
- public OrmGeneratedValue getGeneratedValue() {
- return this.generatedValue;
- }
-
- protected void setGeneratedValue(OrmGeneratedValue newGeneratedValue) {
- OrmGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = newGeneratedValue;
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, newGeneratedValue);
- }
-
- public OrmSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists");
- }
- this.sequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- this.attributeMapping().setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl());
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed");
- }
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.attributeMapping().setSequenceGenerator(null);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, null);
- }
-
- public OrmSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(OrmSequenceGenerator newSequenceGenerator) {
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
- public OrmTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists");
- }
- this.tableGenerator = jpaFactory().buildOrmTableGenerator(this);
- this.attributeMapping().setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl());
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed");
- }
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.attributeMapping().setTableGenerator(null);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public OrmTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(OrmTableGenerator newTableGenerator) {
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
-
- @Override
- public String primaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public boolean isIdMapping() {
- return true;
- }
-
- public XmlId addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlId id = OrmFactory.eINSTANCE.createXmlIdImpl();
- persistentAttribute().initialize(id);
- typeMapping.getAttributes().getIds().add(id);
- return id;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getIds().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- @Override
- public void initialize(XmlId id) {
- super.initialize(id);
- this.temporal = this.specifiedTemporal(id);
- this.column.initialize(id.getColumn());
- this.initializeSequenceGenerator(id);
- this.initializeTableGenerator(id);
- this.initializeGeneratedValue(id);
- }
-
- protected void initializeSequenceGenerator(XmlId id) {
- if (id.getSequenceGenerator() != null) {
- this.sequenceGenerator = buildSequenceGenerator(id.getSequenceGenerator());
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator xmlSequenceGenerator) {
- OrmSequenceGenerator sequenceGenerator = jpaFactory().buildOrmSequenceGenerator(this);
- sequenceGenerator.initialize(xmlSequenceGenerator);
- return sequenceGenerator;
- }
-
- protected void initializeTableGenerator(XmlId id) {
- if (id.getTableGenerator() != null) {
- this.tableGenerator = buildTableGenerator(id.getTableGenerator());
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator tableGeneratorResource) {
- OrmTableGenerator tableGenerator = jpaFactory().buildOrmTableGenerator(this);
- tableGenerator.initialize(tableGeneratorResource);
- return tableGenerator;
- }
-
- protected void initializeGeneratedValue(XmlId id) {
- if (id.getGeneratedValue() != null) {
- this.generatedValue = buildGeneratedValue(id.getGeneratedValue());
- }
- }
-
- protected OrmGeneratedValue buildGeneratedValue(XmlGeneratedValue xmlGeneratedValue) {
- OrmGeneratedValue ormGeneratedValue = jpaFactory().buildOrmGeneratedValue(this);
- ormGeneratedValue.initialize(xmlGeneratedValue);
- return ormGeneratedValue;
- }
- @Override
- public void update(XmlId id) {
- super.update(id);
- this.setTemporal_(this.specifiedTemporal(id));
- this.column.update(id.getColumn());
- this.updateSequenceGenerator(id);
- this.updateTableGenerator(id);
- this.updateGeneratedValue(id);
- }
-
- protected void updateSequenceGenerator(XmlId id) {
- if (id.getSequenceGenerator() == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(id.getSequenceGenerator()));
- }
- else {
- getSequenceGenerator().update(id.getSequenceGenerator());
- }
- }
- }
-
- protected void updateTableGenerator(XmlId id) {
- if (id.getTableGenerator() == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(id.getTableGenerator()));
- }
- else {
- getTableGenerator().update(id.getTableGenerator());
- }
- }
- }
-
- protected void updateGeneratedValue(XmlId id) {
- if (id.getGeneratedValue() == null) {
- if (getGeneratedValue() != null) {
- setGeneratedValue(null);
- }
- }
- else {
- if (getGeneratedValue() == null) {
- setGeneratedValue(buildGeneratedValue(id.getGeneratedValue()));
- getGeneratedValue().initialize(id.getGeneratedValue());
- }
- else {
- getGeneratedValue().update(id.getGeneratedValue());
- }
- }
- }
-
-
- protected TemporalType specifiedTemporal(XmlId id) {
- return TemporalType.fromOrmResourceModel(id.getTemporal());
- }
-
- //***************** IXmlColumn.Owner implementation ****************
-
- public XmlColumn columnResource() {
- return this.attributeMapping().getColumn();
- }
-
- public void addColumnResource() {
- this.attributeMapping().setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeColumnResource() {
- this.attributeMapping().setColumn(null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.java
deleted file mode 100644
index e884872377..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumn.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-
-public class GenericOrmJoinColumn extends AbstractOrmColumn<XmlJoinColumn> implements OrmJoinColumn
-{
-
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected XmlJoinColumn joinColumn;
-
- public GenericOrmJoinColumn(OrmJpaContextNode parent, OrmJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initializeFrom(JoinColumn oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedReferencedColumnName(oldColumn.getSpecifiedReferencedColumnName());
- }
-
- public String getReferencedColumnName() {
- return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName();
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- columnResource().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- @Override
- public OrmJoinColumn.Owner owner() {
- return (OrmJoinColumn.Owner) this.owner;
- }
-
- public Table dbReferencedColumnTable() {
- return owner().dbReferencedColumnTable();
- }
-
- public Column dbReferencedColumn() {
- Table table = dbReferencedColumnTable();
- return (table == null) ? null : table.columnNamed(getReferencedColumnName());
- }
-
- public boolean isReferencedColumnResolved() {
- return dbReferencedColumn() != null;
- }
-
- public TextRange referencedColumnNameTextRange() {
- if (columnResource() != null) {
- return columnResource().referencedColumnNameTextRange();
- }
- return this.parent().validationTextRange();
- }
-
-
- @Override
- protected XmlJoinColumn columnResource() {
- return this.joinColumn;
- }
-
- @Override
- protected void addColumnResource() {
- //joinColumns are part of a collection, the join-column element will be removed/added
- //when the XmlJoinColumn is removed/added to the XmlEntity collection
- }
-
- @Override
- protected void removeColumnResource() {
- //joinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlJoinColumn is removed/added to the XmlEntity collection
- }
-
-
- @Override
- public void initialize(XmlJoinColumn column) {
- this.joinColumn = column;
- super.initialize(column);
- this.specifiedReferencedColumnName = column.getReferencedColumnName();
- this.defaultReferencedColumnName = defaultReferencedColumnName();
- }
-
- @Override
- public void update(XmlJoinColumn column) {
- this.joinColumn = column;
- super.update(column);
- this.setSpecifiedReferencedColumnName_(column.getReferencedColumnName());
- this.setDefaultReferencedColumnName(defaultReferencedColumnName());
- }
-
- protected String defaultReferencedColumnName() {
-// if (!owner().relationshipMapping().isRelationshipOwner()) {
-// return null;
-// }
- //TODO
- return null;
- }
-
- @Override
- protected String defaultName() {
-// if (!owner().relationshipMapping().isRelationshipOwner()) {
-// return null;
-// }
- //TODO
- return super.defaultName();
- }
-
- @Override
- protected String defaultTable() {
-// if (!owner().relationshipMapping().isRelationshipOwner()) {
-// return null;
-// }
- //TODO
- return super.defaultTable();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
deleted file mode 100644
index 21652c08dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTable.java
+++ /dev/null
@@ -1,632 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmJoinTable extends AbstractOrmTable implements OrmJoinTable
-{
-
- protected final List<OrmJoinColumn> specifiedJoinColumns;
-
- protected final List<OrmJoinColumn> defaultJoinColumns;
-
- protected final List<OrmJoinColumn> specifiedInverseJoinColumns;
-
- protected final List<OrmJoinColumn> defaultInverseJoinColumns;
-
- protected XmlRelationshipMapping relationshipMappingResource;
-
- public GenericOrmJoinTable(OrmRelationshipMapping parent) {
- super(parent);
- this.specifiedJoinColumns = new ArrayList<OrmJoinColumn>();
- this.defaultJoinColumns = new ArrayList<OrmJoinColumn>();
- this.specifiedInverseJoinColumns = new ArrayList<OrmJoinColumn>();
- this.defaultInverseJoinColumns = new ArrayList<OrmJoinColumn>();
- }
-
- @Override
- public OrmRelationshipMapping parent() {
- return (OrmRelationshipMapping) super.parent();
- }
-
- public void initializeFrom(JoinTable oldJoinTable) {
- super.initializeFrom(oldJoinTable);
- int index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldJoinTable.specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- index = 0;
- for (JoinColumn joinColumn : CollectionTools.iterable(oldJoinTable.specifiedInverseJoinColumns())) {
- OrmJoinColumn newJoinColumn = addSpecifiedInverseJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- //******************* AbstractXmlTable implementation *****************
-
- @Override
- protected String defaultCatalog() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- return entityMappings().getCatalog();
- }
-
- @Override
- protected String defaultName() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- String tableName = relationshipMapping().typeMapping().tableName();
- if (tableName == null) {
- return null;
- }
- Entity targetEntity = targetEntity();
- if (targetEntity == null) {
- return null;
- }
- Table targetTable = targetEntity.getTable();
- return (targetTable == null) ? null : tableName + "_" + targetTable.getName();
- }
-
- @Override
- protected String defaultSchema() {
- if (!relationshipMapping().isRelationshipOwner()) {
- return null;
- }
- return entityMappings().getSchema();
- }
-
-
- protected Entity targetEntity() {
-// String targetEntity = relationshipMapping().fullyQualifiedTargetEntity(defaultsContext.astRoot());
-// if (targetEntity == null) {
-// return null;
-// }
-// IPersistentType persistentType = defaultsContext.persistentType(targetEntity);
-// if (persistentType == null) {
-// return null;
-// }
-// ITypeMapping typeMapping = persistentType.getMapping();
-// if (typeMapping instanceof IEntity) {
-// return (IEntity) typeMapping;
-// }
- return null;
- }
-
-
- @Override
- protected void removeTableResource() {
- this.relationshipMappingResource.setJoinTable(null);
- }
-
- @Override
- protected void addTableResource() {
- this.relationshipMappingResource.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTableImpl());
-
- }
-
- @Override
- protected XmlJoinTable table() {
- return this.relationshipMappingResource.getJoinTable();
- }
-
- //******************* IJoinTable implementation *****************
-
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumns() : this.specifiedJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.specifiedJoinColumns.isEmpty() ? this.defaultJoinColumnsSize() : this.specifiedJoinColumnsSize();
- }
-
- public JoinColumn getDefaultJoinColumn() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ListIterator<OrmJoinColumn> defaultJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.defaultJoinColumns);
- }
-
- public int defaultJoinColumnsSize() {
- return this.defaultJoinColumns.size();
- }
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean containsSpecifiedJoinColumns() {
- return !this.specifiedJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- if (table() == null) {
- addTableResource();
- }
- OrmJoinColumn joinColumn = jpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner());
- this.specifiedJoinColumns.add(index, joinColumn);
- this.table().getJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- this.fireItemAdded(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- this.table().getJoinColumns().remove(index);
- fireItemRemoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- // TODO Auto-generated method stub
-
- }
-
- public void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn) {
- // TODO Auto-generated method stub
-
- }
- protected void removeSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, JoinTable.SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.table().getJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- public ListIterator<OrmJoinColumn> inverseJoinColumns() {
- return this.specifiedInverseJoinColumns.isEmpty() ? this.defaultInverseJoinColumns() : this.specifiedInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.isEmpty() ? this.defaultInverseJoinColumnsSize() : this.specifiedInverseJoinColumnsSize();
- }
-
- public JoinColumn getDefaultInverseJoinColumn() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ListIterator<OrmJoinColumn> defaultInverseJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.defaultInverseJoinColumns);
- }
-
- public int defaultInverseJoinColumnsSize() {
- return this.defaultInverseJoinColumns.size();
- }
-
- public ListIterator<OrmJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- public boolean containsSpecifiedInverseJoinColumns() {
- return !this.specifiedInverseJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedInverseJoinColumn(int index) {
- if (table() == null) {
- addTableResource();
- }
- OrmJoinColumn joinColumn = jpaFactory().buildOrmJoinColumn(this, new InverseJoinColumnOwner());
- this.specifiedInverseJoinColumns.add(index, joinColumn);
- this.table().getInverseJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlJoinColumnImpl());
- this.fireItemAdded(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, OrmJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
-
- public void removeSpecifiedInverseJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedInverseJoinColumns.remove(index);
- this.table().getInverseJoinColumns().remove(index);
- fireItemRemoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- }
-
- protected void removeSpecifiedInverseJoinColumn(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.table().getInverseJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public OrmRelationshipMapping relationshipMapping() {
- return parent();
- }
-
- public boolean isSpecified() {
- return this.table() != null;
- }
-
- public void initialize(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMappingResource = relationshipMapping;
- this.initialize(this.table());
- }
-
- public void update(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMappingResource = relationshipMapping;
- this.update(this.table());
- }
-
- protected void initialize(XmlJoinTable joinTable) {
- super.initialize(joinTable);
- this.initializeSpecifiedJoinColumns(joinTable);
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- }
-
- protected void initializeSpecifiedJoinColumns(XmlJoinTable joinTable) {
- if (joinTable == null) {
- return;
- }
- for (XmlJoinColumn joinColumn : joinTable.getJoinColumns()) {
- this.specifiedJoinColumns.add(createJoinColumn(joinColumn));
- }
- }
-
- protected void initializeSpecifiedInverseJoinColumns(XmlJoinTable joinTable) {
- if (joinTable == null) {
- return;
- }
- for (XmlJoinColumn joinColumn : joinTable.getInverseJoinColumns()) {
- this.specifiedInverseJoinColumns.add(createInverseJoinColumn(joinColumn));
- }
- }
-
- protected void update(XmlJoinTable joinTable) {
- super.update(joinTable);
- this.updateSpecifiedJoinColumns(joinTable);
- this.updateSpecifiedInverseJoinColumns(joinTable);
- }
-
- protected void updateSpecifiedJoinColumns(XmlJoinTable joinTable) {
- ListIterator<OrmJoinColumn> joinColumns = specifiedJoinColumns();
- ListIterator<XmlJoinColumn> resourceJoinColumns = EmptyListIterator.instance();
- if (joinTable != null) {
- resourceJoinColumns = joinTable.getJoinColumns().listIterator();
- }
-
- while (joinColumns.hasNext()) {
- OrmJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(specifiedJoinColumnsSize(), createJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(XmlJoinTable joinTable) {
- ListIterator<OrmJoinColumn> inverseJoinColumns = specifiedInverseJoinColumns();
- ListIterator<XmlJoinColumn> resourceInverseJoinColumns = EmptyListIterator.instance();
- if (joinTable != null) {
- resourceInverseJoinColumns = joinTable.getInverseJoinColumns().listIterator();
- }
-
- while (inverseJoinColumns.hasNext()) {
- OrmJoinColumn joinColumn = inverseJoinColumns.next();
- if (resourceInverseJoinColumns.hasNext()) {
- joinColumn.update(resourceInverseJoinColumns.next());
- }
- else {
- removeSpecifiedInverseJoinColumn(joinColumn);
- }
- }
-
- while (resourceInverseJoinColumns.hasNext()) {
- addSpecifiedInverseJoinColumn(specifiedJoinColumnsSize(), createInverseJoinColumn(resourceInverseJoinColumns.next()));
- }
- }
-
- protected OrmJoinColumn createJoinColumn(XmlJoinColumn joinColumn) {
- OrmJoinColumn ormJoinColumn = jpaFactory().buildOrmJoinColumn(this, new JoinColumnOwner());
- ormJoinColumn.initialize(joinColumn);
- return ormJoinColumn;
- }
-
- protected OrmJoinColumn createInverseJoinColumn(XmlJoinColumn joinColumn) {
- OrmJoinColumn ormJoinColumn = jpaFactory().buildOrmJoinColumn(this, new InverseJoinColumnOwner());
- ormJoinColumn.initialize(joinColumn);
- return ormJoinColumn;
- }
-
- /** used internally as a mechanism to short circuit continued message adding */
- private boolean doContinue;
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- this.addTableMessages(messages);
-
- if (doContinue) {
- for (OrmJoinColumn joinColumn : CollectionTools.iterable(joinColumns())) {
- joinColumn.addToMessages(messages);
- }
-
- for (OrmJoinColumn joinColumn : CollectionTools.iterable(inverseJoinColumns())) {
- joinColumn.addToMessages(messages);
- }
- }
- }
-
- protected void addTableMessages(List<IMessage> messages) {
- doContinue = isConnected();
- String schema = getSchema();
- OrmRelationshipMapping mapping = relationshipMapping();
-
- if (doContinue && ! hasResolvedSchema()) {
- if (mapping.persistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {mapping.getName(), schema, getName()},
- this,
- schemaTextRange())
- );
-
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA,
- new String[] {schema, getName()},
- this,
- schemaTextRange())
- );
- }
- doContinue = false;
- }
-
- if (doContinue && ! isResolved()) {
- if (mapping.persistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME,
- new String[] {mapping.getName(), getName()},
- this,
- nameTextRange())
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME,
- new String[] {getName()},
- this,
- nameTextRange())
- );
- }
- }
- }
- /**
- * just a little common behavior
- */
- abstract class AbstractJoinColumnOwner implements OrmJoinColumn.Owner
- {
- AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping typeMapping() {
- return relationshipMapping().typeMapping();
- }
- public RelationshipMapping relationshipMapping() {
- return GenericOrmJoinTable.this.relationshipMapping();
- }
-
- /**
- * the default table name is always valid and a specified table name
- * is prohibited (which will be handled elsewhere)
- */
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * the join column can only be on the join table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- if (GenericOrmJoinTable.this.getName() == null) {
- return null;
- }
- return (GenericOrmJoinTable.this.getName().equals(tableName)) ? GenericOrmJoinTable.this.dbTable() : null;
- }
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- class InverseJoinColumnOwner extends AbstractJoinColumnOwner
- {
- public InverseJoinColumnOwner() {
- super();
- }
-
- public Entity targetEntity() {
- return GenericOrmJoinTable.this.relationshipMapping().getResolvedTargetEntity();
- }
-
- public String attributeName() {
- return GenericOrmJoinTable.this.relationshipMapping().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- org.eclipse.jpt.db.internal.Table dbTable = super.dbTable(tableName);
- if (dbTable != null) {
- return dbTable;
- }
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- Entity targetEntity = targetEntity();
- return (targetEntity == null) ? null : targetEntity.primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericOrmJoinTable.this.defaultInverseJoinColumns.contains(joinColumn);
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String defaultTableName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.inverseJoinColumnsSize();
- }
-
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- class JoinColumnOwner extends AbstractJoinColumnOwner
- {
- public JoinColumnOwner() {
- super();
- }
-
- public Entity targetEntity() {
- return GenericOrmJoinTable.this.relationshipMapping().getEntity();
- }
-
- public String attributeName() {
- Entity targetEntity = GenericOrmJoinTable.this.relationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String attributeName = GenericOrmJoinTable.this.relationshipMapping().getName();
- for (Iterator<PersistentAttribute> stream = targetEntity.persistentType().allAttributes(); stream.hasNext();) {
- PersistentAttribute attribute = stream.next();
- AttributeMapping mapping = attribute.getMapping();
- if (mapping instanceof NonOwningMapping) {
- String mappedBy = ((NonOwningMapping) mapping).getMappedBy();
- if ((mappedBy != null) && mappedBy.equals(attributeName)) {
- return attribute.getName();
- }
- }
- }
- return null;
- }
-
- @Override
- public org.eclipse.jpt.db.internal.Table dbTable(String tableName) {
- org.eclipse.jpt.db.internal.Table dbTable = super.dbTable(tableName);
- if (dbTable != null) {
- return dbTable;
- }
- return typeMapping().dbTable(tableName);
- }
-
- public org.eclipse.jpt.db.internal.Table dbReferencedColumnTable() {
- return typeMapping().primaryDbTable();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericOrmJoinTable.this.defaultJoinColumns.contains(joinColumn);
- }
-
- public String defaultColumnName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String defaultTableName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.joinColumnsSize();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java
deleted file mode 100644
index d5b21d0cd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyMapping.java
+++ /dev/null
@@ -1,68 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-public class GenericOrmManyToManyMapping extends AbstractOrmMultiRelationshipMapping<XmlManyToMany>
- implements OrmManyToManyMapping
-{
-
- public GenericOrmManyToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToManyMapping(this);
- }
-
- @Override
- public void initializeFromXmlNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromXmlNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- public int xmlSequence() {
- return 6;
- }
-
- // ********** INonOwningMapping implementation **********
- @Override
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- }
-
- public XmlManyToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToMany manyToMany = OrmFactory.eINSTANCE.createXmlManyToManyImpl();
- persistentAttribute().initialize(manyToMany);
- typeMapping.getAttributes().getManyToManys().add(manyToMany);
- return manyToMany;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getManyToManys().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.java
deleted file mode 100644
index 0ab32ecab6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneMapping.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-
-public class GenericOrmManyToOneMapping extends AbstractOrmSingleRelationshipMapping<XmlManyToOne>
- implements OrmManyToOneMapping
-{
-
- public GenericOrmManyToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public int xmlSequence() {
- return 3;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- //ManyToOne mapping is always the owning side
- public boolean isRelationshipOwner() {
- return true;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToOneMapping(this);
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- public XmlManyToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlManyToOne manyToOne = OrmFactory.eINSTANCE.createXmlManyToOneImpl();
- persistentAttribute().initialize(manyToOne);
- typeMapping.getAttributes().getManyToOnes().add(manyToOne);
- return manyToOne;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getManyToOnes().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java
deleted file mode 100644
index e016479123..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedSuperclass.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.IdClass;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public class GenericOrmMappedSuperclass extends AbstractOrmTypeMapping<XmlMappedSuperclass>
- implements OrmMappedSuperclass
-{
- protected String idClass;
-
- public GenericOrmMappedSuperclass(OrmPersistentType parent) {
- super(parent);
- }
-
- public String getIdClass() {
- return this.idClass;
- }
-
- public void setIdClass(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- if (oldIdClass != newIdClass) {
- if (this.idClassResource() != null) {
- this.idClassResource().setClassName(newIdClass);
- if (this.idClassResource().isAllFeaturesUnset()) {
- removeIdClassResource();
- }
- }
- else if (newIdClass != null) {
- addIdClassResource();
- idClassResource().setClassName(newIdClass);
- }
- }
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected void setIdClass_(String newIdClass) {
- String oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(Entity.ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected IdClass idClassResource() {
- return typeMappingResource().getIdClass();
- }
-
- protected void addIdClassResource() {
- typeMappingResource().setIdClass(OrmFactory.eINSTANCE.createIdClass());
- }
-
- protected void removeIdClassResource() {
- typeMappingResource().setIdClass(null);
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- return this.namesOf(this.overridableAttributes());
- }
-
- public Iterator<OrmPersistentAttribute> overridableAttributes() {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(this.persistentType().attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return o.isOverridableAttribute();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- return this.namesOf(this.overridableAssociations());
- }
-
- public Iterator<OrmPersistentAttribute> overridableAssociations() {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(this.persistentType().attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return o.isOverridableAssociation();
- }
- };
- }
-
- private Iterator<String> namesOf(Iterator<OrmPersistentAttribute> attributes) {
- return new TransformationIterator<OrmPersistentAttribute, String>(attributes) {
- @Override
- protected String transform(OrmPersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public int xmlSequence() {
- return 0;
- }
-
- protected Boolean metadataComplete(XmlMappedSuperclass mappedSuperclass) {
- return mappedSuperclass.getMetadataComplete();
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getMappedSuperclasses().remove(this.typeMappingResource());
- }
-
- public XmlMappedSuperclass addToResourceModel(XmlEntityMappings entityMappings) {
- XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass();
- persistentType().initialize(mappedSuperclass);
- entityMappings.getMappedSuperclasses().add(mappedSuperclass);
- return mappedSuperclass;
- }
-
-
-
- @Override
- public void initialize(XmlMappedSuperclass mappedSuperclass) {
- super.initialize(mappedSuperclass);
- this.initializeIdClass(this.idClassResource());
- }
-
- protected void initializeIdClass(IdClass idClassResource) {
- this.idClass = this.idClass(idClassResource);
- }
-
- @Override
- public void update(XmlMappedSuperclass mappedSuperclass) {
- super.update(mappedSuperclass);
- this.updateIdClass(this.idClassResource());
- }
-
- protected void updateIdClass(IdClass idClassResource) {
- this.setIdClass_(this.idClass(idClassResource));
- }
-
- protected String idClass(IdClass idClassResource) {
- return idClassResource == null ? null : idClassResource.getClassName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java
deleted file mode 100644
index 53491a7032..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedNativeQuery.java
+++ /dev/null
@@ -1,68 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-
-
-public class GenericOrmNamedNativeQuery extends AbstractOrmQuery<XmlNamedNativeQuery>
- implements OrmNamedNativeQuery
-{
-
- protected String resultClass;
-
- protected String resultSetMapping;
-
-
- public GenericOrmNamedNativeQuery(OrmJpaContextNode parent) {
- super(parent);
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- queryResource().setResultClass(newResultClass);
- firePropertyChanged(NamedNativeQuery.RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- queryResource().setResultSetMapping(newResultSetMapping);
- firePropertyChanged(NamedNativeQuery.RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
-
- @Override
- public void initialize(XmlNamedNativeQuery queryResource) {
- super.initialize(queryResource);
- this.resultClass = queryResource.getResultClass();
- this.resultSetMapping = queryResource.getResultSetMapping();
- }
-
- @Override
- public void update(XmlNamedNativeQuery queryResource) {
- super.update(queryResource);
- this.setResultClass(queryResource.getResultClass());
- this.setResultSetMapping(queryResource.getResultSetMapping());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java
deleted file mode 100644
index f0131cfb5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNamedQuery.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-
-
-public class GenericOrmNamedQuery extends AbstractOrmQuery<XmlNamedQuery> implements OrmNamedQuery
-{
-
- public GenericOrmNamedQuery(OrmJpaContextNode parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.java
deleted file mode 100644
index af5447eeb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmNullAttributeMapping.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-
-public class GenericOrmNullAttributeMapping extends AbstractOrmAttributeMapping<XmlAttributeMapping>
-{
-
- public GenericOrmNullAttributeMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public int xmlSequence() {
- return -1;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return null;
- }
-
- //TODO throwing an exception correct here?
- public XmlAttributeMapping addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- throw new UnsupportedOperationException();
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java
deleted file mode 100644
index 5fec38e5bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToManyMapping.java
+++ /dev/null
@@ -1,69 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-
-public class GenericOrmOneToManyMapping extends AbstractOrmMultiRelationshipMapping<XmlOneToMany>
- implements OrmOneToManyMapping
-{
-
- public GenericOrmOneToManyMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToManyMapping(this);
- }
-
- @Override
- public void initializeFromXmlNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromXmlNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- public int xmlSequence() {
- return 4;
- }
-
- // ********** INonOwningMapping implementation **********
- @Override
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public XmlOneToMany addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToMany oneToMany = OrmFactory.eINSTANCE.createXmlOneToManyImpl();
- persistentAttribute().initialize(oneToMany);
- typeMapping.getAttributes().getOneToManys().add(oneToMany);
- return oneToMany;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getOneToManys().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java
deleted file mode 100644
index 96b47d08a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneMapping.java
+++ /dev/null
@@ -1,118 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-
-public class GenericOrmOneToOneMapping extends AbstractOrmSingleRelationshipMapping<XmlOneToOne>
- implements OrmOneToOneMapping
-{
-
- protected String mappedBy;
-
-
- public GenericOrmOneToOneMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToOneMapping(this);
- }
-
- @Override
- public void initializeFromXmlNonOwningMapping(NonOwningMapping oldMapping) {
- super.initializeFromXmlNonOwningMapping(oldMapping);
- setMappedBy(oldMapping.getMappedBy());
- }
-
- public boolean isRelationshipOwner() {
- return getMappedBy() == null;
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- attributeMapping().setMappedBy(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- protected void setMappedBy_(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public boolean mappedByIsValid(AttributeMapping mappedByMapping) {
- String mappedByKey = mappedByMapping.getKey();
- return (mappedByKey == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public TextRange mappedByTextRange() {
- return null;
-// if (node == null) {
-// return typeMapping().validationTextRange();
-// }
-// IDOMNode mappedByNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.MAPPED_BY);
-// return (mappedByNode == null) ? validationTextRange() : buildTextRange(mappedByNode);
- }
-
- public int xmlSequence() {
- return 5;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return true;
- }
-
- public XmlOneToOne addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlOneToOne oneToOne = OrmFactory.eINSTANCE.createXmlOneToOneImpl();
- persistentAttribute().initialize(oneToOne);
- typeMapping.getAttributes().getOneToOnes().add(oneToOne);
- return oneToOne;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getOneToOnes().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- @Override
- public void initialize(XmlOneToOne oneToOne) {
- super.initialize(oneToOne);
- this.mappedBy = oneToOne.getMappedBy();
- }
-
- @Override
- public void update(XmlOneToOne oneToOne) {
- super.update(oneToOne);
- this.setMappedBy_(oneToOne.getMappedBy());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java
deleted file mode 100644
index e00d8741d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentAttribute.java
+++ /dev/null
@@ -1,366 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmPersistentAttribute extends AbstractOrmJpaContextNode
- implements OrmPersistentAttribute
-{
-
- protected List<OrmAttributeMappingProvider> attributeMappingProviders;
-
- protected OrmAttributeMapping attributeMapping;
-
- public GenericOrmPersistentAttribute(OrmPersistentType parent, String mappingKey) {
- super(parent);
- this.attributeMappingProviders = buildAttributeMappingProviders();
- this.attributeMapping = buildAttributeMapping(mappingKey);
- }
-
- protected List<OrmAttributeMappingProvider> buildAttributeMappingProviders() {
- List<OrmAttributeMappingProvider> list = new ArrayList<OrmAttributeMappingProvider>();
- list.add(OrmEmbeddedMappingProvider.instance()); //bug 190344 need to test default embedded before basic
- list.add(OrmBasicMappingProvider.instance());
- list.add(OrmTransientMappingProvider.instance());
- list.add(OrmIdMappingProvider.instance());
- list.add(OrmManyToManyMappingProvider.instance());
- list.add(OrmOneToManyMappingProvider.instance());
- list.add(OrmManyToOneMappingProvider.instance());
- list.add(OrmOneToOneMappingProvider.instance());
- list.add(OrmVersionMappingProvider.instance());
- list.add(OrmEmbeddedIdMappingProvider.instance());
- return list;
- }
-
- protected OrmAttributeMappingProvider attributeMappingProvider(String key) {
- for (OrmAttributeMappingProvider provider : this.attributeMappingProviders) {
- if (provider.key().equals(key)) {
- return provider;
- }
- }
- return OrmNullAttributeMappingProvider.instance();
- }
-
- protected OrmAttributeMapping buildAttributeMapping(String key) {
- return this.attributeMappingProvider(key).buildAttributeMapping(jpaFactory(), this);
- }
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- public String getName() {
- return getMapping().getName();
- }
-
- public void nameChanged(String oldName, String newName) {
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public OrmAttributeMapping getSpecifiedMapping() {
- return this.attributeMapping;
- }
-
- public OrmAttributeMapping getMapping() {
- return this.attributeMapping;
- }
-
- public String mappingKey() {
- return this.getMapping().getKey();
- }
-
- public String defaultMappingKey() {
- return null;
- }
-
- public void setSpecifiedMappingKey(String newMappingKey) {
- if (this.mappingKey() == newMappingKey) {
- return;
- }
- OrmAttributeMapping oldMapping = getMapping();
- this.attributeMapping = buildAttributeMapping(newMappingKey);
- persistentType().changeMapping(this, oldMapping, this.attributeMapping);
- firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, oldMapping, this.attributeMapping);
- }
-
- protected void setSpecifiedMappingKey_(String newMappingKey) {
- if (this.mappingKey() == newMappingKey) {
- return;
- }
- OrmAttributeMapping oldMapping = getMapping();
- this.attributeMapping = buildAttributeMapping(newMappingKey);
- firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, oldMapping, this.attributeMapping);
- }
-
- public Collection<OrmAttributeMappingProvider> attributeMappingProviders() {
- return this.attributeMappingProviders;
- }
-
- public OrmPersistentType persistentType() {
- return (OrmPersistentType) parent();
- }
-
- public OrmTypeMapping typeMapping() {
- return persistentType().getMapping();
- }
-
- public boolean isVirtual() {
- return persistentType().containsVirtualPersistentAttribute(this);
- }
-
- public void setVirtual(boolean virtual) {
- ormPersistentType().setPersistentAttributeVirtual(this, virtual);
- }
-
- public String primaryKeyColumnName() {
- return getMapping().primaryKeyColumnName();
- }
-
-// @Override
-// public ITextRange fullTextRange() {
-// return (this.isVirtual()) ? null : super.fullTextRange();
-// }
-//
-// @Override
-// public ITextRange validationTextRange() {
-// return (this.isVirtual()) ? this.persistentType().attributesTextRange() : this.getMapping().validationTextRange();
-// }
-//
-// @Override
-// public ITextRange selectionTextRange() {
-// return (isVirtual()) ? null : this.getMapping().selectionTextRange();
-// }
-//
-// public ITextRange nameTextRange() {
-// return getMapping().nameTextRange();
-// }
-
- public boolean isOverridableAttribute() {
- return this.getMapping().isOverridableAttributeMapping();
- }
-
- public boolean isOverridableAssociation() {
- return this.getMapping().isOverridableAssociationMapping();
- }
-
- public boolean isIdAttribute() {
- return this.getMapping().isIdMapping();
- }
-
- //TODO is there a way to avoid a method for every mapping type?
- //I am trying to take adavantage of generics here, but it sure is
- //leading to a lot of duplicated code. - KFM
- public void initialize(XmlBasic basic) {
- ((OrmBasicMapping) getMapping()).initialize(basic);
- }
-
- public void initialize(XmlEmbedded embedded) {
- ((OrmEmbeddedMapping) getMapping()).initialize(embedded);
- }
-
- public void initialize(XmlVersion version) {
- ((OrmVersionMapping) getMapping()).initialize(version);
- }
-
- public void initialize(XmlManyToOne manyToOne) {
- ((OrmManyToOneMapping) getMapping()).initialize(manyToOne);
- }
-
- public void initialize(XmlOneToMany oneToMany) {
- ((OrmOneToManyMapping) getMapping()).initialize(oneToMany);
- }
-
- public void initialize(XmlOneToOne oneToOne) {
- ((OrmOneToOneMapping) getMapping()).initialize(oneToOne);
- }
-
- public void initialize(XmlManyToMany manyToMany) {
- ((OrmManyToManyMapping) getMapping()).initialize(manyToMany);
- }
-
- public void initialize(XmlId id) {
- ((OrmIdMapping) getMapping()).initialize(id);
- }
-
- public void initialize(XmlEmbeddedId embeddedId) {
- ((OrmEmbeddedIdMapping) getMapping()).initialize(embeddedId);
- }
-
- public void initialize(XmlTransient transientResource) {
- ((OrmTransientMapping) getMapping()).initialize(transientResource);
- }
-
- public void update(XmlId id) {
- if (mappingKey() == MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) {
- ((OrmIdMapping) getMapping()).update(id);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ((OrmIdMapping) getMapping()).initialize(id);
- }
- }
-
- public void update(XmlEmbeddedId embeddedId) {
- if (mappingKey() == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
- ((OrmEmbeddedIdMapping) getMapping()).update(embeddedId);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- ((OrmEmbeddedIdMapping) getMapping()).initialize(embeddedId);
- }
- }
-
- public void update(XmlBasic basic) {
- if (mappingKey() == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) {
- ((OrmBasicMapping) getMapping()).update(basic);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- ((OrmBasicMapping) getMapping()).initialize(basic);
- }
- }
-
- public void update(XmlVersion version) {
- if (mappingKey() == MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) {
- ((OrmVersionMapping) getMapping()).update(version);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ((OrmVersionMapping) getMapping()).initialize(version);
- }
- }
- public void update(XmlManyToOne manyToOne) {
- if (mappingKey() == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- ((OrmManyToOneMapping) getMapping()).update(manyToOne);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ((OrmManyToOneMapping) getMapping()).initialize(manyToOne);
- }
- }
- public void update(XmlOneToMany oneToMany) {
- if (mappingKey() == MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- ((OrmOneToManyMapping) getMapping()).update(oneToMany);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ((OrmOneToManyMapping) getMapping()).initialize(oneToMany);
- }
- }
- public void update(XmlOneToOne oneToOne) {
- if (mappingKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- ((OrmOneToOneMapping) getMapping()).update(oneToOne);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ((OrmOneToOneMapping) getMapping()).initialize(oneToOne);
- }
- }
- public void update(XmlManyToMany manyToMany) {
- if (mappingKey() == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- ((OrmManyToManyMapping) getMapping()).update(manyToMany);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ((OrmManyToManyMapping) getMapping()).initialize(manyToMany);
- }
- }
-
- public void update(XmlEmbedded embedded) {
- if (mappingKey() == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) {
- ((OrmEmbeddedMapping) getMapping()).update(embedded);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- ((OrmEmbeddedMapping) getMapping()).initialize(embedded);
- }
- }
-
- public void update(XmlTransient transientResource) {
- if (mappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- ((OrmTransientMapping) getMapping()).update(transientResource);
- }
- else {
- setSpecifiedMappingKey_(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ((OrmTransientMapping) getMapping()).initialize(transientResource);
- }
- }
-
- public JpaStructureNode structureNode(int offset) {
- return this;
- }
-
- public boolean contains(int textOffset) {
- if (isVirtual()) {
- return false;
- }
- return this.attributeMapping.contains(textOffset);
- }
-
- public TextRange selectionTextRange() {
- if (isVirtual()) {
- return persistentType().selectionTextRange();
- }
- return this.attributeMapping.selectionTextRange();
- }
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- getMapping().addToMessages(messages);
- }
-
- public TextRange validationTextRange() {
- if (isVirtual()) {
- return persistentType().getMapping().attributesTextRange();
- }
- return this.attributeMapping.validationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
deleted file mode 100644
index 41761f4de7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPersistentType.java
+++ /dev/null
@@ -1,819 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingProvider;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmPersistentType extends AbstractOrmJpaContextNode implements OrmPersistentType
-{
- protected final List<OrmPersistentAttribute> specifiedPersistentAttributes;
-
- protected final List<OrmPersistentAttribute> virtualPersistentAttributes;
-
- protected final Collection<OrmTypeMappingProvider> typeMappingProviders;
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected PersistentType parentPersistentType;
-
- public GenericOrmPersistentType(EntityMappings parent, String mappingKey) {
- super(parent);
- this.typeMappingProviders = buildTypeMappingProviders();
- this.ormTypeMapping = buildOrmTypeMapping(mappingKey);
- this.specifiedPersistentAttributes = new ArrayList<OrmPersistentAttribute>();
- this.virtualPersistentAttributes = new ArrayList<OrmPersistentAttribute>();
- }
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- public boolean isFor(String fullyQualifiedTypeName) {
- String className = getMapping().getClass_();
- if (className == null) {
- return false;
- }
- if (className.equals(fullyQualifiedTypeName)) {
- return true;
- }
- if ((entityMappings().getPackage() + className).equals(fullyQualifiedTypeName)) {
- return true;
- }
- return false;
- }
-
- protected OrmTypeMapping buildOrmTypeMapping(String key) {
- return typeMappingProvider(key).buildTypeMapping(jpaFactory(), this);
- }
-
- protected Collection<OrmTypeMappingProvider> buildTypeMappingProviders() {
- Collection<OrmTypeMappingProvider> collection = new ArrayList<OrmTypeMappingProvider>();
- collection.add(new OrmEntityProvider());
- collection.add(new OrmMappedSuperclassProvider());
- collection.add(new OrmEmbeddableProvider());
- return collection;
- }
-
- protected OrmTypeMappingProvider typeMappingProvider(String key) {
- for (OrmTypeMappingProvider provider : this.typeMappingProviders) {
- if (provider.key().equals(key)) {
- return provider;
- }
- }
- throw new IllegalArgumentException();
- }
-
- public OrmTypeMapping getMapping() {
- return this.ormTypeMapping;
- }
-
- public void setMappingKey(String newMappingKey) {
- if (this.mappingKey() == newMappingKey) {
- return;
- }
- OrmTypeMapping oldMapping = getMapping();
- this.ormTypeMapping = buildOrmTypeMapping(newMappingKey);
- entityMappings().changeMapping(this, oldMapping, this.ormTypeMapping);
- firePropertyChanged(MAPPING_PROPERTY, oldMapping, this.ormTypeMapping);
- }
-
- protected void setMappingKey_(String newMappingKey) {
- if (this.mappingKey() == newMappingKey) {
- return;
- }
- OrmTypeMapping oldMapping = getMapping();
- this.ormTypeMapping = buildOrmTypeMapping(newMappingKey);
- firePropertyChanged(MAPPING_PROPERTY, oldMapping, this.ormTypeMapping);
- }
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(this) {
- @Override
- protected PersistentType nextLink(PersistentType pt) {
- return pt.parentPersistentType();
- }
- };
- }
-
- public PersistentType parentPersistentType() {
- return this.parentPersistentType;
- }
-
- public AccessType access() {
- return getMapping().getAccess();
- }
-
- public void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping) {
- int sourceIndex = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute);
- this.specifiedPersistentAttributes.remove(sourceIndex);
- oldMapping.removeFromResourceModel(getMapping().typeMappingResource());
- if (getMapping().typeMappingResource().getAttributes() == null) {
- getMapping().typeMappingResource().setAttributes(OrmFactory.eINSTANCE.createAttributes());
- }
- int targetIndex = insertionIndex(ormPersistentAttribute);
- this.specifiedPersistentAttributes.add(targetIndex, ormPersistentAttribute);
- newMapping.addToResourceModel(getMapping().typeMappingResource());
- oldMapping.initializeOn(newMapping);
- //TODO are the source and target correct in this case, or is target off by one???
- fireItemMoved(SPECIFIED_ATTRIBUTES_LIST, targetIndex, sourceIndex);
- }
-
- public void setPersistentAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute, boolean virtual) {
- boolean oldVirtual = ormPersistentAttribute.isVirtual();
- if (oldVirtual == virtual) {
- return;
- }
- if (virtual) {
- OrmPersistentAttribute virtualPersistentAttribute = createVirtualPersistentAttribute(ormPersistentAttribute.getMapping().getJavaPersistentAttribute());
- this.virtualPersistentAttributes.add(virtualPersistentAttribute);
- this.removeSpecifiedPersistentAttribute(ormPersistentAttribute);
- fireItemAdded(VIRTUAL_ATTRIBUTES_LIST, virtualAttributesSize(), virtualPersistentAttribute);
- }
- else {
- int index = this.virtualPersistentAttributes.indexOf(ormPersistentAttribute);
- this.virtualPersistentAttributes.remove(ormPersistentAttribute);
- addSpecifiedPersistentAttribute(ormPersistentAttribute.mappingKey(), ormPersistentAttribute.getName());
- fireItemRemoved(VIRTUAL_ATTRIBUTES_LIST, index, ormPersistentAttribute);
- }
- }
-
-
-
- public Iterator<String> allAttributeNames() {
- return this.attributeNames(this.allAttributes());
- }
-
- public Iterator<PersistentAttribute> allAttributes() {
- return new CompositeIterator<PersistentAttribute>(new TransformationIterator<PersistentType, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(PersistentType pt) {
- return pt.attributes();
- }
- });
- }
-
- protected Iterator<OrmPersistentAttribute> attributesNamed(final String attributeName) {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return attributeName.equals(o.getName());
- }
- };
- }
-
- public OrmPersistentAttribute attributeNamed(String attributeName) {
- Iterator<OrmPersistentAttribute> stream = attributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- public Iterator<String> attributeNames() {
- return this.attributeNames(this.attributes());
- }
-
- protected Iterator<String> attributeNames(Iterator<? extends PersistentAttribute> attrs) {
- return new TransformationIterator<PersistentAttribute, String>(attrs) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- protected OrmPersistentAttribute specifiedAttributeNamed(String attributeName) {
- Iterator<OrmPersistentAttribute> stream = specifiedAttributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
-
- }
-
- protected Iterator<OrmPersistentAttribute> specifiedAttributesNamed(final String attributeName) {
- return new FilteringIterator<OrmPersistentAttribute, OrmPersistentAttribute>(specifiedAttributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute ormPersistentAttribute) {
- return attributeName.equals(ormPersistentAttribute.getName());
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmPersistentAttribute> attributes() {
- return new CompositeListIterator<OrmPersistentAttribute>(specifiedAttributes(), virtualAttributes());
- }
-
- public int attributesSize() {
- return specifiedAttributesSize() + virtualAttributesSize();
- }
-
- public ListIterator<OrmPersistentAttribute> specifiedAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.specifiedPersistentAttributes);
- }
-
- public int specifiedAttributesSize() {
- return this.specifiedPersistentAttributes.size();
- }
-
- public ListIterator<OrmPersistentAttribute> virtualAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.virtualPersistentAttributes);
- }
-
- public int virtualAttributesSize() {
- return this.virtualPersistentAttributes.size();
- }
-
- protected void addVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- addItemToList(ormPersistentAttribute, this.virtualPersistentAttributes, OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST);
- }
-
- protected void removeVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- removeItemFromList(ormPersistentAttribute, this.virtualPersistentAttributes, OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST);
- }
-
- public boolean containsVirtualPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- return this.virtualPersistentAttributes.contains(ormPersistentAttribute);
- }
-
- public OrmPersistentAttribute addSpecifiedPersistentAttribute(String mappingKey, String attributeName) {
- OrmPersistentAttribute persistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, mappingKey);
- int index = insertionIndex(persistentAttribute);
- if (getMapping().typeMappingResource().getAttributes() == null) {
- getMapping().typeMappingResource().setAttributes(OrmFactory.eINSTANCE.createAttributes());
- }
- this.specifiedPersistentAttributes.add(index, persistentAttribute);
- XmlAttributeMapping attributeMapping = persistentAttribute.getMapping().addToResourceModel(getMapping().typeMappingResource());
-
- attributeMapping.setName(attributeName);
- fireItemAdded(PersistentType.SPECIFIED_ATTRIBUTES_LIST, index, persistentAttribute);
- return persistentAttribute;
- }
-
- protected int insertionIndex(OrmPersistentAttribute persistentAttribute) {
- return CollectionTools.insertionIndexOf(this.specifiedPersistentAttributes, persistentAttribute, buildMappingComparator());
- }
-
- protected Comparator<OrmPersistentAttribute> buildMappingComparator() {
- return new Comparator<OrmPersistentAttribute>() {
- public int compare(OrmPersistentAttribute o1, OrmPersistentAttribute o2) {
- int o1Sequence = o1.getMapping().xmlSequence();
- int o2Sequence = o2.getMapping().xmlSequence();
- if (o1Sequence < o2Sequence) {
- return -1;
- }
- if (o1Sequence == o2Sequence) {
- return 0;
- }
- return 1;
- }
- };
- }
-
-
- protected void addSpecifiedPersistentAttribute_(OrmPersistentAttribute ormPersistentAttribute) {
- addItemToList(ormPersistentAttribute, this.specifiedPersistentAttributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- protected void removeSpecifiedPersistentAttribute_(OrmPersistentAttribute ormPersistentAttribute) {
- removeItemFromList(ormPersistentAttribute, this.specifiedPersistentAttributes, PersistentType.SPECIFIED_ATTRIBUTES_LIST);
- }
-
- public void removeSpecifiedPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- int index = this.specifiedPersistentAttributes.indexOf(ormPersistentAttribute);
- this.specifiedPersistentAttributes.remove(ormPersistentAttribute);
- ormPersistentAttribute.getMapping().removeFromResourceModel(this.ormTypeMapping.typeMappingResource());
- fireItemRemoved(PersistentType.SPECIFIED_ATTRIBUTES_LIST, index, ormPersistentAttribute);
- }
-
- public String getName() {
- return getMapping().getClass_();
- }
-
- public void classChanged(String oldClass, String newClass) {
- firePropertyChanged(NAME_PROPERTY, oldClass, newClass);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String mappingKey() {
- return getMapping().getKey();
- }
-
- public JavaPersistentType javaPersistentType() {
- return getMapping().getJavaPersistentType();
- }
-
-
- //TODO is there a way to avoid a method for every mapping type?
- //I am trying to take adavantage of generics here, but it sure is
- //leading to a lot of duplicated code. - KFM
- public void initialize(XmlEntity entity) {
- ((OrmEntity) getMapping()).initialize(entity);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(entity);
- }
-
- public void initialize(XmlMappedSuperclass mappedSuperclass) {
- ((OrmMappedSuperclass) getMapping()).initialize(mappedSuperclass);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(mappedSuperclass);
- }
-
- public void initialize(XmlEmbeddable embeddable) {
- ((OrmEmbeddable) getMapping()).initialize(embeddable);
- this.initializeParentPersistentType();
- this.initializePersistentAttributes(embeddable);
- }
-
- protected void initializePersistentAttributes(AbstractXmlTypeMapping typeMapping) {
- Attributes attributes = typeMapping.getAttributes();
- if (attributes != null) {
- this.initializeSpecifiedPersistentAttributes(attributes);
- }
- this.initializeVirtualPersistentAttributes();
- }
-
- protected void initializeSpecifiedPersistentAttributes(Attributes attributes) {
- for (XmlId id : attributes.getIds()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(id);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlEmbeddedId embeddedId : attributes.getEmbeddedIds()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(embeddedId);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlBasic basic : attributes.getBasics()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(basic);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlVersion version : attributes.getVersions()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(version);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlManyToOne manyToOne : attributes.getManyToOnes()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(manyToOne);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlOneToMany oneToMany : attributes.getOneToManys()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(oneToMany);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlOneToOne oneToOne : attributes.getOneToOnes()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(oneToOne);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlManyToMany manyToMany : attributes.getManyToManys()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(manyToMany);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlEmbedded embedded : attributes.getEmbeddeds()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(embedded);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- for (XmlTransient transientResource : attributes.getTransients()) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(transientResource);
- this.specifiedPersistentAttributes.add(ormPersistentAttribute);
- }
- }
-
- protected void initializeVirtualPersistentAttributes() {
- ListIterator<JavaPersistentAttribute> javaAttributes = javaPersistentAttributes();
-
- while (javaAttributes.hasNext()) {
- JavaPersistentAttribute javaPersistentAttribute = javaAttributes.next();
- if (specifiedAttributeNamed(javaPersistentAttribute.getName()) == null) {
- OrmPersistentAttribute ormPersistentAttribute = createVirtualPersistentAttribute(javaPersistentAttribute);
- this.virtualPersistentAttributes.add(ormPersistentAttribute);
- }
- }
- }
-
- protected ListIterator<JavaPersistentAttribute> javaPersistentAttributes() {
- JavaPersistentType javaPersistentType = javaPersistentType();
- if (javaPersistentType != null) {
- return javaPersistentType.attributes();
- }
- return EmptyListIterator.instance();
- }
-
- protected void initializeParentPersistentType() {
- JavaPersistentType javaPersistentType = javaPersistentType();
- if (javaPersistentType != null) {
- this.parentPersistentType = javaPersistentType.parentPersistentType();
- }
- }
-
- public void update(XmlEntity entity) {
- if (mappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- ((OrmEntity) getMapping()).update(entity);
- }
- else {
- setMappingKey_(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- ((OrmEntity) getMapping()).initialize(entity);
- }
- this.updateParentPersistentType();
- this.updatePersistentAttributes(entity);
- }
-
- public void update(XmlMappedSuperclass mappedSuperclass) {
- if (mappingKey() == MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) {
- ((OrmMappedSuperclass) getMapping()).update(mappedSuperclass);
- }
- else {
- setMappingKey_(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- ((OrmMappedSuperclass) getMapping()).initialize(mappedSuperclass);
- }
- this.updateParentPersistentType();
- this.updatePersistentAttributes(mappedSuperclass);
- }
-
- public void update(XmlEmbeddable embeddable) {
- if (mappingKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- ((OrmEmbeddable) getMapping()).update(embeddable);
- }
- else {
- setMappingKey_(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- ((OrmEmbeddable) getMapping()).initialize(embeddable);
- }
- this.updateParentPersistentType();
- this.updatePersistentAttributes(embeddable);
- }
-
- protected void updateParentPersistentType() {
- JavaPersistentType javaPersistentType = javaPersistentType();
- if (javaPersistentType == null) {
- //TODO change notification for this?
- this.parentPersistentType = null;
- return;
- }
- this.parentPersistentType = javaPersistentType.parentPersistentType();
- }
-
- protected void updatePersistentAttributes(AbstractXmlTypeMapping typeMapping) {
- ListIterator<OrmPersistentAttribute> ormPersistentAttributes = this.specifiedAttributes();
- if (typeMapping.getAttributes() != null) {
- this.updateIds(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateEmbeddedIds(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateBasics(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateVersions(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateManyToOnes(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateOneToManys(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateOneToOnes(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateManyToManys(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateEmbeddeds(typeMapping.getAttributes(), ormPersistentAttributes);
- this.updateTransients(typeMapping.getAttributes(), ormPersistentAttributes);
- }
- while (ormPersistentAttributes.hasNext()) {
- this.removeSpecifiedPersistentAttribute_(ormPersistentAttributes.next());
- }
- this.updateVirtualPersistentAttributes();
- }
-
- protected void updateVirtualAttribute(OrmPersistentAttribute xmlAttribute, JavaPersistentAttribute javaAttribute) {
- if (javaAttribute.mappingKey() == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlBasic(getMapping(), (JavaBasicMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlEmbedded(getMapping(), (JavaEmbeddedMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlEmbeddedId(getMapping(), (JavaEmbeddedIdMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlId(getMapping(), (JavaIdMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlManyToMany((JavaManyToManyMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlManyToOne((JavaManyToOneMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlOneToMany((JavaOneToManyMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlOneToOne((JavaOneToOneMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlTransient((JavaTransientMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) {
- xmlAttribute.update(new VirtualXmlVersion(getMapping(), (JavaVersionMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- }
-
- protected void updateVirtualPersistentAttributes() {
- ListIterator<JavaPersistentAttribute> javaAttributes = this.javaPersistentAttributes();
- ListIterator<OrmPersistentAttribute> xmlVirtualAttributes = this.virtualAttributes();
- for (JavaPersistentAttribute javaAttribute : CollectionTools.iterable(javaAttributes)) {
- if (specifiedAttributeNamed(javaAttribute.getName()) == null) {
- if (xmlVirtualAttributes.hasNext()) {
- updateVirtualAttribute(xmlVirtualAttributes.next(), javaAttribute);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = createVirtualPersistentAttribute(javaAttribute);
- addVirtualPersistentAttribute(ormPersistentAttribute);
- }
- }
- }
-
- while (xmlVirtualAttributes.hasNext()) {
- this.removeVirtualPersistentAttribute(xmlVirtualAttributes.next());
- }
-
- }
-
- protected void addVirtualPersistentAttribute(JavaPersistentAttribute javaAttribute) {
- addVirtualPersistentAttribute(createVirtualPersistentAttribute(javaAttribute));
- }
-
- protected OrmPersistentAttribute createVirtualPersistentAttribute(JavaPersistentAttribute javaAttribute) {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, javaAttribute.mappingKey());
- if (javaAttribute.mappingKey() == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlBasic(getMapping(), (JavaBasicMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlEmbeddedId(getMapping(), (JavaEmbeddedIdMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlEmbedded(getMapping(), (JavaEmbeddedMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlId(getMapping(), (JavaIdMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlManyToMany((JavaManyToManyMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlManyToOne((JavaManyToOneMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlOneToMany((JavaOneToManyMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlOneToOne((JavaOneToOneMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlTransient((JavaTransientMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- else if (javaAttribute.mappingKey() == MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY) {
- ormPersistentAttribute.initialize(new VirtualXmlVersion(getMapping(), (JavaVersionMapping) javaAttribute.getMapping(), getMapping().isMetadataComplete()));
- }
- return ormPersistentAttribute;
- }
-
- protected void updateIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlId id : attributes.getIds()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(id);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(id);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- protected void updateEmbeddedIds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlEmbeddedId embeddedId : attributes.getEmbeddedIds()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(embeddedId);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(embeddedId);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- protected void updateBasics(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlBasic basic : attributes.getBasics()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(basic);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(basic);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- protected void updateVersions(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlVersion version : attributes.getVersions()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(version);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(version);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
- protected void updateManyToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlManyToOne manyToOne : attributes.getManyToOnes()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(manyToOne);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(manyToOne);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
- protected void updateOneToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlOneToMany oneToMany : attributes.getOneToManys()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(oneToMany);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(oneToMany);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
- protected void updateOneToOnes(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlOneToOne oneToOne : attributes.getOneToOnes()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(oneToOne);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(oneToOne);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
- protected void updateManyToManys(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlManyToMany manyToMany : attributes.getManyToManys()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(manyToMany);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(manyToMany);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- protected void updateEmbeddeds(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlEmbedded embedded : attributes.getEmbeddeds()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(embedded);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(embedded);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- protected void updateTransients(Attributes attributes, ListIterator<OrmPersistentAttribute> ormPersistentAttributes) {
- for (XmlTransient transientResource : attributes.getTransients()) {
- if (ormPersistentAttributes.hasNext()) {
- ormPersistentAttributes.next().update(transientResource);
- }
- else {
- OrmPersistentAttribute ormPersistentAttribute = jpaFactory().buildOrmPersistentAttribute(this, MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.initialize(transientResource);
- addSpecifiedPersistentAttribute_(ormPersistentAttribute);
- }
- }
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<OrmPersistentAttribute> attributes = attributesNamed(attributeName);
- if (attributes.hasNext()) {
- OrmPersistentAttribute attribute = attributes.next();
- return attributes.hasNext() ? null /* more than one */: attribute;
- }
- else if (parentPersistentType() != null) {
- return parentPersistentType().resolveAttribute(attributeName);
- }
- else {
- return null;
- }
- }
-
- @Override
- public OrmPersistentType ormPersistentType() {
- return this;
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- for (OrmPersistentAttribute attribute : CollectionTools.iterable(specifiedAttributes())) {
- if (attribute.contains(textOffset)) {
- return attribute;
- }
- }
- return this;
- }
-
- public boolean contains(int textOffset) {
- return this.ormTypeMapping.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- return this.ormTypeMapping.selectionTextRange();
- }
-
- //******************** validation **********************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
-
- getMapping().addToMessages(messages);
-
- for (OrmPersistentAttribute persistentAttribute : CollectionTools.iterable(this.attributes())) {
- persistentAttribute.addToMessages(messages);
- }
- }
-
- public TextRange validationTextRange() {
- return this.ormTypeMapping.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java
deleted file mode 100644
index c9d8830233..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,130 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.orm.OrmAbstractJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.Table;
-
-public class GenericOrmPrimaryKeyJoinColumn extends AbstractOrmNamedColumn<XmlPrimaryKeyJoinColumn>
- implements OrmPrimaryKeyJoinColumn
-{
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected XmlPrimaryKeyJoinColumn primaryKeyJoinColumn;
-
- public GenericOrmPrimaryKeyJoinColumn(OrmJpaContextNode parent, OrmAbstractJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- protected XmlPrimaryKeyJoinColumn columnResource() {
- return this.primaryKeyJoinColumn;
- }
-
- @Override
- protected void addColumnResource() {
- //primaryKeyJoinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlPrimaryKeyJoinColumn is removed/added to the XmlEntity collection
- }
-
- @Override
- protected void removeColumnResource() {
- //primaryKeyJoinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlPrimaryKeyJoinColumn is removed/added to the XmlEntity collection
- }
-
- public String getReferencedColumnName() {
- return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName();
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- columnResource().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- @Override
- public OrmAbstractJoinColumn.Owner owner() {
- return (OrmAbstractJoinColumn.Owner) this.owner;
- }
-
- public Column dbReferencedColumn() {
- Table table = this.dbReferencedColumnTable();
- return (table == null) ? null : table.columnNamed(this.getReferencedColumnName());
- }
-
- public Table dbReferencedColumnTable() {
- return owner().dbReferencedColumnTable();
- }
-
- @Override
- protected String tableName() {
- return this.owner().typeMapping().tableName();
- }
-
- public boolean isReferencedColumnResolved() {
- return dbReferencedColumn() != null;
- }
-
- public TextRange referencedColumnNameTextRange() {
- if (columnResource() != null) {
- return columnResource().referencedColumnNameTextRange();
- }
- return this.parent().validationTextRange();
- }
-
-
- public boolean isVirtual() {
- return owner().isVirtual(this);
- }
-
- @Override
- public void initialize(XmlPrimaryKeyJoinColumn column) {
- this.primaryKeyJoinColumn = column;
- super.initialize(column);
- this.specifiedReferencedColumnName = column.getReferencedColumnName();
- this.defaultReferencedColumnName = defaultReferencedColumnName();
- }
-
- @Override
- public void update(XmlPrimaryKeyJoinColumn column) {
- this.primaryKeyJoinColumn = column;
- super.update(column);
- this.setSpecifiedReferencedColumnName(column.getReferencedColumnName());
- this.setDefaultReferencedColumnName(defaultReferencedColumnName());
- }
-
- protected String defaultReferencedColumnName() {
- //TODO
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.java
deleted file mode 100644
index 18e8f472e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmQueryHint.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-
-
-public class GenericOrmQueryHint extends AbstractOrmJpaContextNode implements OrmQueryHint
-{
-
- protected String name;
-
- protected String value;
-
- protected XmlQueryHint queryHint;
-
- public GenericOrmQueryHint(OrmQuery parent) {
- super(parent);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.queryHint.setName(newName);
- firePropertyChanged(QueryHint.NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.queryHint.setValue(newValue);
- firePropertyChanged(QueryHint.VALUE_PROPERTY, oldValue, newValue);
- }
-
- public void initialize(XmlQueryHint queryHint) {
- this.queryHint = queryHint;
- this.name = queryHint.getName();
- this.value = queryHint.getValue();
- }
-
- public void update(XmlQueryHint queryHint) {
- this.queryHint = queryHint;
- this.setName(queryHint.getName());
- this.setValue(queryHint.getValue());
- }
-
- public TextRange validationTextRange() {
- return this.queryHint.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
deleted file mode 100644
index e69565f337..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSecondaryTable.java
+++ /dev/null
@@ -1,284 +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.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAbstractJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmSecondaryTable extends AbstractOrmTable
- implements OrmSecondaryTable
-{
- protected XmlSecondaryTable secondaryTable;
-
- protected final List<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected final List<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns;
-
- public GenericOrmSecondaryTable(OrmEntity parent) {
- super(parent);
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- this.defaultPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
-// this.getDefaultPrimaryKeyJoinColumns().add(this.createPrimaryKeyJoinColumn(0));
- }
-
- @Override
- public OrmEntity parent() {
- return (OrmEntity) super.parent();
- }
-
- public OrmEntity ormEntity() {
- return parent();
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumns);
- }
-
- public OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.specifiedPrimaryKeyJoinColumns.isEmpty() ? this.defaultPrimaryKeyJoinColumns() : this.specifiedPrimaryKeyJoinColumns();
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public int defaultPrimaryKeyJoinColumnsSize() {
- return this.defaultPrimaryKeyJoinColumns.size();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = jpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- this.secondaryTable.getPrimaryKeyJoinColumns().add(index, OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- this.fireItemAdded(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- return primaryKeyJoinColumn;
- }
-
- protected OrmAbstractJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(pkJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- this.secondaryTable.getPrimaryKeyJoinColumns().remove(index);
- fireItemRemoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.secondaryTable.getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- public boolean isVirtual() {
- return ormEntity().containsVirtualSecondaryTable(this);
- }
-
- @Override
- protected void addTableResource() {
- //secondaryTables are part of a collection, the secondary-table element will be removed/added
- //when the XmlSecondaryTable is removed/added to the XmlEntity collection
- }
-
- @Override
- protected void removeTableResource() {
- //secondaryTables are part of a collection, the secondary-table element will be removed/added
- //when the XmlSecondaryTable is removed/added to the XmlEntity collection
- }
-
- @Override
- protected XmlSecondaryTable table() {
- return this.secondaryTable;
- }
-
- public void initialize(XmlSecondaryTable secondaryTable) {
- this.secondaryTable = secondaryTable;
- super.initialize(secondaryTable);
- this.initializeSpecifiedPrimaryKeyJoinColumns(secondaryTable);
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns(XmlSecondaryTable secondaryTable) {
- for (XmlPrimaryKeyJoinColumn primaryKeyJoinColumn : secondaryTable.getPrimaryKeyJoinColumns()) {
- this.specifiedPrimaryKeyJoinColumns.add(createPrimaryKeyJoinColumn(primaryKeyJoinColumn));
- }
- }
-
- public void update(XmlSecondaryTable secondaryTable) {
- this.secondaryTable = secondaryTable;
- super.update(secondaryTable);
- this.updateSpecifiedPrimaryKeyJoinColumns(secondaryTable);
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(XmlSecondaryTable secondaryTable) {
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<XmlPrimaryKeyJoinColumn> resourcePrimaryKeyJoinColumns = secondaryTable.getPrimaryKeyJoinColumns().listIterator();
-
- while (primaryKeyJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update(resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(specifiedPrimaryKeyJoinColumnsSize(), createPrimaryKeyJoinColumn(resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected OrmPrimaryKeyJoinColumn createPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = jpaFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner());
- ormPrimaryKeyJoinColumn.initialize(primaryKeyJoinColumn);
- return ormPrimaryKeyJoinColumn;
- }
-
- @Override
- //no default name for secondaryTables
- protected String defaultName() {
- return null;
- }
-
- @Override
- protected String defaultCatalog() {
- return entityMappings().getCatalog();
- }
-
- @Override
- protected String defaultSchema() {
- return entityMappings().getSchema();
- }
-
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addTableMessages(messages);
-
- for (OrmPrimaryKeyJoinColumn pkJoinColumn : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- pkJoinColumn.addToMessages(messages);
- }
- }
-
- protected void addTableMessages(List<IMessage> messages) {
- boolean doContinue = isConnected();
- String schema = getSchema();
-
- if (doContinue && ! hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA,
- new String[] {schema, getName()},
- this,
- schemaTextRange())
- );
- doContinue = false;
- }
-
- if (doContinue && ! isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME,
- new String[] {getName()},
- this,
- nameTextRange())
- );
- }
- }
-
- class PrimaryKeyJoinColumnOwner implements OrmAbstractJoinColumn.Owner
- {
-
- public TypeMapping typeMapping() {
- return GenericOrmSecondaryTable.this.ormEntity();
- }
-
- public Table dbTable(String tableName) {
- return GenericOrmSecondaryTable.this.dbTable();
- }
-
- public Table dbReferencedColumnTable() {
- return typeMapping().primaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericOrmSecondaryTable.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(AbstractJoinColumn joinColumn) {
- return GenericOrmSecondaryTable.this.defaultPrimaryKeyJoinColumns.contains(joinColumn);
- }
-
- public String defaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return ormEntity().parentEntity().primaryKeyColumnName();
- }
-
- public TextRange validationTextRange() {
- // TODO Auto-generated method stub
- return null;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.java
deleted file mode 100644
index 46268f1465..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmSequenceGenerator.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-
-public class GenericOrmSequenceGenerator extends AbstractOrmGenerator<XmlSequenceGenerator>
- implements OrmSequenceGenerator
-{
-
- protected String specifiedSequenceName;
-
- protected String defaultSequenceName;
-
- public GenericOrmSequenceGenerator(OrmJpaContextNode parent) {
- super(parent);
- }
-
- public String getSequenceName() {
- return (this.getSpecifiedSequenceName() == null) ? getDefaultSequenceName() : this.getSpecifiedSequenceName();
- }
-
- public String getSpecifiedSequenceName() {
- return this.specifiedSequenceName;
- }
-
- public void setSpecifiedSequenceName(String newSpecifiedSequenceName) {
- String oldSpecifiedSequenceName = this.specifiedSequenceName;
- this.specifiedSequenceName = newSpecifiedSequenceName;
- generatorResource().setSequenceName(newSpecifiedSequenceName);
- firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, oldSpecifiedSequenceName, newSpecifiedSequenceName);
- }
-
- protected void setSpecifiedSequenceName_(String newSpecifiedSequenceName) {
- String oldSpecifiedSequenceName = this.specifiedSequenceName;
- this.specifiedSequenceName = newSpecifiedSequenceName;
- firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, oldSpecifiedSequenceName, newSpecifiedSequenceName);
- }
-
- public String getDefaultSequenceName() {
- return this.defaultSequenceName;
- }
-
- protected void setDefaultSequenceName(String newDefaultSequenceName) {
- String oldSpecifiedSequenceName = this.defaultSequenceName;
- this.defaultSequenceName = newDefaultSequenceName;
- firePropertyChanged(DEFAULT_SEQUENCE_NAME_PROPERTY, oldSpecifiedSequenceName, newDefaultSequenceName);
- }
-
- @Override
- public void initialize(XmlSequenceGenerator sequenceGenerator) {
- super.initialize(sequenceGenerator);
- this.specifiedSequenceName = this.specifiedSequenceName(sequenceGenerator);
- //TODO default sequence name
- }
-
- @Override
- public void update(XmlSequenceGenerator sequenceGenerator) {
- super.update(sequenceGenerator);
- this.setSpecifiedSequenceName_(this.specifiedSequenceName(sequenceGenerator));
- //TODO default sequence name
- }
-
- protected String specifiedSequenceName(XmlSequenceGenerator generatorResource) {
- return generatorResource.getSequenceName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java
deleted file mode 100644
index 61ef034e69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTable.java
+++ /dev/null
@@ -1,158 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlTable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmTable extends AbstractOrmTable implements OrmTable
-{
-
- protected XmlEntity entity;
-
- public GenericOrmTable(OrmEntity parent) {
- super(parent);
- }
-
- public OrmEntity ormEntity() {
- return (OrmEntity) super.parent();
- }
-
- @Override
- protected XmlTable table() {
- return this.entity.getTable();
- }
-
- @Override
- protected void removeTableResource() {
- this.entity.setTable(null);
- }
-
- @Override
- protected void addTableResource() {
- this.entity.setTable(OrmFactory.eINSTANCE.createXmlTable());
-
- }
-
- protected JavaTable javaTable() {
- JavaEntity javaEntity = ormEntity().javaEntity();
- if (javaEntity != null) {
- return javaEntity.getTable();
- }
- return null;
- }
-
- public void initialize(XmlEntity entity) {
- this.entity = entity;
- this.initialize(this.table());
- }
-
- public void update(XmlEntity entity) {
- this.entity = entity;
- this.update(this.table());
- }
-
- @Override
- protected String defaultName() {
- JavaTable javaTable = javaTable();
- if (javaTable != null) {
- if (ormEntity().isMetadataComplete() || (table() != null)) {
- return javaTable.getDefaultName();
- }
- return javaTable.getName();
- }
- Entity rootEntity = ormEntity().rootEntity();
- if (rootEntity != ormEntity()) {
- if (rootEntity.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- return rootEntity.getTable().getName();
- }
- }
- return ormEntity().getName();
- }
-
- @Override
- protected String defaultSchema() {
- JavaTable javaTable = javaTable();
- if (javaTable != null ) {
- if (ormEntity().isMetadataComplete() || (table() != null)) {
- return javaTable.getDefaultSchema();
- }
- return javaTable.getSchema();
- }
- Entity rootEntity = ormEntity().rootEntity();
- if (rootEntity != ormEntity()) {
- if (rootEntity.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- return rootEntity.getTable().getSchema();
- }
- }
- return entityMappings().getSchema();
- }
-
- @Override
- protected String defaultCatalog() {
- JavaTable javaTable = javaTable();
- if (javaTable != null) {
- if (ormEntity().isMetadataComplete() || (table() != null)) {
- return javaTable.getDefaultCatalog();
- }
- return javaTable.getCatalog();
- }
- Entity rootEntity = ormEntity().rootEntity();
- if (rootEntity != ormEntity()) {
- if (rootEntity.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
- return rootEntity.getTable().getCatalog();
- }
- }
- return entityMappings().getCatalog();
- }
-
- //*********** Validation *******************************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- boolean doContinue = isConnected();
- String schema = this.getSchema();
-
- if (doContinue && ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_SCHEMA,
- new String[] {schema, this.getName()},
- this,
- this.schemaTextRange())
- );
- doContinue = false;
- }
-
- if (doContinue && ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.nameTextRange())
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java
deleted file mode 100644
index de8d2a031a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTableGenerator.java
+++ /dev/null
@@ -1,306 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-public class GenericOrmTableGenerator extends AbstractOrmGenerator<XmlTableGenerator> implements OrmTableGenerator
-{
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected String specifiedPkColumnName;
- protected String defaultPkColumnName;
-
- protected String specifiedValueColumnName;
- protected String defaultValueColumnName;
-
- protected String specifiedPkColumnValue;
- protected String defaultPkColumnValue;
-
-// protected EList<IUniqueConstraint> uniqueConstraints;
-
-
- public GenericOrmTableGenerator(OrmJpaContextNode parent) {
- super(parent);
- }
-
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- generatorResource().setTable(newSpecifiedTable);
- firePropertyChanged(SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String newDefaultTable) {
- String oldDefaultTable = this.defaultTable;
- this.defaultTable = newDefaultTable;
- firePropertyChanged(DEFAULT_TABLE_PROPERTY, oldDefaultTable, newDefaultTable);
- }
-
- public String getCatalog() {
- return (this.getSpecifiedCatalog() == null) ? getDefaultCatalog() : this.getSpecifiedCatalog();
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- generatorResource().setCatalog(newSpecifiedCatalog);
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- protected void setSpecifiedCatalog_(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- public String getSchema() {
- return (this.getSpecifiedSchema() == null) ? getDefaultSchema() : this.getSpecifiedSchema();
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- generatorResource().setSchema(newSpecifiedSchema);
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- protected void setSpecifiedSchema_(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(this.defaultSchema, oldDefaultSchema, newDefaultSchema);
- }
-
- public String getPkColumnName() {
- return (this.getSpecifiedPkColumnName() == null) ? getDefaultPkColumnName() : this.getSpecifiedPkColumnName();
- }
-
- public String getSpecifiedPkColumnName() {
- return this.specifiedPkColumnName;
- }
-
- public void setSpecifiedPkColumnName(String newSpecifiedPkColumnName) {
- String oldSpecifiedPkColumnName = this.specifiedPkColumnName;
- this.specifiedPkColumnName = newSpecifiedPkColumnName;
- generatorResource().setPkColumnName(newSpecifiedPkColumnName);
- firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, oldSpecifiedPkColumnName, newSpecifiedPkColumnName);
- }
-
- protected void setSpecifiedPkColumnName_(String newSpecifiedPkColumnName) {
- String oldSpecifiedPkColumnName = this.specifiedPkColumnName;
- this.specifiedPkColumnName = newSpecifiedPkColumnName;
- firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, oldSpecifiedPkColumnName, newSpecifiedPkColumnName);
- }
-
- public String getDefaultPkColumnName() {
- return this.defaultPkColumnName;
- }
-
- protected void setDefaultPkColumnName(String newDefaultPkColumnName) {
- String oldDefaultPkColumnName = this.defaultPkColumnName;
- this.defaultPkColumnName = newDefaultPkColumnName;
- firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, oldDefaultPkColumnName, newDefaultPkColumnName);
- }
-
- public String getValueColumnName() {
- return (this.getSpecifiedValueColumnName() == null) ? getDefaultValueColumnName() : this.getSpecifiedValueColumnName();
- }
-
- public String getSpecifiedValueColumnName() {
- return this.specifiedValueColumnName;
- }
-
- public void setSpecifiedValueColumnName(String newSpecifiedValueColumnName) {
- String oldSpecifiedValueColumnName = this.specifiedValueColumnName;
- this.specifiedValueColumnName = newSpecifiedValueColumnName;
- generatorResource().setValueColumnName(newSpecifiedValueColumnName);
- firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, oldSpecifiedValueColumnName, newSpecifiedValueColumnName);
- }
-
- protected void setSpecifiedValueColumnName_(String newSpecifiedValueColumnName) {
- String oldSpecifiedValueColumnName = this.specifiedValueColumnName;
- this.specifiedValueColumnName = newSpecifiedValueColumnName;
- firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, oldSpecifiedValueColumnName, newSpecifiedValueColumnName);
- }
-
- public String getDefaultValueColumnName() {
- return this.defaultValueColumnName;
- }
-
- protected void setDefaultValueColumnName(String newDefaultValueColumnName) {
- String oldDefaultValueColumnName = this.defaultValueColumnName;
- this.defaultValueColumnName = newDefaultValueColumnName;
- firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, oldDefaultValueColumnName, newDefaultValueColumnName);
- }
-
- public String getPkColumnValue() {
- return (this.getSpecifiedPkColumnValue() == null) ? getDefaultPkColumnValue() : this.getSpecifiedPkColumnValue();
- }
-
- public String getSpecifiedPkColumnValue() {
- return this.specifiedPkColumnValue;
- }
-
- public void setSpecifiedPkColumnValue(String newSpecifiedPkColumnValue) {
- String oldSpecifiedPkColumnValue = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = newSpecifiedPkColumnValue;
- generatorResource().setPkColumnValue(newSpecifiedPkColumnValue);
- firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, oldSpecifiedPkColumnValue, newSpecifiedPkColumnValue);
- }
-
- protected void setSpecifiedPkColumnValue_(String newSpecifiedPkColumnValue) {
- String oldSpecifiedPkColumnValue = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = newSpecifiedPkColumnValue;
- firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, oldSpecifiedPkColumnValue, newSpecifiedPkColumnValue);
- }
-
- public String getDefaultPkColumnValue() {
- return this.defaultPkColumnValue;
- }
-
- public void setDefaultPkColumnValue(String newDefaultPkColumnValue) {
- String oldDefaultPkColumnValue = this.defaultPkColumnValue;
- this.defaultPkColumnValue = newDefaultPkColumnValue;
- firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, oldDefaultPkColumnValue, newDefaultPkColumnValue);
- }
-
-// public EList<IUniqueConstraint> getUniqueConstraints() {
-// if (uniqueConstraints == null) {
-// uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
-// }
-// return uniqueConstraints;
-// }
-
-
-// public void refreshDefaults(DefaultsContext defaultsContext) {
-// setDefaultSchema((String) defaultsContext.getDefault(GenericJpaPlatform.DEFAULT_TABLE_GENERATOR_SCHEMA_KEY));
-// }
-//
-// public IUniqueConstraint createUniqueConstraint(int index) {
-// return createXmlJavaUniqueConstraint(index);
-// }
-//
-// protected XmlUniqueConstraint createXmlJavaUniqueConstraint(int index) {
-// return OrmFactory.eINSTANCE.createXmlUniqueConstraint();
-// }
-
- public Table dbTable() {
- Schema schema = this.dbSchema();
- return (schema == null) ? null : schema.tableNamed(this.getTable());
- }
-
- public Schema dbSchema() {
- return this.database().schemaNamed(this.getSchema());
- }
-
- // ********** orm resource model -> context model **********
-
- @Override
- public void initialize(XmlTableGenerator tableGenerator) {
- super.initialize(tableGenerator);
- this.specifiedTable = this.specifiedTable(tableGenerator);
- this.specifiedCatalog = this.specifiedCatalog(tableGenerator);
- this.specifiedSchema = this.specifiedSchema(tableGenerator);
- this.specifiedPkColumnName = this.specifiedPkColumnName(tableGenerator);
- this.specifiedValueColumnName = this.specifiedValueColumnName(tableGenerator);
- this.specifiedPkColumnValue = this.specifiedPkColumnValue(tableGenerator);
- //TODO defaults
- //this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- @Override
- public void update(XmlTableGenerator tableGenerator) {
- super.update(tableGenerator);
- this.setSpecifiedTable_(this.specifiedTable(tableGenerator));
- this.setSpecifiedCatalog_(this.specifiedCatalog(tableGenerator));
- this.setSpecifiedSchema_(this.specifiedSchema(tableGenerator));
- this.setSpecifiedPkColumnName_(this.specifiedPkColumnName(tableGenerator));
- this.setSpecifiedValueColumnName_(this.specifiedValueColumnName(tableGenerator));
- this.setSpecifiedPkColumnValue_(this.specifiedPkColumnValue(tableGenerator));
- //TODO defaults
- //this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String specifiedTable(XmlTableGenerator tableGenerator) {
- return tableGenerator.getTable();
- }
-
- protected String specifiedCatalog(XmlTableGenerator tableGenerator) {
- return tableGenerator.getCatalog();
- }
-
- protected String specifiedSchema(XmlTableGenerator tableGenerator) {
- return tableGenerator.getSchema();
- }
-
- protected String specifiedPkColumnName(XmlTableGenerator tableGenerator) {
- return tableGenerator.getPkColumnName();
- }
-
- protected String specifiedValueColumnName(XmlTableGenerator tableGenerator) {
- return tableGenerator.getValueColumnName();
- }
-
- protected String specifiedPkColumnValue(XmlTableGenerator tableGenerator) {
- return tableGenerator.getPkColumnValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.java
deleted file mode 100644
index 61f7d546a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmTransientMapping.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-
-public class GenericOrmTransientMapping extends AbstractOrmAttributeMapping<XmlTransient> implements OrmTransientMapping
-{
-
- public GenericOrmTransientMapping(OrmPersistentAttribute parent) {
- super(parent);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmTransientMapping(this);
- }
-
- public int xmlSequence() {
- return 8;
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlTransient addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlTransient transientResource = OrmFactory.eINSTANCE.createXmlTransientImpl();
- persistentAttribute().initialize(transientResource);
- typeMapping.getAttributes().getTransients().add(transientResource);
- return transientResource;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getTransients().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- @Override
- public void initialize(XmlTransient transientResource) {
- super.initialize(transientResource);
- }
-
- @Override
- public void update(XmlTransient transientResource) {
- super.update(transientResource);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java
deleted file mode 100644
index e6d06b6112..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmVersionMapping.java
+++ /dev/null
@@ -1,136 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.db.internal.Table;
-
-
-public class GenericOrmVersionMapping extends AbstractOrmAttributeMapping<XmlVersion>
- implements OrmVersionMapping
-{
- protected final OrmColumn column;
-
- protected TemporalType temporal;
-
- public GenericOrmVersionMapping(OrmPersistentAttribute parent) {
- super(parent);
- this.column = jpaFactory().buildOrmColumn(this, this);
- }
-
- public int xmlSequence() {
- return 2;
- }
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmVersionMapping(this);
- }
-
- @Override
- public void initializeFromXmlColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromXmlColumnMapping(oldMapping);
- setTemporal(oldMapping.getTemporal());
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public TemporalType getTemporal() {
- return this.temporal;
- }
-
- public void setTemporal(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- this.attributeMapping().setTemporal(TemporalType.toOrmResourceModel(newTemporal));
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- protected void setTemporal_(TemporalType newTemporal) {
- TemporalType oldTemporal = this.temporal;
- this.temporal = newTemporal;
- firePropertyChanged(ColumnMapping.TEMPORAL_PROPERTY, oldTemporal, newTemporal);
- }
-
- public XmlVersion addToResourceModel(AbstractXmlTypeMapping typeMapping) {
- XmlVersion version = OrmFactory.eINSTANCE.createXmlVersionImpl();
- persistentAttribute().initialize(version);
- typeMapping.getAttributes().getVersions().add(version);
- return version;
- }
-
- public void removeFromResourceModel(AbstractXmlTypeMapping typeMapping) {
- typeMapping.getAttributes().getVersions().remove(this.attributeMapping());
- if (typeMapping.getAttributes().isAllFeaturesUnset()) {
- typeMapping.setAttributes(null);
- }
- }
-
- public String defaultColumnName() {
- return attributeName();
- }
-
- public String defaultTableName() {
- return typeMapping().tableName();
- }
-
- public Table dbTable(String tableName) {
- return typeMapping().dbTable(tableName);
- }
-
- @Override
- public void initialize(XmlVersion version) {
- super.initialize(version);
- this.temporal = this.specifiedTemporal(version);
- this.column.initialize(version.getColumn());
- }
-
- @Override
- public void update(XmlVersion version) {
- super.update(version);
- this.setTemporal_(this.specifiedTemporal(version));
- this.column.update(version.getColumn());
- }
-
- protected TemporalType specifiedTemporal(XmlVersion version) {
- return TemporalType.fromOrmResourceModel(version.getTemporal());
- }
-
- //***************** IXmlColumn.Owner implementation ****************
-
- public XmlColumn columnResource() {
- return this.attributeMapping().getColumn();
- }
-
- public void addColumnResource() {
- this.attributeMapping().setColumn(OrmFactory.eINSTANCE.createXmlColumnImpl());
- }
-
- public void removeColumnResource() {
- this.attributeMapping().setColumn(null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java
deleted file mode 100644
index 6aedb2c981..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,219 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-
-public class GenericPersistenceUnitDefaults extends AbstractOrmJpaContextNode
- implements PersistenceUnitDefaults
-{
- protected String schema;
-
- protected String catalog;
-
- protected AccessType access;
-
- protected boolean cascadePersist;
-
- protected XmlEntityMappings entityMappings;
-
- public GenericPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.initialize(xmlEntityMappings);
- }
-
- public AccessType getAccess() {
- return this.access;
- }
-
- public void setAccess(AccessType newAccess) {
- AccessType oldAccess = this.access;
- this.access = newAccess;
- if (oldAccess != newAccess) {
- if (this.persistenceUnitDefaults() != null) {
- this.persistenceUnitDefaults().setAccess(AccessType.toXmlResourceModel(newAccess));
- if (this.persistenceUnitDefaults().isAllFeaturesUnset()) {
- this.persistenceUnitMetadata().setPersistenceUnitDefaults(null);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- }
- else {
- if (persistenceUnitMetadata() == null) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- }
- persistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitDefaults().setAccess(AccessType.toXmlResourceModel(newAccess));
- }
- }
- firePropertyChanged(PersistenceUnitDefaults.ACCESS_PROPERTY, oldAccess, newAccess);
- }
-
- protected void setAccess_(AccessType newAccess) {
- AccessType oldAccess = this.access;
- this.access = newAccess;
- firePropertyChanged(PersistenceUnitDefaults.ACCESS_PROPERTY, oldAccess, newAccess);
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String newCatalog) {
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- if (oldCatalog != newCatalog) {
- if (this.persistenceUnitDefaults() != null) {
- this.persistenceUnitDefaults().setCatalog(newCatalog);
- if (this.persistenceUnitDefaults().isAllFeaturesUnset()) {
- this.persistenceUnitMetadata().setPersistenceUnitDefaults(null);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- }
- else {
- if (persistenceUnitMetadata() == null) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- }
- persistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitDefaults().setCatalog(newCatalog);
- }
- }
- firePropertyChanged(PersistenceUnitDefaults.CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- protected void setCatalog_(String newCatalog) {
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- firePropertyChanged(PersistenceUnitDefaults.CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String newSchema) {
- String oldSchema = this.schema;
- this.schema = newSchema;
- if (oldSchema != newSchema) {
- if (this.persistenceUnitDefaults() != null) {
- this.persistenceUnitDefaults().setSchema(newSchema);
- if (this.persistenceUnitDefaults().isAllFeaturesUnset()) {
- this.persistenceUnitMetadata().setPersistenceUnitDefaults(null);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- }
- else {
- if (persistenceUnitMetadata() == null) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- }
- persistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitDefaults().setSchema(newSchema);
- }
- }
- firePropertyChanged(PersistenceUnitDefaults.SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- protected void setSchema_(String newSchema) {
- String oldSchema = this.schema;
- this.schema = newSchema;
- firePropertyChanged(PersistenceUnitDefaults.SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean newCascadePersist) {
- boolean oldCascadePersist = this.cascadePersist;
- this.cascadePersist = newCascadePersist;
- if (oldCascadePersist != newCascadePersist) {
- if (this.persistenceUnitDefaults() != null) {
- this.persistenceUnitDefaults().setCascadePersist(newCascadePersist);
- if (this.persistenceUnitDefaults().isAllFeaturesUnset()) {
- this.persistenceUnitMetadata().setPersistenceUnitDefaults(null);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- }
- else if (newCascadePersist) {
- if (persistenceUnitMetadata() == null) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- }
- persistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitDefaults().setCascadePersist(newCascadePersist);
- }
- }
- firePropertyChanged(PersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY, oldCascadePersist, newCascadePersist);
- }
-
- protected void setCascadePersist_(boolean newCascadePersist) {
- boolean oldCascadePersist = this.cascadePersist;
- this.cascadePersist = newCascadePersist;
- firePropertyChanged(PersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY, oldCascadePersist, newCascadePersist);
- }
-
- protected void initialize(XmlEntityMappings entityMappings) {
- this.entityMappings = entityMappings;
- if (this.persistenceUnitDefaults() != null) {
- this.access = AccessType.fromXmlResourceModel(this.persistenceUnitDefaults().getAccess());
- this.cascadePersist = this.persistenceUnitDefaults().isCascadePersist();
- this.catalog = this.persistenceUnitDefaults().getCatalog();
- this.schema = this.persistenceUnitDefaults().getSchema();
- }
- }
-
-
- public void update(XmlEntityMappings entityMappings) {
- this.entityMappings = entityMappings;
- if (this.persistenceUnitDefaults() != null) {
- this.setAccess_(AccessType.fromXmlResourceModel(this.persistenceUnitDefaults().getAccess()));
- this.setCascadePersist_(this.persistenceUnitDefaults().isCascadePersist());
- this.setCatalog_(this.persistenceUnitDefaults().getCatalog());
- this.setSchema_(this.persistenceUnitDefaults().getSchema());
- }
- else {
- this.setAccess_(null);
- this.setCascadePersist_(false);
- this.setCatalog_(null);
- this.setSchema_(null);
- }
- }
-
- protected XmlPersistenceUnitDefaults persistenceUnitDefaults() {
- if (persistenceUnitMetadata() != null) {
- return persistenceUnitMetadata().getPersistenceUnitDefaults();
- }
- return null;
- }
-
- protected XmlPersistenceUnitMetadata persistenceUnitMetadata() {
- return this.entityMappings.getPersistenceUnitMetadata();
- }
-
- public TextRange validationTextRange() {
- if (persistenceUnitDefaults() != null) {
- return persistenceUnitDefaults().validationTextRange();
- }
- return this.entityMappings.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java
deleted file mode 100644
index 88f732998a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,95 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-
-public class GenericPersistenceUnitMetadata extends AbstractOrmJpaContextNode
- implements PersistenceUnitMetadata
-{
- protected boolean xmlMappingMetadataComplete;
-
- protected final PersistenceUnitDefaults persistenceUnitDefaults;
-
- protected XmlEntityMappings entityMappings;
-
- public GenericPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.persistenceUnitDefaults = jpaFactory().buildPersistenceUnitDefaults(this, xmlEntityMappings);
- this.initialize(xmlEntityMappings);
- }
-
- public boolean isXmlMappingMetadataComplete() {
- return this.xmlMappingMetadataComplete;
- }
-
- public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete) {
- boolean oldXmlMappingMetadataComplete = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- if (oldXmlMappingMetadataComplete != newXmlMappingMetadataComplete) {
- if (this.persistenceUnitMetadata() != null) {
- this.persistenceUnitMetadata().setXmlMappingMetadataComplete(newXmlMappingMetadataComplete);
- if (this.persistenceUnitMetadata().isAllFeaturesUnset()) {
- this.entityMappings.setPersistenceUnitMetadata(null);
- }
- }
- else if (newXmlMappingMetadataComplete) {
- this.entityMappings.setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- this.persistenceUnitMetadata().setXmlMappingMetadataComplete(newXmlMappingMetadataComplete);
- }
- }
- firePropertyChanged(PersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY, oldXmlMappingMetadataComplete, newXmlMappingMetadataComplete);
- }
-
- protected void setXmlMappingMetadataComplete_(boolean newXmlMappingMetadataComplete) {
- boolean oldXmlMappingMetadataComplete = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- firePropertyChanged(PersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY, oldXmlMappingMetadataComplete, newXmlMappingMetadataComplete);
- }
-
- public PersistenceUnitDefaults getPersistenceUnitDefaults() {
- return this.persistenceUnitDefaults;
- }
-
- protected void initialize(XmlEntityMappings entityMappings) {
- this.entityMappings = entityMappings;
- if (this.persistenceUnitMetadata() != null) {
- this.xmlMappingMetadataComplete = this.persistenceUnitMetadata().isXmlMappingMetadataComplete();
- }
- }
-
- public void update(XmlEntityMappings entityMappings) {
- this.entityMappings = entityMappings;
- if (this.persistenceUnitMetadata() != null) {
- setXmlMappingMetadataComplete_(this.persistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
- else {
- setXmlMappingMetadataComplete_(false);
- }
- this.persistenceUnitDefaults.update(entityMappings);
- }
-
- protected XmlPersistenceUnitMetadata persistenceUnitMetadata() {
- return this.entityMappings.getPersistenceUnitMetadata();
- }
-
- public TextRange validationTextRange() {
- if (persistenceUnitMetadata() != null) {
- return persistenceUnitMetadata().validationTextRange();
- }
- return this.entityMappings.validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.java
deleted file mode 100644
index f5daddd731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmBasicMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmBasicMappingProvider INSTANCE = new OrmBasicMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmBasicMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmBasicMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmBasicMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java
deleted file mode 100644
index cb71dcd0d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmCascade.java
+++ /dev/null
@@ -1,246 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping;
-
-
-public class OrmCascade extends AbstractOrmJpaContextNode implements Cascade, OrmJpaContextNode
-{
-
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
-
- protected XmlRelationshipMapping relationshipMapping;
-
- protected OrmCascade(OrmRelationshipMapping parent) {
- super(parent);
- }
-
- public void initializeFrom(Cascade oldCascade) {
- setAll(oldCascade.isAll());
- setPersist(oldCascade.isPersist());
- setMerge(oldCascade.isMerge());
- setRemove(oldCascade.isRemove());
- setRefresh(oldCascade.isRefresh());
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- if (oldAll != newAll) {
- if (this.cascadeResource() != null) {
- this.cascadeResource().setCascadeAll(newAll);
- if (this.cascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newAll != false) {
- addCascadeResource();
- cascadeResource().setCascadeAll(newAll);
- }
- }
- firePropertyChanged(ALL_PROPERTY, oldAll, newAll);
- }
-
- protected void setAll_(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- firePropertyChanged(ALL_PROPERTY, oldAll, newAll);
- }
-
- public boolean isPersist() {
- return this.persist;
- }
-
- public void setPersist(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- if (oldPersist != newPersist) {
- if (this.cascadeResource() != null) {
- this.cascadeResource().setCascadePersist(newPersist);
- if (this.cascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newPersist != false) {
- addCascadeResource();
- cascadeResource().setCascadePersist(newPersist);
- }
- }
- firePropertyChanged(PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- protected void setPersist_(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- firePropertyChanged(PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
-
- public boolean isMerge() {
- return this.merge;
- }
-
- public void setMerge(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- if (oldMerge != newMerge) {
- if (this.cascadeResource() != null) {
- this.cascadeResource().setCascadeMerge(newMerge);
- if (this.cascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newMerge != false) {
- addCascadeResource();
- cascadeResource().setCascadeMerge(newMerge);
- }
- }
- firePropertyChanged(MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- protected void setMerge_(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- firePropertyChanged(MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- public boolean isRemove() {
- return this.remove;
- }
-
- public void setRemove(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- if (oldRemove != newRemove) {
- if (this.cascadeResource() != null) {
- this.cascadeResource().setCascadeRemove(newRemove);
- if (this.cascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newRemove != false) {
- addCascadeResource();
- cascadeResource().setCascadeRemove(newRemove);
- }
- }
- firePropertyChanged(REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- protected void setRemove_(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- firePropertyChanged(REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- public boolean isRefresh() {
- return this.refresh;
- }
-
- public void setRefresh(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- if (oldRefresh != newRefresh) {
- if (this.cascadeResource() != null) {
- this.cascadeResource().setCascadeRefresh(newRefresh);
- if (this.cascadeResource().isAllFeaturesUnset()) {
- removeCascadeResource();
- }
- }
- else if (newRefresh != false) {
- addCascadeResource();
- cascadeResource().setCascadeRefresh(newRefresh);
- }
- }
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- protected void setRefresh_(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
-
- protected CascadeType cascadeResource() {
- return this.relationshipMapping.getCascade();
- }
-
- protected void removeCascadeResource() {
- this.relationshipMapping.setCascade(null);
- }
-
- protected void addCascadeResource() {
- this.relationshipMapping.setCascade(OrmFactory.eINSTANCE.createCascadeTypeImpl());
- }
-
- public void initialize(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- CascadeType cascade = cascadeResource();
- this.all = this.all(cascade);
- this.persist = this.persist(cascade);
- this.merge = this.merge(cascade);
- this.remove = this.remove(cascade);
- this.refresh = this.refresh(cascade);
- }
-
- public void update(XmlRelationshipMapping relationshipMapping) {
- this.relationshipMapping = relationshipMapping;
- CascadeType cascade = cascadeResource();
- this.setAll_(this.all(cascade));
- this.setPersist_(this.persist(cascade));
- this.setMerge_(this.merge(cascade));
- this.setRemove_(this.remove(cascade));
- this.setRefresh_(this.refresh(cascade));
- }
-
- protected boolean all(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeAll();
- }
-
- protected boolean persist(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadePersist();
- }
-
- protected boolean merge(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeMerge();
- }
-
- protected boolean remove(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRemove();
- }
-
- protected boolean refresh(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRefresh();
- }
-
- public TextRange validationTextRange() {
- return this.cascadeResource().validationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java
deleted file mode 100644
index 6975771a9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableProvider.java
+++ /dev/null
@@ -1,29 +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.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingProvider;
-
-
-public class OrmEmbeddableProvider implements OrmTypeMappingProvider
-{
-
- public OrmEmbeddable buildTypeMapping(JpaFactory factory, OrmPersistentType parent) {
- return factory.buildOrmEmbeddable(parent);
- }
-
- public String key() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.java
deleted file mode 100644
index 1f7a776227..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmEmbeddedIdMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmEmbeddedIdMappingProvider INSTANCE = new OrmEmbeddedIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmEmbeddedIdMappingProvider() {
- super();
- }
-
- public OrmEmbeddedIdMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmEmbeddedIdMapping(parent);
- }
-
- public String key() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.java
deleted file mode 100644
index 9052ec5160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmEmbeddedMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmEmbeddedMappingProvider INSTANCE = new OrmEmbeddedMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmEmbeddedMappingProvider() {
- super();
- }
-
- public OrmEmbeddedMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmEmbeddedMapping(parent);
- }
-
- public String key() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.java
deleted file mode 100644
index 8965e37f66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingProvider;
-
-
-public class OrmEntityProvider implements OrmTypeMappingProvider
-{
- public OrmEntity buildTypeMapping(JpaFactory factory, OrmPersistentType parent) {
- return factory.buildOrmEntity(parent);
- }
-
- public String key() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.java
deleted file mode 100644
index f0d5161677..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmIdMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmIdMappingProvider INSTANCE = new OrmIdMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmIdMappingProvider() {
- super();
- }
- public String key() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmIdMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmIdMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.java
deleted file mode 100644
index 265a402353..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmManyToManyMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmManyToManyMappingProvider INSTANCE = new OrmManyToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmManyToManyMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmManyToManyMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmManyToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.java
deleted file mode 100644
index c4522f93ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmManyToOneMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmManyToOneMappingProvider INSTANCE = new OrmManyToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmManyToOneMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmManyToOneMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmManyToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.java
deleted file mode 100644
index f5ced3e494..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingProvider;
-
-
-public class OrmMappedSuperclassProvider implements OrmTypeMappingProvider
-{
- public OrmMappedSuperclass buildTypeMapping(JpaFactory factory, OrmPersistentType parent) {
- return factory.buildOrmMappedSuperclass(parent);
- }
-
- public String key() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.java
deleted file mode 100644
index 63f4cf02b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmNullAttributeMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmNullAttributeMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmNullAttributeMappingProvider INSTANCE = new OrmNullAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmNullAttributeMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmAttributeMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmNullAttributeMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.java
deleted file mode 100644
index b8373d5971..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmOneToManyMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmOneToManyMappingProvider INSTANCE = new OrmOneToManyMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmOneToManyMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmOneToManyMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmOneToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.java
deleted file mode 100644
index 75eeed0a40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class OrmOneToOneMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmOneToOneMappingProvider INSTANCE = new OrmOneToOneMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmOneToOneMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmOneToOneMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmOneToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.java
deleted file mode 100644
index 18952d2e7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-
-public class OrmTransientMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmTransientMappingProvider INSTANCE = new OrmTransientMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmTransientMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmTransientMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmTransientMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.java
deleted file mode 100644
index f0715080e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingProvider.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingProvider;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-
-public class OrmVersionMappingProvider implements OrmAttributeMappingProvider
-{
- // singleton
- private static final OrmVersionMappingProvider INSTANCE = new OrmVersionMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrmVersionMappingProvider() {
- super();
- }
-
- public String key() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public OrmVersionMapping buildAttributeMapping(JpaFactory factory, OrmPersistentAttribute parent) {
- return factory.buildOrmVersionMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java
deleted file mode 100644
index 10587cd007..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmXmlImpl.java
+++ /dev/null
@@ -1,156 +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.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class OrmXmlImpl extends AbstractOrmJpaContextNode
- implements OrmXml
-{
- protected OrmResource ormResource;
-
- protected EntityMappings entityMappings;
-
-
- public OrmXmlImpl(MappingFileRef parent, OrmResource ormResource) {
- super(parent);
- this.initialize(ormResource);
- }
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
- public OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName) {
- if (getEntityMappings() != null) {
- return getEntityMappings().persistentTypeFor(fullyQualifiedTypeName);
- }
- return null;
- }
-
- @Override
- public IResource resource() {
- return ormResource.getFile();
- }
-
- // **************** persistence ********************************************
-
- public EntityMappings getEntityMappings() {
- return this.entityMappings;
- }
-
- protected void setEntityMappings(EntityMappings newEntityMappings) {
- EntityMappings oldEntityMappings = this.entityMappings;
- this.entityMappings = newEntityMappings;
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, oldEntityMappings, newEntityMappings);
- }
-
- public EntityMappings addEntityMappings() {
- if (this.entityMappings != null) {
- throw new IllegalStateException();
- }
-
- XmlEntityMappings xmlEntityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- this.entityMappings = buildEntityMappings(xmlEntityMappings);
- this.ormResource.getContents().add(xmlEntityMappings);
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, null, this.entityMappings);
- return this.entityMappings;
- }
-
- public void removeEntityMappings() {
- if (this.entityMappings == null) {
- throw new IllegalStateException();
- }
-
- EntityMappings oldEntityMappings = this.entityMappings;
- this.entityMappings = null;
- XmlEntityMappings xmlEntityMappings = this.ormResource.getEntityMappings(); //TODO helper removeEntityMappings method on ormResource??
- this.ormResource.getContents().remove(xmlEntityMappings);
- firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, oldEntityMappings, null);
- }
-
- public PersistenceUnitDefaults persistenceUnitDefaults() {
- if (getEntityMappings() != null) {
- return getEntityMappings().persistenceUnitDefaults();
- }
- return null;
- }
- // **************** updating ***********************************************
-
- protected void initialize(OrmResource ormResource) {
- this.ormResource = ormResource;
- if (ormResource.getEntityMappings() != null) {
- this.entityMappings = buildEntityMappings(ormResource.getEntityMappings());
- }
- }
-
- public void update(OrmResource ormResource) {
- this.ormResource = ormResource;
- if (ormResource.getEntityMappings() != null) {
- if (this.entityMappings != null) {
- this.entityMappings.update(ormResource.getEntityMappings());
- }
- else {
- setEntityMappings(buildEntityMappings(ormResource.getEntityMappings()));
- }
- ormResource.resourceModel().addRootStructureNode(getEntityMappings());
- }
- else {
- ormResource.resourceModel().removeRootStructureNode(getEntityMappings());
- setEntityMappings(null);
- }
- }
-
- protected EntityMappings buildEntityMappings(XmlEntityMappings xmlEntityMappings) {
- return jpaFactory().buildEntityMappings(this, xmlEntityMappings);
- }
-
-
- // *************************************************************************
-
- public JpaStructureNode structureNode(int textOffset) {
- if (entityMappings.containsOffset(textOffset)) {
- return entityMappings.structureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange selectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public TextRange validationTextRange() {
- return TextRange.Empty.instance();
- }
-
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- if (getEntityMappings() != null) {
- getEntityMappings().addToMessages(messages);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java
deleted file mode 100644
index b5f5c117d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-
-public class VirtualCascadeType extends AbstractJpaEObject implements CascadeType
-{
- Cascade javaCascade;
-
- protected boolean metadataComplete;
-
- public VirtualCascadeType(Cascade javaCascade, boolean metadataComplete) {
- super();
- this.javaCascade = javaCascade;
- this.metadataComplete = metadataComplete;
- }
-
- public void update(Cascade javaCascade) {
- this.javaCascade = javaCascade;
- }
-
- public boolean isCascadeAll() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isAll();
- }
-
- public void setCascadeAll(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public boolean isCascadeMerge() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isMerge();
- }
-
- public void setCascadeMerge(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public boolean isCascadePersist() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isPersist();
- }
-
- public void setCascadePersist(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public boolean isCascadeRefresh() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isRefresh();
- }
-
- public void setCascadeRefresh(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public boolean isCascadeRemove() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaCascade.isRemove();
- }
-
- public void setCascadeRemove(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java
deleted file mode 100644
index f354af95fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaMultiRelationshipMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-
-public class VirtualMapKey extends AbstractJpaEObject implements MapKey
-{
- JavaMultiRelationshipMapping javaMultiRelationshipMapping;
-
- protected boolean metadataComplete;
-
- public VirtualMapKey(JavaMultiRelationshipMapping javaMultiRelationshipMapping, boolean metadataComplete) {
- super();
- this.javaMultiRelationshipMapping = javaMultiRelationshipMapping;
- this.metadataComplete = metadataComplete;
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaMultiRelationshipMapping.getMapKey();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaMultiRelationshipMapping javaMultiRelationshipMapping) {
- this.javaMultiRelationshipMapping = javaMultiRelationshipMapping;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java
deleted file mode 100644
index f65d487bc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-public class VirtualXmlAttributeOverride extends AbstractJpaEObject implements XmlAttributeOverride
-{
-
- protected JavaAttributeOverride javaAttributeOverride;
-
- protected final VirtualXmlColumn column;
-
- protected boolean metadataComplete;
-
- protected VirtualXmlAttributeOverride(OrmTypeMapping ormTypeMapping, JavaAttributeOverride javaAttributeOverride, boolean metadataComplete) {
- super();
- this.javaAttributeOverride = javaAttributeOverride;
- this.metadataComplete = metadataComplete;
- this.column = new VirtualXmlColumn(ormTypeMapping, javaAttributeOverride.getColumn(), metadataComplete);
- }
-
-
- public String getName() {
- if (this.metadataComplete) {
- return null;//TODO is this right??
- }
- return this.javaAttributeOverride.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaAttributeOverride javaAttributeOverride) {
- this.javaAttributeOverride = javaAttributeOverride;
- this.column.update(javaAttributeOverride.getColumn());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java
deleted file mode 100644
index ca81f4b73d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlBasic extends AbstractJpaEObject implements XmlBasic
-{
- JavaBasicMapping javaBasicMapping;
-
- protected final VirtualXmlColumn column;
-
- protected boolean metadataComplete;
-
- public VirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping, boolean metadataComplete) {
- super();
- this.javaBasicMapping = javaBasicMapping;
- this.metadataComplete = metadataComplete;
- this.column = new VirtualXmlColumn(ormTypeMapping, javaBasicMapping.getColumn(), metadataComplete);
- }
-
- public String getName() {
- return this.javaBasicMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public FetchType getFetch() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaBasicMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaBasicMapping.getFetch());
- }
-
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getOptional() {
- if (this.metadataComplete) {
- return this.javaBasicMapping.getDefaultOptional();
- }
- return this.javaBasicMapping.getOptional();
- }
-
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public boolean isLob() {
- if (this.metadataComplete) {
- return false;
- }
- return this.javaBasicMapping.isLob();
- }
-
- public void setLob(boolean newLob) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public TemporalType getTemporal() {
- if (this.metadataComplete) {
- return null;
- }
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(this.javaBasicMapping.getTemporal());
- }
-
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EnumType getEnumerated() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.EnumType.toOrmResourceModel(this.javaBasicMapping.getDefaultEnumerated());
- }
- return org.eclipse.jpt.core.context.EnumType.toOrmResourceModel(this.javaBasicMapping.getEnumerated());
- }
-
- public void setEnumerated(EnumType newEnumerated) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public void update(JavaBasicMapping javaBasicMapping) {
- this.javaBasicMapping = javaBasicMapping;
- this.column.update(javaBasicMapping.getColumn());
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java
deleted file mode 100644
index a97dbe47c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-/**
- * A virtual column is used to represent the XmlColumn resource object
- * within a virtual mapping. A virtual mapping is one which is not specified
- * in the orm.xml file, but is implied from the underlying java. Virtual column
- * is not used when the mapping is specified in the orm.xml, but the column tag does not exist.
- *
- * A virtual column delegates to the underlying java column for its state. The metadataComplete
- * flag determines whether it will get specified or default information from the java column
- *
- */
-public class VirtualXmlColumn extends AbstractJpaEObject implements XmlColumn
-{
-
- protected JavaColumn javaColumn;
-
- protected boolean metadataComplete;
-
- protected OrmTypeMapping ormTypeMapping;
-
-
- protected VirtualXmlColumn(OrmTypeMapping ormTypeMapping, JavaColumn javaColumn, boolean metadataComplete) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaColumn = javaColumn;
- this.metadataComplete = metadataComplete;
- }
-
- public String getColumnDefinition() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaColumn.getColumnDefinition();
- }
-
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getInsertable() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultInsertable();
- }
- return this.javaColumn.getInsertable();
- }
-
- public void setInsertable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getLength() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultLength();
- }
- return this.javaColumn.getLength();
- }
-
- public void setLength(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultName();
- }
- return this.javaColumn.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getNullable() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultNullable();
- }
- return this.javaColumn.getNullable();
- }
-
- public void setNullable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getPrecision() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultPrecision();
- }
- return this.javaColumn.getPrecision();
- }
-
- public void setPrecision(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getScale() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultScale();
- }
- return this.javaColumn.getScale();
- }
-
- public void setScale(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTable() {
- if (!this.metadataComplete) {
- if (this.javaColumn.getSpecifiedTable() != null) {
- return this.javaColumn.getSpecifiedTable();
- }
- }
- return this.ormTypeMapping.tableName();
- }
-
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getUnique() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultUnique();
- }
- return this.javaColumn.getUnique();
- }
-
- public void setUnique(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getUpdatable() {
- if (this.metadataComplete) {
- return this.javaColumn.getDefaultUpdatable();
- }
- return this.javaColumn.getUpdatable();
- }
-
- public void setUpdatable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaColumn javaColumn) {
- this.javaColumn = javaColumn;
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
- public TextRange tableTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java
deleted file mode 100644
index b7a24ce983..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-
-/**
- * VirtualEmbedded is an implementation of Embedded used when there is
- * no tag in the orm.xml and an underlying javaEmbeddedMapping exists.
- */
-public class VirtualXmlEmbedded extends AbstractJpaEObject implements XmlEmbedded
-{
- JavaEmbeddedMapping javaEmbeddedMapping;
-
- protected boolean metadataComplete;
-
- protected EList<XmlAttributeOverride> virtualAttributeOverrides;
-
- protected OrmTypeMapping ormTypeMapping;
-
- public VirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping, boolean metadataComplete) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaEmbeddedMapping = javaEmbeddedMapping;
- this.metadataComplete = metadataComplete;
- this.initializeAttributeOverrides(javaEmbeddedMapping);
- }
-
- protected void initializeAttributeOverrides(JavaEmbeddedMapping javaEmbeddedMapping) {
- this.virtualAttributeOverrides = new BasicEList<XmlAttributeOverride>();
- ListIterator<JavaAttributeOverride> javaAttributesOverrides;
- if (this.metadataComplete) {
- javaAttributesOverrides = this.javaEmbeddedMapping.defaultAttributeOverrides();
- }
- else {
- javaAttributesOverrides = this.javaEmbeddedMapping.attributeOverrides();
- }
-
- while (javaAttributesOverrides.hasNext()) {
- this.virtualAttributeOverrides.add(new VirtualXmlAttributeOverride(ormTypeMapping, javaAttributesOverrides.next(), this.metadataComplete));
- }
- }
-
- public String getName() {
- return this.javaEmbeddedMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualAttributeOverrides;
- }
-
- public void update(JavaEmbeddedMapping javaEmbeddedMapping) {
- this.javaEmbeddedMapping = javaEmbeddedMapping;
- this.updateAttributeOverrides(javaEmbeddedMapping);
- }
-
- protected void updateAttributeOverrides(JavaEmbeddedMapping javaEmbeddedMapping) {
- ListIterator<JavaAttributeOverride> javaAttributesOverrides;
- ListIterator<XmlAttributeOverride> virtualAttributeOverrides = this.virtualAttributeOverrides.listIterator();
- if (this.metadataComplete) {
- javaAttributesOverrides = this.javaEmbeddedMapping.defaultAttributeOverrides();
- }
- else {
- javaAttributesOverrides = this.javaEmbeddedMapping.attributeOverrides();
- }
-
- while (javaAttributesOverrides.hasNext()) {
- JavaAttributeOverride javaAttributeOverride = javaAttributesOverrides.next();
- if (virtualAttributeOverrides.hasNext()) {
- VirtualXmlAttributeOverride virtualAttributeOverride = (VirtualXmlAttributeOverride) virtualAttributeOverrides.next();
- virtualAttributeOverride.update(javaAttributeOverride);
- }
- else {
- this.virtualAttributeOverrides.add(new VirtualXmlAttributeOverride(ormTypeMapping, javaAttributeOverride, this.metadataComplete));
- }
- }
-
- while(virtualAttributeOverrides.hasNext()) {
- this.virtualAttributeOverrides.remove(virtualAttributeOverrides.next());
- }
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java
deleted file mode 100644
index dd42618695..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-
-/**
- * VirtualEmbeddedId is an implementation of EmbeddedId used when there is
- * no tag in the orm.xml and an underlying javaEmbeddedIdMapping exists.
- */
-public class VirtualXmlEmbeddedId extends AbstractJpaEObject implements XmlEmbeddedId
-{
- JavaEmbeddedIdMapping javaEmbeddedIdMapping;
-
- protected boolean metadataComplete;
-
- protected EList<XmlAttributeOverride> virtualAttributeOverrides;
-
- protected OrmTypeMapping ormTypeMapping;
-
- public VirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping, boolean metadataComplete) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaEmbeddedIdMapping = javaEmbeddedIdMapping;
- this.metadataComplete = metadataComplete;
- this.initializeAttributeOverrides(javaEmbeddedIdMapping);
- }
-
- protected void initializeAttributeOverrides(JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- this.virtualAttributeOverrides = new BasicEList<XmlAttributeOverride>();
- ListIterator<JavaAttributeOverride> javaAttributesOverrides;
- if (this.metadataComplete) {
- javaAttributesOverrides = this.javaEmbeddedIdMapping.defaultAttributeOverrides();
- }
- else {
- javaAttributesOverrides = this.javaEmbeddedIdMapping.attributeOverrides();
- }
-
- while (javaAttributesOverrides.hasNext()) {
- this.virtualAttributeOverrides.add(new VirtualXmlAttributeOverride(ormTypeMapping, javaAttributesOverrides.next(), this.metadataComplete));
- }
- }
-
- public String getName() {
- return this.javaEmbeddedIdMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualAttributeOverrides;
- }
-
- public void update(JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- this.javaEmbeddedIdMapping = javaEmbeddedIdMapping;
- this.updateAttributeOverrides(javaEmbeddedIdMapping);
- }
-
- protected void updateAttributeOverrides(JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- ListIterator<JavaAttributeOverride> javaAttributesOverrides;
- ListIterator<XmlAttributeOverride> virtualAttributeOverrides = this.virtualAttributeOverrides.listIterator();
- if (this.metadataComplete) {
- javaAttributesOverrides = this.javaEmbeddedIdMapping.defaultAttributeOverrides();
- }
- else {
- javaAttributesOverrides = this.javaEmbeddedIdMapping.attributeOverrides();
- }
-
- while (javaAttributesOverrides.hasNext()) {
- JavaAttributeOverride javaAttributeOverride = javaAttributesOverrides.next();
- if (virtualAttributeOverrides.hasNext()) {
- VirtualXmlAttributeOverride virtualAttributeOverride = (VirtualXmlAttributeOverride) virtualAttributeOverrides.next();
- virtualAttributeOverride.update(javaAttributeOverride);
- }
- else {
- this.virtualAttributeOverrides.add(new VirtualXmlAttributeOverride(ormTypeMapping, javaAttributeOverride, this.metadataComplete));
- }
- }
-
- while(virtualAttributeOverrides.hasNext()) {
- this.virtualAttributeOverrides.remove(virtualAttributeOverrides.next());
- }
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java
deleted file mode 100644
index df2fd65e5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.GenerationType;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-
-public class VirtualXmlGeneratedValue extends AbstractJpaEObject implements XmlGeneratedValue
-{
- JavaGeneratedValue javaGeneratedValue;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlGeneratedValue(JavaGeneratedValue javaGeneratedValue, boolean metadataComplete) {
- super();
- this.javaGeneratedValue = javaGeneratedValue;
- this.metadataComplete = metadataComplete;
- }
-
-
- public String getGenerator() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaGeneratedValue.getGenerator();
- }
-
- public GenerationType getStrategy() {
- if (this.metadataComplete) {
- return null;
- }
- return org.eclipse.jpt.core.context.GenerationType.toOrmResourceModel(this.javaGeneratedValue.getStrategy());
- }
-
- public void setGenerator(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void setStrategy(GenerationType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
-
- public void update(JavaGeneratedValue javaGeneratedValue) {
- this.javaGeneratedValue = javaGeneratedValue;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java
deleted file mode 100644
index 05b45833bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-
-/**
- * VirtualId is an implementation of Id used when there is
- * no tag in the orm.xml and an underlying javaIdMapping exists.
- */
-public class VirtualXmlId extends AbstractJpaEObject implements XmlId
-{
- JavaIdMapping javaIdMapping;
-
- protected boolean metadataComplete;
-
- protected final VirtualXmlColumn column;
-
- protected final VirtualXmlGeneratedValue virtualGeneratedValue;
-
- protected final VirtualXmlTableGenerator virtualTableGenerator;
-
- protected final VirtualXmlSequenceGenerator virtualSequenceGenerator;
-
-
-
- public VirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping, boolean metadataComplete) {
- super();
- this.javaIdMapping = javaIdMapping;
- this.metadataComplete = metadataComplete;
- this.column = new VirtualXmlColumn(ormTypeMapping, javaIdMapping.getColumn(), metadataComplete);
- this.virtualGeneratedValue = new VirtualXmlGeneratedValue(javaIdMapping.getGeneratedValue(), metadataComplete);
- this.virtualTableGenerator = new VirtualXmlTableGenerator(javaIdMapping.getTableGenerator(), metadataComplete);
- this.virtualSequenceGenerator = new VirtualXmlSequenceGenerator(javaIdMapping.getSequenceGenerator(), metadataComplete);
- }
-
- public String getName() {
- return this.javaIdMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public TemporalType getTemporal() {
- if (this.metadataComplete) {
- return null;
- }
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(this.javaIdMapping.getTemporal());
- }
-
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public XmlGeneratedValue getGeneratedValue() {
- if (this.metadataComplete) {
- return null;
- }
- if (this.javaIdMapping.getGeneratedValue() != null) {
- return this.virtualGeneratedValue;
- }
- return null;
- }
-
- public void setGeneratedValue(XmlGeneratedValue value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlSequenceGenerator getSequenceGenerator() {
- if (this.metadataComplete) {
- return null;
- }
- if (this.javaIdMapping.getSequenceGenerator() != null) {
- return this.virtualSequenceGenerator;
- }
- return null;
- }
-
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlTableGenerator getTableGenerator() {
- if (this.metadataComplete) {
- return null;
- }
- if (this.javaIdMapping.getTableGenerator() != null) {
- return this.virtualTableGenerator;
- }
- return null;
- }
-
- public void setTableGenerator(XmlTableGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public void update(JavaIdMapping javaIdMapping) {
- this.javaIdMapping = javaIdMapping;
- this.column.update(javaIdMapping.getColumn());
- this.virtualGeneratedValue.update(javaIdMapping.getGeneratedValue());
- this.virtualTableGenerator.update(javaIdMapping.getTableGenerator());
- this.virtualSequenceGenerator.update(javaIdMapping.getSequenceGenerator());
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java
deleted file mode 100644
index 8d35384bcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-
-public class VirtualXmlJoinColumn extends AbstractJpaEObject implements XmlJoinColumn
-{
- protected JavaJoinColumn javaJoinColumn;
-
- protected boolean metadataComplete;
-
- protected VirtualXmlJoinColumn(JavaJoinColumn javaJoinColumn, boolean metadataComplete) {
- super();
- this.javaJoinColumn = javaJoinColumn;
- this.metadataComplete = metadataComplete;
- }
-
- public String getColumnDefinition() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaJoinColumn.getColumnDefinition();
- }
-
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getInsertable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultInsertable();
- }
- return this.javaJoinColumn.getInsertable();
- }
-
- public void setInsertable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultName();
- }
- return this.javaJoinColumn.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getReferencedColumnName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultReferencedColumnName();
- }
- return this.javaJoinColumn.getReferencedColumnName();
- }
-
- public void setReferencedColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getNullable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultNullable();
- }
- return this.javaJoinColumn.getNullable();
- }
-
- public void setNullable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultTable();
- }
- return this.javaJoinColumn.getTable();
- }
-
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getUnique() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultUnique();
- }
- return this.javaJoinColumn.getUnique();
- }
-
- public void setUnique(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getUpdatable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultUpdatable();
- }
- return this.javaJoinColumn.getUpdatable();
- }
-
- public void setUpdatable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaJoinColumn javaJoinColumn) {
- this.javaJoinColumn = javaJoinColumn;
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
- public TextRange tableTextRange() {
- return null;
- }
-
- public TextRange referencedColumnNameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java
deleted file mode 100644
index 2eb9c92c44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.UniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-
-public class VirtualXmlJoinTable extends AbstractJpaEObject implements XmlJoinTable
-{
-
- protected JavaJoinTable javaJoinTable;
-
- protected boolean metadataComplete;
-
- protected VirtualXmlJoinTable(JavaJoinTable javaJoinTable, boolean metadataComplete) {
- super();
- this.javaJoinTable = javaJoinTable;
- this.metadataComplete = metadataComplete;
- }
-
- public EList<XmlJoinColumn> getInverseJoinColumns() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getCatalog() {
- if (this.metadataComplete) {
- return this.javaJoinTable.getDefaultCatalog();
- }
- return this.javaJoinTable.getCatalog();
- }
-
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return this.javaJoinTable.getDefaultName();
- }
- return this.javaJoinTable.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getSchema() {
- if (this.metadataComplete) {
- return this.javaJoinTable.getDefaultSchema();
- }
- return this.javaJoinTable.getSchema();
- }
-
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<UniqueConstraint> getUniqueConstraints() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void update(JavaJoinTable javaJoinTable) {
- this.javaJoinTable = javaJoinTable;
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
- public TextRange catalogTextRange() {
- return null;
- }
-
- public TextRange schemaTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
deleted file mode 100644
index 07e0e69a71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-/**
- * VirtualManyToMany is an implementation of ManyToMany used when there is
- * no tag in the orm.xml and an underlying javaManyToManyMapping exists.
- */
-public class VirtualXmlManyToMany extends AbstractJpaEObject implements XmlManyToMany
-{
- JavaManyToManyMapping javaManyToManyMapping;
-
- protected boolean metadataComplete;
-
- protected final VirtualXmlJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
- //TODO joinColumns not yet supported in the context model
-// protected EList<JoinColumn> virtualJoinColumns;
-
- public VirtualXmlManyToMany(JavaManyToManyMapping javaManyToManyMapping, boolean metadataComplete) {
- super();
- this.javaManyToManyMapping = javaManyToManyMapping;
- this.metadataComplete = metadataComplete;
-// this.initializeJoinColumns(javaOneToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToManyMapping.getCascade(), this.metadataComplete);
- this.virtualJoinTable = new VirtualXmlJoinTable(javaManyToManyMapping.getJoinTable(), metadataComplete);
- this.mapKey = new VirtualMapKey(javaManyToManyMapping, metadataComplete);
- }
-
-// protected void initializeJoinColumns(IJavaOneToManyMapping javaOneToManyMapping) {
-// this.virtualJoinColumns = new BasicEList<JoinColumn>();
-// ListIterator<IJavaJoinColumn> javaJoinColumns;
-// if (this.metadataComplete) {
-// javaJoinColumns = this.javaOneToManyMapping.defaultJoinColumns();
-// }
-// else {
-// javaJoinColumns = this.javaOneToManyMapping.joinColumns();
-// }
-//
-// while (javaJoinColumns.hasNext()) {
-// this.virtualJoinColumns.add(new VirtualJoinColumn(javaJoinColumns.next(), this.metadataComplete));
-// }
-// }
-
- public String getName() {
- return this.javaManyToManyMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public FetchType getFetch() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaManyToManyMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaManyToManyMapping.getFetch());
- }
-
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return null;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTargetEntity() {
- if (this.metadataComplete) {
- return this.javaManyToManyMapping.getDefaultTargetEntity();
- }
- return this.javaManyToManyMapping.getTargetEntity();
- }
-
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getMappedBy() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaManyToManyMapping.getMappedBy();
- }
-
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public MapKey getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getOrderBy() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaManyToManyMapping.getOrderBy();
- }
-
- public void setOrderBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaManyToManyMapping javaManyToManyMapping) {
- this.javaManyToManyMapping = javaManyToManyMapping;
- this.virtualCascadeType.update(javaManyToManyMapping.getCascade());
- this.virtualJoinTable.update(javaManyToManyMapping.getJoinTable());
-// this.updateJoinColumns(javaOneToManyMapping);
- }
-
-// protected void updateJoinColumns(IJavaOneToManyMapping javaOneToManyMapping) {
-// ListIterator<IJavaJoinColumn> javaJoinColumns;
-// ListIterator<JoinColumn> virtualJoinColumns = this.virtualJoinColumns.listIterator();
-// if (this.metadataComplete) {
-// javaJoinColumns = this.javaOneToManyMapping.defaultJoinColumns();
-// }
-// else {
-// javaJoinColumns = this.javaOneToManyMapping.joinColumns();
-// }
-//
-// while (javaJoinColumns.hasNext()) {
-// IJavaJoinColumn javaJoinColumn = javaJoinColumns.next();
-// if (virtualJoinColumns.hasNext()) {
-// VirtualJoinColumn virtualJoinColumn = (VirtualJoinColumn) virtualJoinColumns.next();
-// virtualJoinColumn.update(javaJoinColumn);
-// }
-// else {
-// this.virtualJoinColumns.add(new VirtualJoinColumn(javaJoinColumn, this.metadataComplete));
-// }
-// }
-//
-// while(virtualJoinColumns.hasNext()) {
-// this.virtualJoinColumns.remove(virtualJoinColumns.next());
-// }
-// }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java
deleted file mode 100644
index 0a8cdf611e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-/**
- * VirtualManyToOne is an implementation of ManyToOne used when there is
- * no tag in the orm.xml and an underlying javaManyToOneMapping exists.
- */
-public class VirtualXmlManyToOne extends AbstractJpaEObject implements XmlManyToOne
-{
- JavaManyToOneMapping javaManyToOneMapping;
-
- protected boolean metadataComplete;
-
-// protected VirtualJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected EList<XmlJoinColumn> virtualJoinColumns;
-
- public VirtualXmlManyToOne(JavaManyToOneMapping javaManyToOneMapping, boolean metadataComplete) {
- super();
- this.javaManyToOneMapping = javaManyToOneMapping;
- this.metadataComplete = metadataComplete;
- this.initializeJoinColumns(javaManyToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToOneMapping.getCascade(), this.metadataComplete);
- }
-
- protected void initializeJoinColumns(JavaManyToOneMapping javaManyToOneMapping) {
- this.virtualJoinColumns = new BasicEList<XmlJoinColumn>();
- ListIterator<JavaJoinColumn> javaJoinColumns;
- if (this.metadataComplete) {
- //TODO still need a default join column in xml
- if (javaManyToOneMapping.getDefaultJoinColumn() == null) {
- javaJoinColumns = EmptyListIterator.instance();
- }
- else {
- javaJoinColumns = new SingleElementListIterator<JavaJoinColumn>(javaManyToOneMapping.getDefaultJoinColumn());
- }
- }
- else {
- javaJoinColumns = this.javaManyToOneMapping.joinColumns();
- }
-
- while (javaJoinColumns.hasNext()) {
- this.virtualJoinColumns.add(new VirtualXmlJoinColumn(javaJoinColumns.next(), this.metadataComplete));
- }
- }
-
- public String getName() {
- return this.javaManyToOneMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public FetchType getFetch() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaManyToOneMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaManyToOneMapping.getFetch());
- }
-
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getOptional() {
- if (this.metadataComplete) {
- return this.javaManyToOneMapping.getDefaultOptional();
- }
- return this.javaManyToOneMapping.getOptional();
- }
-
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualJoinColumns;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTargetEntity() {
- if (this.metadataComplete) {
- return this.javaManyToOneMapping.getDefaultTargetEntity();
- }
- return this.javaManyToOneMapping.getTargetEntity();
- }
-
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaManyToOneMapping javaManyToOneMapping) {
- this.javaManyToOneMapping = javaManyToOneMapping;
- this.virtualCascadeType.update(javaManyToOneMapping.getCascade());
- this.updateJoinColumns(javaManyToOneMapping);
- }
-
- protected void updateJoinColumns(JavaManyToOneMapping javaManyToOneMapping) {
- ListIterator<JavaJoinColumn> javaJoinColumns;
- ListIterator<XmlJoinColumn> virtualJoinColumns = this.virtualJoinColumns.listIterator();
- if (this.metadataComplete) {
- //TODO still need a default join column in xml
- if (javaManyToOneMapping.getDefaultJoinColumn() == null) {
- javaJoinColumns = EmptyListIterator.instance();
- }
- else {
- javaJoinColumns = new SingleElementListIterator<JavaJoinColumn>(javaManyToOneMapping.getDefaultJoinColumn());
- }
- }
- else {
- javaJoinColumns = this.javaManyToOneMapping.joinColumns();
- }
-
- while (javaJoinColumns.hasNext()) {
- JavaJoinColumn javaJoinColumn = javaJoinColumns.next();
- if (virtualJoinColumns.hasNext()) {
- VirtualXmlJoinColumn virtualJoinColumn = (VirtualXmlJoinColumn) virtualJoinColumns.next();
- virtualJoinColumn.update(javaJoinColumn);
- }
- else {
- this.virtualJoinColumns.add(new VirtualXmlJoinColumn(javaJoinColumn, this.metadataComplete));
- }
- }
-
- while(virtualJoinColumns.hasNext()) {
- this.virtualJoinColumns.remove(virtualJoinColumns.next());
- }
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
deleted file mode 100644
index 0dbcac20c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-/**
- * VirtualOneToMany is an implementation of OneToMany used when there is
- * no tag in the orm.xml and an underlying javaOneToManyMapping exists.
- */
-public class VirtualXmlOneToMany extends AbstractJpaEObject implements XmlOneToMany
-{
- JavaOneToManyMapping javaOneToManyMapping;
-
- protected boolean metadataComplete;
-
- protected final VirtualXmlJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
- //TODO joinColumns not yet supported in the context model
-// protected EList<JoinColumn> virtualJoinColumns;
-
- public VirtualXmlOneToMany(JavaOneToManyMapping javaOneToManyMapping, boolean metadataComplete) {
- super();
- this.javaOneToManyMapping = javaOneToManyMapping;
- this.metadataComplete = metadataComplete;
-// this.initializeJoinColumns(javaOneToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToManyMapping.getCascade(), this.metadataComplete);
- this.virtualJoinTable = new VirtualXmlJoinTable(javaOneToManyMapping.getJoinTable(), metadataComplete);
- this.mapKey = new VirtualMapKey(javaOneToManyMapping, metadataComplete);
- }
-
-// protected void initializeJoinColumns(IJavaOneToManyMapping javaOneToManyMapping) {
-// this.virtualJoinColumns = new BasicEList<JoinColumn>();
-// ListIterator<IJavaJoinColumn> javaJoinColumns;
-// if (this.metadataComplete) {
-// javaJoinColumns = this.javaOneToManyMapping.defaultJoinColumns();
-// }
-// else {
-// javaJoinColumns = this.javaOneToManyMapping.joinColumns();
-// }
-//
-// while (javaJoinColumns.hasNext()) {
-// this.virtualJoinColumns.add(new VirtualJoinColumn(javaJoinColumns.next(), this.metadataComplete));
-// }
-// }
-
- public String getName() {
- return this.javaOneToManyMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public FetchType getFetch() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaOneToManyMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaOneToManyMapping.getFetch());
- }
-
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return null;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTargetEntity() {
- if (this.metadataComplete) {
- return this.javaOneToManyMapping.getDefaultTargetEntity();
- }
- return this.javaOneToManyMapping.getTargetEntity();
- }
-
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getMappedBy() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaOneToManyMapping.getMappedBy();
- }
-
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
- public MapKey getMapKey() {
- return this.mapKey;
- }
-
- public void setMapKey(MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getOrderBy() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaOneToManyMapping.getOrderBy();
- }
-
- public void setOrderBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaOneToManyMapping javaOneToManyMapping) {
- this.javaOneToManyMapping = javaOneToManyMapping;
- this.virtualCascadeType.update(javaOneToManyMapping.getCascade());
- this.virtualJoinTable.update(javaOneToManyMapping.getJoinTable());
-// this.updateJoinColumns(javaOneToManyMapping);
- }
-
-// protected void updateJoinColumns(IJavaOneToManyMapping javaOneToManyMapping) {
-// ListIterator<IJavaJoinColumn> javaJoinColumns;
-// ListIterator<JoinColumn> virtualJoinColumns = this.virtualJoinColumns.listIterator();
-// if (this.metadataComplete) {
-// javaJoinColumns = this.javaOneToManyMapping.defaultJoinColumns();
-// }
-// else {
-// javaJoinColumns = this.javaOneToManyMapping.joinColumns();
-// }
-//
-// while (javaJoinColumns.hasNext()) {
-// IJavaJoinColumn javaJoinColumn = javaJoinColumns.next();
-// if (virtualJoinColumns.hasNext()) {
-// VirtualJoinColumn virtualJoinColumn = (VirtualJoinColumn) virtualJoinColumns.next();
-// virtualJoinColumn.update(javaJoinColumn);
-// }
-// else {
-// this.virtualJoinColumns.add(new VirtualJoinColumn(javaJoinColumn, this.metadataComplete));
-// }
-// }
-//
-// while(virtualJoinColumns.hasNext()) {
-// this.virtualJoinColumns.remove(virtualJoinColumns.next());
-// }
-// }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java
deleted file mode 100644
index 816f0eb66f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-/**
- * VirtualOneToOne is an implementation of OneToOne used when there is
- * no tag in the orm.xml and an underlying javaOneToOneMapping exists.
- */
-public class VirtualXmlOneToOne extends AbstractJpaEObject implements XmlOneToOne
-{
- JavaOneToOneMapping javaOneToOneMapping;
-
- protected boolean metadataComplete;
-
-// protected VirtualJoinTable virtualJoinTable;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected EList<XmlJoinColumn> virtualJoinColumns;
-
-// protected EList<PrimaryKeyJoinColumn> virtualPrimaryKeyJoinColumns;
-
- public VirtualXmlOneToOne(JavaOneToOneMapping javaOneToOneMapping, boolean metadataComplete) {
- super();
- this.javaOneToOneMapping = javaOneToOneMapping;
- this.metadataComplete = metadataComplete;
- this.initializeJoinColumns(javaOneToOneMapping);
-// this.initializePrimaryKeyJoinColumns(javaOneToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToOneMapping.getCascade(), this.metadataComplete);
- }
-
- protected void initializeJoinColumns(JavaOneToOneMapping javaOneToOneMapping) {
- this.virtualJoinColumns = new BasicEList<XmlJoinColumn>();
- ListIterator<JavaJoinColumn> javaJoinColumns;
- if (this.metadataComplete) {
- //TODO still need a default join column in xml
- if (javaOneToOneMapping.getDefaultJoinColumn() == null) {
- javaJoinColumns = EmptyListIterator.instance();
- }
- else {
- javaJoinColumns = new SingleElementListIterator<JavaJoinColumn>(javaOneToOneMapping.getDefaultJoinColumn());
- }
- }
- else {
- javaJoinColumns = this.javaOneToOneMapping.joinColumns();
- }
-
- while (javaJoinColumns.hasNext()) {
- this.virtualJoinColumns.add(new VirtualXmlJoinColumn(javaJoinColumns.next(), this.metadataComplete));
- }
- }
-
-// protected void initializePrimaryKeyJoinColumns(IJavaOneToOneMapping javaOneToOneMapping) {
-// this.virtualPrimaryKeyJoinColumns = new BasicEList<PrimaryKeyJoinColumn>();
-// ListIterator<IJavaPrimaryKeyJoinColumn> javaJoinColumns;
-// if (this.metadataComplete) {
-// javaJoinColumns = this.javaOneToOneMapping.defaultJoinColumns();
-// }
-// else {
-// javaJoinColumns = this.javaOneToOneMapping.joinColumns();
-// }
-//
-// while (javaJoinColumns.hasNext()) {
-// this.virtualJoinColumns.add(new VirtualJoinColumn(javaJoinColumns.next(), this.metadataComplete));
-// }
-// }
-
- public String getName() {
- return this.javaOneToOneMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public FetchType getFetch() {
- if (this.metadataComplete) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaOneToOneMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaOneToOneMapping.getFetch());
- }
-
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Boolean getOptional() {
- if (this.metadataComplete) {
- return this.javaOneToOneMapping.getDefaultOptional();
- }
- return this.javaOneToOneMapping.getOptional();
- }
-
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualJoinColumns;
- }
-
- public CascadeType getCascade() {
- return this.virtualCascadeType;
- }
-
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlJoinTable getJoinTable() {
- //TODO we don't yet support JoinTable in the context model for many-to-one mappings
- return null;//this.virtualJoinTable;
- }
-
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTargetEntity() {
- if (this.metadataComplete) {
- return this.javaOneToOneMapping.getDefaultTargetEntity();
- }
- return this.javaOneToOneMapping.getTargetEntity();
- }
-
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getMappedBy() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaOneToOneMapping.getMappedBy();
- }
-
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- // TODO we don't yet support primary key join columns in the context model
- return null;
- }
-
- public void update(JavaOneToOneMapping javaOneToOneMapping) {
- this.javaOneToOneMapping = javaOneToOneMapping;
- this.virtualCascadeType.update(javaOneToOneMapping.getCascade());
- this.updateJoinColumns(javaOneToOneMapping);
- }
-
- protected void updateJoinColumns(JavaOneToOneMapping javaOneToOneMapping) {
- ListIterator<JavaJoinColumn> javaJoinColumns;
- ListIterator<XmlJoinColumn> virtualJoinColumns = this.virtualJoinColumns.listIterator();
- if (this.metadataComplete) {
- //TODO still need a default join column in xml
- if (javaOneToOneMapping.getDefaultJoinColumn() == null) {
- javaJoinColumns = EmptyListIterator.instance();
- }
- else {
- javaJoinColumns = new SingleElementListIterator<JavaJoinColumn>(javaOneToOneMapping.getDefaultJoinColumn());
- }
- }
- else {
- javaJoinColumns = this.javaOneToOneMapping.joinColumns();
- }
-
- while (javaJoinColumns.hasNext()) {
- JavaJoinColumn javaJoinColumn = javaJoinColumns.next();
- if (virtualJoinColumns.hasNext()) {
- VirtualXmlJoinColumn virtualJoinColumn = (VirtualXmlJoinColumn) virtualJoinColumns.next();
- virtualJoinColumn.update(javaJoinColumn);
- }
- else {
- this.virtualJoinColumns.add(new VirtualXmlJoinColumn(javaJoinColumn, this.metadataComplete));
- }
- }
-
- while(virtualJoinColumns.hasNext()) {
- this.virtualJoinColumns.remove(virtualJoinColumns.next());
- }
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java
deleted file mode 100644
index 5783fa462b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.UniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-
-public class VirtualXmlSecondaryTable extends AbstractJpaEObject implements XmlSecondaryTable
-{
-
- protected JavaSecondaryTable javaSecondaryTable;
-
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- protected EList<UniqueConstraint> uniqueConstraints;
-
- protected VirtualXmlSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- super();
- this.javaSecondaryTable = javaSecondaryTable;
- }
-
- public String getName() {
- return this.javaSecondaryTable.getSpecifiedName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getCatalog() {
- return this.javaSecondaryTable.getSpecifiedCatalog();
- }
-
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getSchema() {
- return this.javaSecondaryTable.getSpecifiedSchema();
- }
-
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- public EList<UniqueConstraint> getUniqueConstraints() {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<UniqueConstraint>(UniqueConstraint.class, this, OrmPackage.XML_SECONDARY_TABLE_IMPL__UNIQUE_CONSTRAINTS);
- }
- return uniqueConstraints;
- }
-
- public TextRange nameTextRange() {
- return null;
- }
-
- public TextRange catalogTextRange() {
- return null;
- }
-
- public TextRange schemaTextRange() {
- return null;
- }
-
- public void update(JavaSecondaryTable javaSecondaryTable) {
- this.javaSecondaryTable = javaSecondaryTable;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java
deleted file mode 100644
index b89f636eba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-public class VirtualXmlSequenceGenerator extends AbstractJpaEObject implements XmlSequenceGenerator
-{
- JavaSequenceGenerator javaSequenceGenerator;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlSequenceGenerator(JavaSequenceGenerator javaSequenceGenerator, boolean metadataComplete) {
- super();
- this.javaSequenceGenerator = javaSequenceGenerator;
- this.metadataComplete = metadataComplete;
- }
-
- public String getSequenceName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaSequenceGenerator.getSequenceName();
- }
-
- public void setSequenceName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaSequenceGenerator.getAllocationSize();
- }
-
- public void setAllocationSize(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaSequenceGenerator.getInitialValue();
- }
-
- public void setInitialValue(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaSequenceGenerator.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaSequenceGenerator javaSequenceGenerator) {
- this.javaSequenceGenerator = javaSequenceGenerator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java
deleted file mode 100644
index fa7b085289..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.UniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-
-public class VirtualXmlTableGenerator extends AbstractJpaEObject implements XmlTableGenerator
-{
- JavaTableGenerator javaTableGenerator;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlTableGenerator(JavaTableGenerator javaTableGenerator, boolean metadataComplete) {
- super();
- this.javaTableGenerator = javaTableGenerator;
- this.metadataComplete = metadataComplete;
- }
-
- public String getCatalog() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getCatalog();
- }
-
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getPkColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getPkColumnName();
- }
-
- public void setPkColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getPkColumnValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getPkColumnValue();
- }
-
- public void setPkColumnValue(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getSchema() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getSchema();
- }
-
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getTable() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getTable();
- }
-
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getValueColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getValueColumnName();
- }
-
- public void setValueColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getAllocationSize();
- }
-
- public void setAllocationSize(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getInitialValue();
- }
-
- public void setInitialValue(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaTableGenerator.getName();
- }
-
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
-
-
- public EList<UniqueConstraint> getUniqueConstraints() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void update(JavaTableGenerator javaTableGenerator) {
- this.javaTableGenerator = javaTableGenerator;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java
deleted file mode 100644
index 5e740855a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-/**
- * VirtualTransient is an implementation of Transient used when there is
- * no tag in the orm.xml and an underlying javaTransientMapping exists.
- */
-public class VirtualXmlTransient extends AbstractJpaEObject implements XmlTransient
-{
- JavaTransientMapping javaTransientMapping;
-
- protected boolean metadataComplete;
-
- public VirtualXmlTransient(JavaTransientMapping javaTransientMapping, boolean metadataComplete) {
- super();
- this.javaTransientMapping = javaTransientMapping;
- this.metadataComplete = metadataComplete;
- }
-
- public String getName() {
- return this.javaTransientMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaTransientMapping javaTransientMapping) {
- this.javaTransientMapping = javaTransientMapping;
- }
-
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java
deleted file mode 100644
index 32ba01542d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtualXmlVersion extends AbstractJpaEObject implements XmlVersion
-{
- JavaVersionMapping javaVersionMapping;
-
- protected final VirtualXmlColumn column;
-
- protected boolean metadataComplete;
-
- public VirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping, boolean metadataComplete) {
- super();
- this.javaVersionMapping = javaVersionMapping;
- this.metadataComplete = metadataComplete;
- this.column = new VirtualXmlColumn(ormTypeMapping, javaVersionMapping.getColumn(), metadataComplete);
- }
-
- public String getName() {
- return this.javaVersionMapping.persistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public XmlColumn getColumn() {
- return this.column;
- }
-
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public TemporalType getTemporal() {
- if (this.metadataComplete) {
- return null;
- }
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(this.javaVersionMapping.getTemporal());
- }
-
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping");
- }
-
- public void update(JavaVersionMapping javaVersionMapping) {
- this.javaVersionMapping = javaVersionMapping;
- this.column.update(javaVersionMapping.getColumn());
- }
-
-
- public TextRange nameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceJpaContextNode.java
deleted file mode 100644
index 5a75ea93d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceJpaContextNode.java
+++ /dev/null
@@ -1,36 +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.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.persistence.PersistenceJpaContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractPersistenceJpaContextNode extends AbstractJpaContextNode implements PersistenceJpaContextNode
-{
- // ********** constructor **********
-
- protected AbstractPersistenceJpaContextNode(JpaNode parent) {
- super(parent);
- }
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #addToMessages(List<IMessage>)}
- * should be preceded by a "super" call to this method
- */
- public void addToMessages(List<IMessage> messages) {
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java
deleted file mode 100644
index 02ea5ff88a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericClassRef.java
+++ /dev/null
@@ -1,220 +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.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * This is the context model object which corresponds to the
- * persistence resource model object XmlJavaClassRef.
- * XmlJavaClassRef corresponds to the class tag in the persistence.xml
- */
-public class GenericClassRef extends AbstractPersistenceJpaContextNode
- implements ClassRef
-{
- //this is null for the implied classRef case
- protected XmlJavaClassRef xmlJavaClassRef;
-
- protected String className;
-
- protected JavaPersistentType javaPersistentType;
-
-
- public GenericClassRef(PersistenceUnit parent, XmlJavaClassRef classRef) {
- super(parent);
- initialize(classRef);
- }
-
- public GenericClassRef(PersistenceUnit parent, String className) {
- super(parent);
- initialize(className);
- }
-
- public String getId() {
- return PersistenceStructureNodes.CLASS_REF_ID;
- }
-
- public boolean isFor(String fullyQualifiedTypeName) {
- if (getClassName() == null) {
- return false;
- }
- return getClassName().equals(fullyQualifiedTypeName);
- }
-
- public boolean isVirtual() {
- return xmlJavaClassRef == null;
- }
-
-
- // **************** class name *********************************************
-
- public String getClassName() {
- return this.className;
- }
-
- public void setClassName(String newClassName) {
- this.xmlJavaClassRef.setJavaClass(newClassName);
- setClassName_(newClassName);
- }
-
- protected void setClassName_(String newClassName) {
- String oldClassName = this.className;
- this.className = newClassName;
- firePropertyChanged(CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
-
- // **************** java persistent type ***********************************
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType newJavaPersistentType) {
- JavaPersistentType oldJavaPersistentType = this.javaPersistentType;
- this.javaPersistentType = newJavaPersistentType;
- firePropertyChanged(ClassRef.JAVA_PERSISTENT_TYPE_PROPERTY, oldJavaPersistentType, newJavaPersistentType);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlJavaClassRef classRef) {
- this.xmlJavaClassRef = classRef;
- this.className = classRef.getJavaClass();
- initializeJavaPersistentType();
- }
-
- protected void initialize(String className) {
- this.className = className;
- initializeJavaPersistentType();
- }
-
- protected void initializeJavaPersistentType() {
- JavaResourcePersistentType persistentTypeResource = jpaProject().javaPersistentTypeResource(getClassName());
- if (persistentTypeResource != null) {
- this.javaPersistentType = buildJavaPersistentType(persistentTypeResource);
- }
- }
-
- public void update(XmlJavaClassRef classRef) {
- this.xmlJavaClassRef = classRef;
- setClassName_(classRef.getJavaClass());
- updateJavaPersistentType();
- }
-
- public void update(String className) {
- this.xmlJavaClassRef = null;
- setClassName_(className);
- updateJavaPersistentType();
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType persistentTypeResource = jpaProject().javaPersistentTypeResource(getClassName());
- if (persistentTypeResource == null) {
- setJavaPersistentType(null);
- }
- else {
- if (getJavaPersistentType() != null) {
- getJavaPersistentType().update(persistentTypeResource);
- }
- else {
- setJavaPersistentType(buildJavaPersistentType(persistentTypeResource));
- }
- }
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType resourcePersistentType) {
- return jpaFactory().buildJavaPersistentType(this, resourcePersistentType);
- }
-
-
- // *************************************************************************
-
- // ************************* validation *********************************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addUnspecifiedClassMessage(messages);
- addUnresolvedClassMessage(messages);
- //classRef might have been empty
- if(getJavaPersistentType() != null){
- getJavaPersistentType().addToMessages(messages);
- }
- }
-
- protected void addUnspecifiedClassMessage(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(getClassName())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_CLASS,
- this, validationTextRange())
- );
- }
- }
-
- protected void addUnresolvedClassMessage(List<IMessage> messages) {
- if (! StringTools.stringIsEmpty(getClassName()) && getJavaPersistentType() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_CLASS,
- new String[] {getClassName()},
- this,
- this.validationTextRange())
- );
- }
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (isVirtual()) {
- return false;
- }
- return this.xmlJavaClassRef.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlJavaClassRef.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlJavaClassRef.validationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getClassName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java
deleted file mode 100644
index f2edc7d902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericMappingFileRef.java
+++ /dev/null
@@ -1,254 +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.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmArtifactEdit;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericMappingFileRef extends AbstractPersistenceJpaContextNode
- implements MappingFileRef
-{
- //this is null for the implied mappingFileRef case
- protected XmlMappingFileRef xmlMappingFileRef;
-
- protected String fileName;
-
- protected OrmXml ormXml;
-
- public GenericMappingFileRef(PersistenceUnit parent, XmlMappingFileRef mappingFileRef) {
- super(parent);
- this.initialize(mappingFileRef);
- }
-
- public String getId() {
- return PersistenceStructureNodes.MAPPING_FILE_REF_ID;
- }
-
-
- public boolean isVirtual() {
- return xmlMappingFileRef == null;
- }
-
-
- // **************** file name **********************************************
-
- public String getFileName() {
- return this.fileName;
- }
-
- public void setFileName(String newFileName) {
- this.xmlMappingFileRef.setFileName(newFileName);
- setFileName_(newFileName);
- }
-
- protected void setFileName_(String newFileName) {
- String oldFileName = this.fileName;
- this.fileName = newFileName;
- firePropertyChanged(FILE_NAME_PROPERTY, oldFileName, newFileName);
- }
-
- public OrmXml getOrmXml() {
- return this.ormXml;
- }
-
- protected void setOrmXml(OrmXml newOrmXml) {
- OrmXml oldOrmXml = this.ormXml;
- this.ormXml = newOrmXml;
- firePropertyChanged(ORM_XML_PROPERTY, oldOrmXml, newOrmXml);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlMappingFileRef mappingFileRef) {
- this.xmlMappingFileRef = mappingFileRef;
- initializeFileName();
- initializeOrmXml();
- }
-
- protected void initializeFileName() {
- if (isVirtual()) {
- fileName = JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH;
- }
- else {
- fileName = xmlMappingFileRef.getFileName();
- }
- }
-
- protected void initializeOrmXml() {
- if (fileName != null) {
- OrmArtifactEdit oae = OrmArtifactEdit.getArtifactEditForRead(jpaProject().project());
- OrmResource ormResource = oae.getResource(fileName);
-
- if (ormResource != null && ormResource.exists()) {
- ormXml = buildOrmXml(ormResource);
- }
- oae.dispose();
- }
- }
-
- public void update(XmlMappingFileRef mappingFileRef) {
- xmlMappingFileRef = mappingFileRef;
- updateFileName();
- updateOrmXml();
- }
-
- protected void updateFileName() {
- if (isVirtual()) {
- setFileName_(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
- else {
- setFileName_(xmlMappingFileRef.getFileName());
- }
- }
-
- protected void updateOrmXml() {
- if (fileName != null) {
- OrmArtifactEdit oae = OrmArtifactEdit.getArtifactEditForRead(jpaProject().project());
- OrmResource ormResource = oae.getResource(fileName);
- if (ormResource != null && ormResource.exists()) {
- if (ormXml != null) {
- ormXml.update(ormResource);
- }
- else {
- setOrmXml(buildOrmXml(ormResource));
- }
- }
- else {
- setOrmXml(null);
- }
- oae.dispose();
- }
- else {
- setOrmXml(null);
- }
- }
-
- protected OrmXml buildOrmXml(OrmResource ormResource) {
- return jpaFactory().buildOrmXml(this, ormResource);
- }
-
-
- // *************************************************************************
-
- public PersistenceUnitDefaults persistenceUnitDefaults() {
- if (getOrmXml() != null) {
- return getOrmXml().persistenceUnitDefaults();
- }
- return null;
- }
-
- public OrmPersistentType persistentTypeFor(String fullyQualifiedTypeName) {
- if (getOrmXml() != null) {
- return getOrmXml().persistentTypeFor(fullyQualifiedTypeName);
- }
- return null;
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (this.xmlMappingFileRef == null) {
- return false;
- }
- return this.xmlMappingFileRef.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.xmlMappingFileRef.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- if (isVirtual()) {
- return persistenceUnit().validationTextRange();
- }
- return this.xmlMappingFileRef.validationTextRange();
- }
-
- //**************** Validation *************************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- this.addUnspecifiedMappingFileMessage(messages);
- this.addUnresolvedMappingFileMessage(messages);
- this.addInvalidMappingFileContentMessage(messages);
- if (getOrmXml() != null) {
- getOrmXml().addToMessages(messages);
- }
- }
-
-
- protected void addUnspecifiedMappingFileMessage(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(getFileName())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE,
- this,
- validationTextRange())
- );
- }
- }
-
- protected void addUnresolvedMappingFileMessage(List<IMessage> messages) {
- if (!StringTools.stringIsEmpty(getFileName()) && getOrmXml() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE,
- new String[] {getFileName()},
- this,
- validationTextRange())
- );
- }
- }
-
- protected void addInvalidMappingFileContentMessage(List<IMessage> messages) {
- if (getOrmXml() != null
- && getOrmXml().getEntityMappings() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE,
- new String[] {getFileName()},
- this,
- validationTextRange())
- );
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getFileName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java
deleted file mode 100644
index 5e4fd17a8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistence.java
+++ /dev/null
@@ -1,218 +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.internal.context.persistence;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericPersistence extends AbstractPersistenceJpaContextNode
- implements Persistence
-{
- protected XmlPersistence xmlPersistence;
-
- // the implementation here is a single persistence unit, although the API
- // is for a list. we will want to support multiple persistence units soon.
- protected PersistenceUnit persistenceUnit;
-
- public GenericPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- super(parent);
- this.initialize(xmlPersistence);
- }
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_ID;
- }
-
-
- // **************** persistence units **************************************
-
- public ListIterator<PersistenceUnit> persistenceUnits() {
- if (persistenceUnit == null) {
- return EmptyListIterator.instance();
- }
- else {
- return new SingleElementListIterator<PersistenceUnit>(persistenceUnit);
- }
- }
-
- public int persistenceUnitsSize() {
- return (persistenceUnit == null) ? 0 : 1;
- }
-
- public PersistenceUnit addPersistenceUnit() {
- return addPersistenceUnit(persistenceUnitsSize());
- }
-
- public PersistenceUnit addPersistenceUnit(int index) {
- if (index > 0 || persistenceUnit != null) {
- throw new IllegalStateException("This implementation does not support multiple persistence units.");
- }
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- persistenceUnit = createPersistenceUnit(xmlPersistenceUnit);
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
- fireItemAdded(PERSISTENCE_UNITS_LIST, index, persistenceUnit);
- return persistenceUnit;
- }
-
- public void removePersistenceUnit(PersistenceUnit persistenceUnit) {
- removePersistenceUnit(0);
- }
-
- public void removePersistenceUnit(int index) {
- if (index > 0 ) {
- throw new IllegalArgumentException(new Integer(index).toString());
- }
- PersistenceUnit oldPersistenceUnit = persistenceUnit;
- persistenceUnit = null;
- xmlPersistence.getPersistenceUnits().remove(index);
- fireItemRemoved(PERSISTENCE_UNITS_LIST, index, oldPersistenceUnit);
- }
-
- protected void addPersistenceUnit_(PersistenceUnit newPersistenceUnit) {
- persistenceUnit = newPersistenceUnit;
- fireItemAdded(PERSISTENCE_UNITS_LIST, 0, persistenceUnit);
- }
-
- protected void removePersistenceUnit_(PersistenceUnit oldPersistenceUnit) {
- persistenceUnit = null;
- fireItemRemoved(PERSISTENCE_UNITS_LIST, 0, oldPersistenceUnit);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlPersistence xmlPersistence) {
- this.xmlPersistence = xmlPersistence;
- initializePersistenceUnits(xmlPersistence);
- }
-
- protected void initializePersistenceUnits(XmlPersistence persistence) {
- // only adding one here, until we support multiple persistence units
- if (xmlPersistence.getPersistenceUnits().size() > 0) {
- persistenceUnit = createPersistenceUnit(persistence.getPersistenceUnits().get(0));
- }
- }
-
- public void update(XmlPersistence persistence) {
- this.xmlPersistence = persistence;
- XmlPersistenceUnit xmlPersistenceUnit = null;
- if (persistence.getPersistenceUnits().size() > 0) {
- xmlPersistenceUnit = persistence.getPersistenceUnits().get(0);
- }
-
- if (persistenceUnit != null) {
- if (xmlPersistenceUnit != null) {
- persistenceUnit.update(xmlPersistenceUnit);
- }
- else {
- removePersistenceUnit_(persistenceUnit);
- }
- }
- else {
- if (xmlPersistenceUnit != null) {
- addPersistenceUnit_(createPersistenceUnit(xmlPersistenceUnit));
- }
- }
- }
-
- protected PersistenceUnit createPersistenceUnit(XmlPersistenceUnit xmlPersistenceUnit) {
- return jpaFactory().buildPersistenceUnit(this, xmlPersistenceUnit);
- }
-
-
- // *************************************************************************
-
- @Override
- public PersistenceUnit persistenceUnit() {
- throw new UnsupportedOperationException("No PersistenceUnit in this context");
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- for (PersistenceUnit persistenceUnit : CollectionTools.iterable(persistenceUnits())) {
- if (persistenceUnit.containsOffset(textOffset)) {
- return persistenceUnit.structureNode(textOffset);
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (xmlPersistence == null) {
- return false;
- }
- return xmlPersistence.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- return xmlPersistence.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- return xmlPersistence.validationTextRange();
- }
-
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- //persistence root validation
- addNoPersistenceUnitMessage(messages);
-
- // note to neil (or whomever): extraneous persistence units can be
- // accessed through the XmlPersistence resource object
- addMultiplePersistenceUnitMessage(messages);
-
-
- //persistence unit validation
- if (persistenceUnit != null) {
- persistenceUnit.addToMessages(messages);
- }
- }
-
- protected void addNoPersistenceUnitMessage(List<IMessage> messages) {
- if (persistenceUnit == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT,
- this,
- this.validationTextRange())
- );
- }
- }
-
- protected void addMultiplePersistenceUnitMessage(List<IMessage> messages) {
- if (xmlPersistence.getPersistenceUnits().size() > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS,
- this,
- this.validationTextRange())
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java
deleted file mode 100644
index b138867cc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceUnit.java
+++ /dev/null
@@ -1,1191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context.persistence;
-
-import static org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType.*;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmArtifactEdit;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType;
-import org.eclipse.jpt.core.resource.persistence.XmlProperties;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericPersistenceUnit extends AbstractPersistenceJpaContextNode
- implements PersistenceUnit
-{
- protected XmlPersistenceUnit xmlPersistenceUnit;
-
- protected String name;
-
- protected PersistenceUnitTransactionType transactionType;
-
- protected PersistenceUnitTransactionType defaultTransactionType = DEFAULT;
-
- protected String description;
-
- protected String provider;
-
- protected String jtaDataSource;
-
- protected String nonJtaDataSource;
-
- protected final List<MappingFileRef> specifiedMappingFileRefs;
-
- protected MappingFileRef impliedMappingFileRef;
-
- protected final List<ClassRef> specifiedClassRefs;
-
- protected final List<ClassRef> impliedClassRefs;
-
- protected Boolean excludeUnlistedClasses;
-
- protected boolean defaultExcludeUnlistedClasses = false;
-
- protected final List<Property> properties;
-
- protected String defaultSchema;
- protected String defaultCatalog;
- protected AccessType defaultAccess;
- protected boolean defaultCascadePersist;
-
- public GenericPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- super(parent);
- this.transactionType = PersistenceUnitTransactionType.DEFAULT;
- this.specifiedMappingFileRefs = new ArrayList<MappingFileRef>();
- this.specifiedClassRefs = new ArrayList<ClassRef>();
- this.impliedClassRefs = new ArrayList<ClassRef>();
- this.properties = new ArrayList<Property>();
- this.initialize(persistenceUnit);
- }
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_UNIT_ID;
- }
-
- @Override
- public PersistenceUnit persistenceUnit() {
- return this;
- }
-
-
- // **************** parent *************************************************
-
- @Override
- public Persistence parent() {
- return (Persistence) super.parent();
- }
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.xmlPersistenceUnit.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** transaction type ***************************************
-
- public PersistenceUnitTransactionType getTransactionType() {
- return (isTransactionTypeDefault()) ?
- getDefaultTransactionType() : this.transactionType;
- }
-
- public void setTransactionType(PersistenceUnitTransactionType newTransactionType) {
- if (newTransactionType == null) {
- throw new IllegalArgumentException("null");
- }
- PersistenceUnitTransactionType oldTransactionType = this.transactionType;
- this.transactionType = newTransactionType;
-
- if (this.transactionType == JTA) {
- this.xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.JTA);
- }
- else if (this.transactionType == RESOURCE_LOCAL) {
- this.xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
- else if (this.transactionType == DEFAULT) {
- this.xmlPersistenceUnit.unsetTransactionType();
- }
- else {
- throw new IllegalArgumentException();
- }
-
- firePropertyChanged(TRANSACTION_TYPE_PROPERTY, oldTransactionType, newTransactionType);
- }
-
- public boolean isTransactionTypeDefault() {
- return this.transactionType == DEFAULT;
- }
-
- public void setTransactionTypeToDefault() {
- setTransactionType(DEFAULT);
- }
-
- public PersistenceUnitTransactionType getDefaultTransactionType() {
- // TODO - calculate default
- // From the JPA spec: "In a Java EE environment, if this element is not
- // specified, the default is JTA. In a Java SE environment, if this element
- // is not specified, a default of RESOURCE_LOCAL may be assumed."
- return this.defaultTransactionType;
- }
-
-
- // **************** description ********************************************
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String newDescription) {
- String oldDescription = this.description;
- this.description = newDescription;
- this.xmlPersistenceUnit.setDescription(newDescription);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldDescription, newDescription);
- }
-
-
- // **************** provider ***********************************************
-
- public String getProvider() {
- return this.provider;
- }
-
- public void setProvider(String newProvider) {
- String oldProvider = this.provider;
- this.provider = newProvider;
- this.xmlPersistenceUnit.setProvider(newProvider);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldProvider, newProvider);
- }
-
-
- // **************** jta data source ****************************************
-
- public String getJtaDataSource() {
- return this.jtaDataSource;
- }
-
- public void setJtaDataSource(String newJtaDataSource) {
- String oldJtaDataSource = this.jtaDataSource;
- this.jtaDataSource = newJtaDataSource;
- this.xmlPersistenceUnit.setJtaDataSource(newJtaDataSource);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldJtaDataSource, newJtaDataSource);
- }
-
-
- // **************** non-jta data source ************************************
-
- public String getNonJtaDataSource() {
- return this.nonJtaDataSource;
- }
-
- public void setNonJtaDataSource(String newNonJtaDataSource) {
- String oldNonJtaDataSource = this.nonJtaDataSource;
- this.nonJtaDataSource = newNonJtaDataSource;
- this.xmlPersistenceUnit.setNonJtaDataSource(newNonJtaDataSource);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldNonJtaDataSource, newNonJtaDataSource);
- }
-
-
- // **************** mapping file refs **************************************
-
- public ListIterator<MappingFileRef> mappingFileRefs() {
- if (impliedMappingFileRef == null) {
- return specifiedMappingFileRefs();
- }
- else {
- return new ReadOnlyCompositeListIterator<MappingFileRef>(
- specifiedMappingFileRefs(), impliedMappingFileRef);
- }
- }
-
- public int mappingFileRefsSize() {
- if (impliedMappingFileRef == null) {
- return specifiedMappingFileRefsSize();
- }
- return 1 + specifiedMappingFileRefsSize();
- }
-
- // **************** specified mapping file refs ****************************
-
- public ListIterator<MappingFileRef> specifiedMappingFileRefs() {
- return new CloneListIterator<MappingFileRef>(specifiedMappingFileRefs);
- }
-
- public int specifiedMappingFileRefsSize() {
- return specifiedMappingFileRefs.size();
- }
-
- public MappingFileRef addSpecifiedMappingFileRef() {
- return addSpecifiedMappingFileRef(specifiedMappingFileRefs.size());
- }
-
- public MappingFileRef addSpecifiedMappingFileRef(int index) {
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- MappingFileRef mappingFileRef = buildMappingFileRef(xmlMappingFileRef);
- specifiedMappingFileRefs.add(index, mappingFileRef);
- this.xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- fireItemAdded(SPECIFIED_MAPPING_FILE_REF_LIST, index, mappingFileRef);
- return mappingFileRef;
- }
-
- public void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef) {
- removeSpecifiedMappingFileRef(specifiedMappingFileRefs.indexOf(mappingFileRef));
- }
-
- public void removeSpecifiedMappingFileRef(int index) {
- MappingFileRef mappingFileRefRemoved = specifiedMappingFileRefs.remove(index);
- this.xmlPersistenceUnit.getMappingFiles().remove(index);
- fireItemRemoved(SPECIFIED_MAPPING_FILE_REF_LIST, index, mappingFileRefRemoved);
- }
-
- protected void addSpecifiedMappingFileRef_(MappingFileRef mappingFileRef) {
- addSpecifiedMappingFileRef_(specifiedMappingFileRefs.size(), mappingFileRef);
- }
-
- protected void addSpecifiedMappingFileRef_(int index, MappingFileRef mappingFileRef) {
- addItemToList(index, mappingFileRef, specifiedMappingFileRefs, SPECIFIED_MAPPING_FILE_REF_LIST);
- }
-
- protected void removeSpecifiedMappingFileRef_(MappingFileRef mappingFileRef) {
- removeSpecifiedMappingFileRef_(specifiedMappingFileRefs.indexOf(mappingFileRef));
- }
-
- protected void removeSpecifiedMappingFileRef_(int index) {
- removeItemFromList(index, specifiedMappingFileRefs, SPECIFIED_MAPPING_FILE_REF_LIST);
- }
-
-
- // **************** implied mapping file ref *******************************
-
- public MappingFileRef getImpliedMappingFileRef() {
- return impliedMappingFileRef;
- }
-
- public MappingFileRef setImpliedMappingFileRef() {
- if (impliedMappingFileRef != null) {
- throw new IllegalStateException("The implied mapping file ref is already set.");
- }
- MappingFileRef mappingFileRef = buildMappingFileRef(null);
- impliedMappingFileRef = mappingFileRef;
- firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, null, mappingFileRef);
- return mappingFileRef;
- }
-
- public void unsetImpliedMappingFileRef() {
- if (impliedMappingFileRef == null) {
- throw new IllegalStateException("The implie mapping file ref is already unset.");
- }
- MappingFileRef mappingFileRef = impliedMappingFileRef;
- impliedMappingFileRef = null;
- firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, mappingFileRef, null);
- }
-
-
- // **************** class refs *********************************************
-
- public ListIterator<ClassRef> classRefs() {
- return new ReadOnlyCompositeListIterator<ClassRef>(
- specifiedClassRefs(), impliedClassRefs());
- }
-
- public int classRefsSize() {
- return specifiedClassRefsSize() + impliedClassRefsSize();
- }
-
- // **************** specified class refs ***********************************
-
- public ListIterator<ClassRef> specifiedClassRefs() {
- return new CloneListIterator<ClassRef>(this.specifiedClassRefs);
- }
-
- public int specifiedClassRefsSize() {
- return specifiedClassRefs.size();
- }
-
- public ClassRef addSpecifiedClassRef() {
- return addSpecifiedClassRef(this.specifiedClassRefs.size());
- }
-
- public ClassRef addSpecifiedClassRef(int index) {
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- ClassRef classRef = buildClassRef(xmlClassRef);
- this.specifiedClassRefs.add(index, classRef);
- this.xmlPersistenceUnit.getClasses().add(xmlClassRef);
- fireItemAdded(SPECIFIED_CLASS_REF_LIST, index, classRef);
- return classRef;
- }
-
- public void removeSpecifiedClassRef(ClassRef classRef) {
- removeSpecifiedClassRef(this.specifiedClassRefs.indexOf(classRef));
- }
-
- public void removeSpecifiedClassRef(int index) {
- ClassRef classRefRemoved = this.specifiedClassRefs.remove(index);
- this.xmlPersistenceUnit.getClasses().remove(index);
- fireItemRemoved(SPECIFIED_CLASS_REF_LIST, index, classRefRemoved);
- }
-
- protected void addSpecifiedClassRef_(ClassRef classRef) {
- addSpecifiedClassRef_(this.specifiedClassRefs.size(), classRef);
- }
-
- protected void addSpecifiedClassRef_(int index, ClassRef classRef) {
- addItemToList(index, classRef, this.specifiedClassRefs, SPECIFIED_CLASS_REF_LIST);
- }
-
- protected void removeSpecifiedClassRef_(ClassRef classRef) {
- removeSpecifiedClassRef_(this.specifiedClassRefs.indexOf(classRef));
- }
-
- protected void removeSpecifiedClassRef_(int index) {
- removeItemFromList(index, this.specifiedClassRefs, SPECIFIED_CLASS_REF_LIST);
- }
-
-
- // **************** implied class refs *************************************
-
- public ListIterator<ClassRef> impliedClassRefs() {
- return new CloneListIterator<ClassRef>(impliedClassRefs);
- }
-
- public int impliedClassRefsSize() {
- return impliedClassRefs.size();
- }
-
- public ClassRef addImpliedClassRef(String className) {
- return addImpliedClassRef(impliedClassRefs.size(), className);
- }
-
- public ClassRef addImpliedClassRef(int index, String className) {
- ClassRef classRef = buildClassRef(className);
- addItemToList(classRef, impliedClassRefs, IMPLIED_CLASS_REF_LIST);
- return classRef;
- }
-
- public void removeImpliedClassRef(ClassRef classRef) {
- removeImpliedClassRef(impliedClassRefs.indexOf(classRef));
- }
-
- public void removeImpliedClassRef(int index) {
- removeItemFromList(index, impliedClassRefs, IMPLIED_CLASS_REF_LIST);
- }
-
- protected void addImpliedClassRef_(ClassRef classRef) {
- addImpliedClassRef_(impliedClassRefs.size(), classRef);
- }
-
- protected void addImpliedClassRef_(int index, ClassRef classRef) {
- addItemToList(index, classRef, impliedClassRefs, IMPLIED_CLASS_REF_LIST);
- }
-
-
- // **************** exclude unlisted classes *******************************
-
- public boolean getExcludeUnlistedClasses() {
- return (isExcludeUnlistedClassesDefault()) ?
- getDefaultExcludeUnlistedClasses() : this.excludeUnlistedClasses;
- }
-
- public void setExcludeUnlistedClasses(boolean newExcludeUnlistedClasses) {
- setExcludeUnlistedClasses((Boolean) newExcludeUnlistedClasses);
- }
-
- public boolean isExcludeUnlistedClassesDefault() {
- return this.excludeUnlistedClasses == null;
- }
-
- public boolean getDefaultExcludeUnlistedClasses() {
- // TODO - calculate default
- // This is determined from the project
- return this.defaultExcludeUnlistedClasses;
- }
-
- public void setExcludeUnlistedClassesToDefault() {
- setExcludeUnlistedClasses(null);
- }
-
- protected void setExcludeUnlistedClasses(Boolean newExcludeUnlistedClasses) {
- Boolean oldExcludeUnlistedClasses = this.excludeUnlistedClasses;
- this.excludeUnlistedClasses = newExcludeUnlistedClasses;
-
- if (this.excludeUnlistedClasses != null) {
- this.xmlPersistenceUnit.setExcludeUnlistedClasses(this.excludeUnlistedClasses);
- }
- else {
- this.xmlPersistenceUnit.unsetExcludeUnlistedClasses();
- }
-
- firePropertyChanged(EXCLUDE_UNLISTED_CLASSED_PROPERTY, oldExcludeUnlistedClasses, newExcludeUnlistedClasses);
- }
-
-
- // **************** properties *********************************************
-
- public ListIterator<Property> properties() {
- return new CloneListIterator<Property>(this.properties);
- }
-
- public int propertiesSize() {
- return this.properties.size();
- }
-
- public Property getProperty(String key) {
- for(Property property : this.properties) {
- if(property.getName().equals(key)) {
- return property;
- }
- }
- return null;
- }
-
- public Property getProperty(String key, String value) {
- for(Property property : this.properties) {
- if(property.getName().equals(key) && property.getValue().equals(value)) {
- return property;
- }
- }
- return null;
- }
-
- protected Property getProperty(int index) {
- return this.properties.get(index);
- }
-
- protected XmlProperty getXmlProperty(String name, String value) {
- if (this.xmlPersistenceUnit.getProperties() == null) {
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- this.xmlPersistenceUnit.setProperties(xmlProperties);
- }
- for(XmlProperty xmlProperty : this.xmlPersistenceUnit.getProperties().getProperties()) {
- if(name.equals(xmlProperty.getName()) && value.equals(xmlProperty.getValue())) {
- return xmlProperty;
- }
- }
- return null;
- }
-
- /**
- * Adds or Changes Property with the given key and value.
- */
- public void putProperty(String key, String value, boolean allowDuplicates) {
- if( ! allowDuplicates && this.containsProperty(key)) {
- this.putXmlProperty(key, value, this.getProperty(key).getValue());
- return;
- }
- if( value != null) {
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName(key);
- xmlProperty.setValue(value);
-
- this.addXmlProperty(xmlProperty);
- return;
- }
- }
-
- public void replacePropertyValue(String key, String oldValue, String newValue) {
-
- this.putXmlProperty(key, newValue, oldValue);
- }
-
- protected void putXmlProperty(String key, String value, String oldValue) {
- if( value == null) {
- this.removeProperty(key);
- return;
- }
- EList<XmlProperty> xmlProperties = this.xmlPersistenceUnit.getProperties().getProperties();
-
- XmlProperty xmlProperty = this.getXmlProperty(key, oldValue);
- if(xmlProperty == null) {
- throw new NoSuchElementException("Missing Property name: " + key + ", value: " + oldValue);
- }
- xmlProperty.setValue(value);
- }
-
- public boolean containsProperty(String key) {
- return (this.getProperty(key) != null);
- }
-
- public Property addProperty() {
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
-
- return this.addXmlProperty(xmlProperty);
- }
-
- protected Property addXmlProperty(XmlProperty xmlProperty) {
-
- Property property = buildProperty(xmlProperty);
- int index = this.properties.size();
- this.properties.add(index, property);
-
- if (this.xmlPersistenceUnit.getProperties() == null) {
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- this.xmlPersistenceUnit.setProperties(xmlProperties);
- }
-
- this.xmlPersistenceUnit.getProperties().getProperties().add(xmlProperty);
- this.fireItemAdded(PROPERTIES_LIST, index, property);
- return property;
- }
-
- public void removeProperty(String key) {
- this.removeProperty(this.getProperty(key));
- }
-
- public void removeProperty(String key, String value) {
- this.removeProperty(this.getProperty(key, value));
- }
-
- public void removeProperty(Property property) {
- if (property != null) {
- this.removeProperty(this.properties.indexOf(property));
- }
- }
-
- protected void removeProperty(int index) {
- Property propertyRemoved = this.properties.remove(index);
- this.xmlPersistenceUnit.getProperties().getProperties().remove(index);
-
- if (this.xmlPersistenceUnit.getProperties().getProperties().isEmpty()) {
- this.xmlPersistenceUnit.setProperties(null);
- }
-
- fireItemRemoved(PROPERTIES_LIST, index, propertyRemoved);
- }
-
- protected void addProperty_(Property property) {
- addProperty_(this.properties.size(), property);
- }
-
- protected void addProperty_(int index, Property property) {
- addItemToList(index, property, this.properties, PROPERTIES_LIST);
- }
-
- protected void removeProperty_(Property property) {
- removeProperty_(this.properties.indexOf(property));
- }
-
- protected void removeProperty_(int index) {
- removeItemFromList(index, this.properties, PROPERTIES_LIST);
- }
-
-
- // **************** Persistence Unit Defaults *********************************************
-
- //TODO validation for multiple persistenceUnitDefaults.
-
- //Take the first PersistenceUnitDefaults found in an orm.xml file and use
- //this for the defaults of the PersistenceUnit.
- protected PersistenceUnitDefaults persistenceUnitDefaults() {
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(mappingFileRefs())) {
- PersistenceUnitDefaults persistenceUnitDefaults = mappingFileRef.persistenceUnitDefaults();
- if (persistenceUnitDefaults != null) {
- return persistenceUnitDefaults;
- }
- }
- return null;
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String newDefaultSchema) {
- String oldDefaultSchema = this.defaultSchema;
- this.defaultSchema = newDefaultSchema;
- firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, oldDefaultSchema, newDefaultSchema);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String newDefaultCatalog) {
- String oldDefaultCatalog = this.defaultCatalog;
- this.defaultCatalog = newDefaultCatalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, oldDefaultCatalog, newDefaultCatalog);
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType newDefaultAccess) {
- AccessType oldDefaultAccess = this.defaultAccess;
- this.defaultAccess = newDefaultAccess;
- firePropertyChanged(DEFAULT_ACCESS_PROPERTY, oldDefaultAccess, newDefaultAccess);
- }
-
- public boolean getDefaultCascadePersist() {
- return this.defaultCascadePersist;
- }
-
- protected void setDefaultCascadePersist(boolean newDefaultCascadePersist) {
- boolean oldDefaultCascadePersist = this.defaultCascadePersist;
- this.defaultCascadePersist = newDefaultCascadePersist;
- firePropertyChanged(DEFAULT_CASCADE_PERSIST_PROPERTY, oldDefaultCascadePersist, newDefaultCascadePersist);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlPersistenceUnit xmlPersistenceUnit) {
- this.xmlPersistenceUnit = xmlPersistenceUnit;
- this.name = xmlPersistenceUnit.getName();
- initializeMappingFileRefs(xmlPersistenceUnit);
- initializeClassRefs(xmlPersistenceUnit);
- initializeProperties(xmlPersistenceUnit);
- }
-
- protected void initializeMappingFileRefs(XmlPersistenceUnit xmlPersistenceUnit) {
- for (XmlMappingFileRef xmlMappingFileRef : xmlPersistenceUnit.getMappingFiles()) {
- specifiedMappingFileRefs.add(buildMappingFileRef(xmlMappingFileRef));
- }
- if (! impliedMappingFileIsSpecified() && impliedMappingFileExists()) {
- impliedMappingFileRef = buildMappingFileRef(null);
- }
- }
-
- protected void initializeClassRefs(XmlPersistenceUnit xmlPersistenceUnit) {
- for (XmlJavaClassRef xmlJavaClassRef : xmlPersistenceUnit.getClasses()) {
- specifiedClassRefs.add(buildClassRef(xmlJavaClassRef));
- }
-
- if (jpaProject().discoversAnnotatedClasses() && ! getExcludeUnlistedClasses()) {
- for (IType type : CollectionTools.iterable(jpaProject().annotatedClasses())) {
- if (! classIsSpecified(type.getFullyQualifiedName())) {
- impliedClassRefs.add(buildClassRef(type.getFullyQualifiedName()));
- }
- }
- }
- }
-
- protected void initializeProperties(XmlPersistenceUnit xmlPersistenceUnit) {
- XmlProperties xmlProperties = xmlPersistenceUnit.getProperties();
- if (xmlProperties == null) {
- return;
- }
- for (XmlProperty xmlProperty : xmlProperties.getProperties()) {
- this.properties.add(buildProperty(xmlProperty));
- }
- }
-
- protected void initializePersistenceUnitDefaults() {
- PersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- if (persistenceUnitDefaults != null) {
- this.defaultSchema = persistenceUnitDefaults.getSchema();
- this.defaultCatalog = persistenceUnitDefaults.getCatalog();
- this.defaultAccess = persistenceUnitDefaults.getAccess();
- this.defaultCascadePersist = persistenceUnitDefaults.isCascadePersist();
- }
- else {
- this.defaultSchema = null;
- this.defaultCatalog = null;
- this.defaultAccess = null;
- this.defaultCascadePersist = false;
- }
- }
-
- public void update(XmlPersistenceUnit persistenceUnit) {
- this.xmlPersistenceUnit = persistenceUnit;
- updateName(persistenceUnit);
- updateTransactionType(persistenceUnit);
- updateDescription(persistenceUnit);
- updateProvider(persistenceUnit);
- updateJtaDataSource(persistenceUnit);
- updateNonJtaDataSource(persistenceUnit);
- updateMappingFileRefs(persistenceUnit);
- updateClassRefs(persistenceUnit);
- updateExcludeUnlistedClasses(persistenceUnit);
- updateProperties(persistenceUnit);
- updatePersistenceUnitDefaults();
- }
-
- protected void updateName(XmlPersistenceUnit persistenceUnit) {
- setName(persistenceUnit.getName());
- }
-
- protected void updateTransactionType(XmlPersistenceUnit persistenceUnit) {
- if (! persistenceUnit.isSetTransactionType()) {
- setTransactionType(DEFAULT);
- }
- else if (persistenceUnit.getTransactionType() == XmlPersistenceUnitTransactionType.JTA) {
- setTransactionType(JTA);
- }
- else if (persistenceUnit.getTransactionType() == XmlPersistenceUnitTransactionType.RESOURCE_LOCAL) {
- setTransactionType(RESOURCE_LOCAL);
- }
- else {
- throw new IllegalStateException();
- }
- }
-
- protected void updateDescription(XmlPersistenceUnit persistenceUnit) {
- setDescription(persistenceUnit.getDescription());
- }
-
- protected void updateProvider(XmlPersistenceUnit persistenceUnit) {
- setProvider(persistenceUnit.getProvider());
- }
-
- protected void updateJtaDataSource(XmlPersistenceUnit persistenceUnit) {
- setJtaDataSource(persistenceUnit.getJtaDataSource());
- }
-
- protected void updateNonJtaDataSource(XmlPersistenceUnit persistenceUnit) {
- setNonJtaDataSource(persistenceUnit.getNonJtaDataSource());
- }
-
- protected void updateMappingFileRefs(XmlPersistenceUnit persistenceUnit) {
- Iterator<MappingFileRef> stream = specifiedMappingFileRefs();
- Iterator<XmlMappingFileRef> stream2 = persistenceUnit.getMappingFiles().iterator();
-
- while (stream.hasNext()) {
- MappingFileRef mappingFileRef = stream.next();
- if (stream2.hasNext()) {
- mappingFileRef.update(stream2.next());
- }
- else {
- removeSpecifiedMappingFileRef_(mappingFileRef);
- }
- }
-
- while (stream2.hasNext()) {
- addSpecifiedMappingFileRef_(buildMappingFileRef(stream2.next()));
- }
-
- if (impliedMappingFileIsSpecified()) {
- if (impliedMappingFileRef != null) {
- unsetImpliedMappingFileRef();
- }
- }
- else {
- if (impliedMappingFileExists()) {
- if (impliedMappingFileRef == null) {
- setImpliedMappingFileRef();
- }
- getImpliedMappingFileRef().update(null);
- }
- else {
- if (impliedMappingFileRef != null) {
- unsetImpliedMappingFileRef();
- }
- }
- }
- }
-
- protected boolean impliedMappingFileIsSpecified() {
- String impliedMappingFile = JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH;
- for (MappingFileRef each : specifiedMappingFileRefs) {
- if (impliedMappingFile.equals(each.getFileName())) {
- return true;
- }
- }
- return false;
- }
-
- protected boolean impliedMappingFileExists() {
- OrmArtifactEdit oae = OrmArtifactEdit.getArtifactEditForRead(jpaProject().project());
- OrmResource or = oae.getResource(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- boolean exists = or != null && or.exists();
- oae.dispose();
- return exists;
- }
-
- protected MappingFileRef buildMappingFileRef(XmlMappingFileRef xmlMappingFileRef) {
- return jpaFactory().buildMappingFileRef(this, xmlMappingFileRef);
- }
-
- protected void updateClassRefs(XmlPersistenceUnit persistenceUnit) {
- Iterator<ClassRef> stream = specifiedClassRefs();
- Iterator<XmlJavaClassRef> stream2 = new CloneIterator<XmlJavaClassRef>(persistenceUnit.getClasses());
-
- while (stream.hasNext()) {
- ClassRef classRef = stream.next();
- if (stream2.hasNext()) {
- classRef.update(stream2.next());
- }
- else {
- removeSpecifiedClassRef_(classRef);
- }
- }
-
- while (stream2.hasNext()) {
- addSpecifiedClassRef_(buildClassRef(stream2.next()));
- }
-
- Iterator<ClassRef> impliedRefs = impliedClassRefs();
- Iterator<IType> annotatedClasses = jpaProject().annotatedClasses();
-
-
- if (jpaProject().discoversAnnotatedClasses() && ! getExcludeUnlistedClasses()) {
- while (impliedRefs.hasNext()) {
- ClassRef classRef = impliedRefs.next();
- boolean updated = false;
- while (! updated && annotatedClasses.hasNext()) {
- IType annotatedClass = annotatedClasses.next();
- if (! classIsSpecified(annotatedClass.getFullyQualifiedName())) {
- classRef.update(annotatedClass.getFullyQualifiedName());
- updated = true;
- }
- }
- if (! annotatedClasses.hasNext() && ! updated) {
- removeImpliedClassRef(classRef);
- }
- }
-
- while (annotatedClasses.hasNext()) {
- IType annotatedClass = annotatedClasses.next();
- if (! classIsSpecified(annotatedClass.getFullyQualifiedName())) {
- addImpliedClassRef(annotatedClass.getFullyQualifiedName());
- }
- }
- }
- else {
- for (ClassRef classRef : CollectionTools.iterable(impliedClassRefs())) {
- removeImpliedClassRef(classRef);
- }
- }
- }
-
- protected ClassRef buildClassRef(XmlJavaClassRef xmlClassRef) {
- return jpaFactory().buildClassRef(this, xmlClassRef);
- }
-
- protected ClassRef buildClassRef(String className) {
- return jpaFactory().buildClassRef(this, className);
- }
-
- protected boolean classIsSpecified(String className) {
- for (ClassRef specifiedClassRef : CollectionTools.iterable(specifiedClassRefs())) {
- if (className.equals(specifiedClassRef.getClassName())) {
- return true;
- }
- }
- return false;
- }
-
- protected void updateExcludeUnlistedClasses(XmlPersistenceUnit persistenceUnit) {
- if (persistenceUnit.isSetExcludeUnlistedClasses()) {
- setExcludeUnlistedClasses(persistenceUnit.isExcludeUnlistedClasses());
- }
- else {
- setExcludeUnlistedClassesToDefault();
- }
- }
-
- protected void updateProperties(XmlPersistenceUnit persistenceUnit) {
- XmlProperties xmlProperties = persistenceUnit.getProperties();
-
- Iterator<Property> stream = properties();
- Iterator<XmlProperty> stream2;
-
- if (xmlProperties == null) {
- stream2 = EmptyIterator.instance();
- }
- else {
- stream2 = xmlProperties.getProperties().iterator();
- }
-
- while (stream.hasNext()) {
- Property property = stream.next();
- if (stream2.hasNext()) {
- property.update(stream2.next());
- }
- else {
- removeProperty_(property);
- }
- }
-
- while (stream2.hasNext()) {
- addProperty_(buildProperty(stream2.next()));
- }
- }
-
- protected Property buildProperty(XmlProperty xmlProperty) {
- return jpaFactory().buildProperty(this, xmlProperty);
- }
-
- protected void updatePersistenceUnitDefaults() {
- PersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- this.setDefaultSchema(this.schema(persistenceUnitDefaults));
- this.setDefaultCatalog(this.catalog(persistenceUnitDefaults));
- this.setDefaultAccess(this.access(persistenceUnitDefaults));
- this.setDefaultCascadePersist(this.cascadePersist(persistenceUnitDefaults));
- }
-
- protected String schema(PersistenceUnitDefaults persistenceUnitDefaults) {
- if (persistenceUnitDefaults != null) {
- if (persistenceUnitDefaults.getSchema() != null) {
- return persistenceUnitDefaults.getSchema();
- }
- }
- Schema projectDefaultSchema = projectDefaultSchema();
- return projectDefaultSchema == null ? null : projectDefaultSchema.getName();
- }
-
- protected Schema projectDefaultSchema() {
- return jpaProject().defaultSchema();
- }
-
- protected String catalog(PersistenceUnitDefaults persistenceUnitDefaults) {
- if (persistenceUnitDefaults != null) {
- if (persistenceUnitDefaults.getCatalog() != null) {
- return persistenceUnitDefaults.getCatalog();
- }
- }
- String catalog = projectDefaultCatalog();
- //the context model uses nulls for defaults that don't exist. currently
- //the DB model is using "" to represent no catalog, changing this here
- if (catalog == "") {
- catalog = null;
- }
- return catalog;
- }
-
- protected String projectDefaultCatalog() {
- return jpaProject().connectionProfile().getCatalogName();
- }
-
- protected AccessType access(PersistenceUnitDefaults persistenceUnitDefaults) {
- return persistenceUnitDefaults == null ? null : persistenceUnitDefaults.getAccess();
- }
-
- protected boolean cascadePersist(PersistenceUnitDefaults persistenceUnitDefaults) {
- return persistenceUnitDefaults == null ? false : persistenceUnitDefaults.isCascadePersist();
- }
-
-
- // ********** Validation ***********************************************
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addMappingFileMessages(messages);
- addClassMessages(messages);
- }
-
- protected void addMappingFileMessages(List<IMessage> messages) {
- addMultipleMetadataMessages(messages);
- addDuplicateMappingFileMessages(messages);
-
- for (Iterator<MappingFileRef> stream = mappingFileRefs(); stream.hasNext();) {
- stream.next().addToMessages(messages);
- }
- }
-
- protected void addMultipleMetadataMessages(List<IMessage> messages) {
- Collection<PersistenceUnitDefaults> puDefaultsCollection = persistenceUnitDefaultsForValidation();
- if (puDefaultsCollection.size() > 1) {
- for (PersistenceUnitDefaults puDefaults : puDefaultsCollection) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_MAPPINGS_MULTIPLE_METADATA,
- new String[] {this.getName()},
- puDefaults)
- );
- }
- }
- }
-
- protected void addDuplicateMappingFileMessages(List<IMessage> messages) {
- HashBag<String> fileBag = new HashBag<String>(
- CollectionTools.collection(
- new TransformationIterator<MappingFileRef, String>(this.mappingFileRefs()) {
- @Override
- protected String transform(MappingFileRef mappingFileRef) {
- return mappingFileRef.getFileName();
- }
- }
- )
- );
- for (MappingFileRef mappingFileRef : CollectionTools.collection(this.mappingFileRefs())) {
- if (fileBag.count(mappingFileRef.getFileName()) > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE,
- new String[] {mappingFileRef.getFileName()},
- mappingFileRef/*,
- mappingFileRef.validationTextRange()*/)
- );
- }
- }
- }
-
- protected void addClassMessages(List<IMessage> messages) {
-// addInvalidOrRedundantClassMessages(messages);
- addDuplicateClassMessages(messages);
-
- for (ClassRef classRef : CollectionTools.collection(classRefs())) {
- classRef.addToMessages(messages);
- }
- }
-
-// protected void addInvalidOrRedundantClassMessages(List<IMessage> messages) {
-// for (IClassRef javaClassRef : CollectionTools.collection(this.classRefs())) {
-// IJavaPersistentType javaPersistentType = javaClassRef.getJavaPersistentType();
-// //*****leaving this test out for now********
-// //first test for a redundant entry in any of the mapping files
-//// if (mappingFilesContainPersistentTypeFor(jdtType)){
-//// //Uncomment below code to add info message about redundant entry.
-//// /* messages.add(JpaValidationMessages.buildMessage(
-//// IMessage.LOW_SEVERITY,
-//// IJpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS,
-//// new String[] { javaClassRef.getJavaClass() },
-//// javaClassRef, javaClassRef.validationTextRange())); */
-//// //if not redundant, check to see if it is an invalid entry
-//// } else if(!StringTools.stringIsEmpty(javaClass)
-// } if (!StringTools.stringIsEmpty(javaClass)
-// && jdtType != null
-// && (javaPersistentTypeFor(javaClassRef) == null || javaPersistentTypeFor(
-// javaClassRef).getMappingKey() == IMappingKeys.NULL_TYPE_MAPPING_KEY)){
-// messages.add(JpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// IJpaValidationMessages.PERSISTENCE_UNIT_INVALID_CLASS,
-// new String[] { javaClassRef.getJavaClass() }, javaClassRef,
-// javaClassRef.validationTextRange()));
-// }
-// }
-// }
-
-
- protected void addDuplicateClassMessages(List<IMessage> messages) {
- HashBag<String> classNameBag = new HashBag<String>(
- CollectionTools.collection(
- new TransformationIterator<ClassRef, String>(this.classRefs()) {
- @Override
- protected String transform(ClassRef classRef) {
- return classRef.getClassName();
- }
- }
- )
- );
- for (ClassRef javaClassRef : CollectionTools.collection(this.classRefs())) {
- if (javaClassRef.getClassName() != null
- && classNameBag.count(javaClassRef.getClassName()) > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_CLASS,
- new String[] {javaClassRef.getClassName()},
- javaClassRef,
- javaClassRef.validationTextRange())
- );
- }
- }
- }
-
-
- private Collection<PersistenceUnitDefaults> persistenceUnitDefaultsForValidation() {
- ArrayList<PersistenceUnitDefaults> puDefaults = new ArrayList<PersistenceUnitDefaults>();
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(mappingFileRefs())) {
- PersistenceUnitDefaults persistenceUnitDefaults = mappingFileRef.persistenceUnitDefaults();
- if (persistenceUnitDefaults != null) {
- puDefaults.add(persistenceUnitDefaults);
- }
- }
- return puDefaults;
- }
-
- //*************************************
-
- public PersistentType persistentType(String fullyQualifiedTypeName) {
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(mappingFileRefs())) {
- OrmPersistentType ormPersistentType = mappingFileRef.persistentTypeFor(fullyQualifiedTypeName);
- if (ormPersistentType != null) {
- return ormPersistentType;
- }
- }
- for (ClassRef classRef : CollectionTools.iterable(classRefs())) {
- if (classRef.isFor(fullyQualifiedTypeName)) {
- return classRef.getJavaPersistentType();
- }
- }
- return null;
- }
-
- public JpaStructureNode structureNode(int textOffset) {
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(mappingFileRefs())) {
- if (mappingFileRef.containsOffset(textOffset)) {
- return mappingFileRef;
- }
- }
- for (ClassRef classRef : CollectionTools.iterable(classRefs())) {
- if (classRef.containsOffset(textOffset)) {
- return classRef;
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- if (xmlPersistenceUnit == null) {
- return false;
- }
- return xmlPersistenceUnit.containsOffset(textOffset);
- }
-
- public TextRange selectionTextRange() {
- return xmlPersistenceUnit.selectionTextRange();
- }
-
- public TextRange validationTextRange() {
- return xmlPersistenceUnit.validationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java
deleted file mode 100644
index ce477f1d11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXml.java
+++ /dev/null
@@ -1,172 +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.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericPersistenceXml extends AbstractPersistenceJpaContextNode
- implements PersistenceXml
-{
- protected PersistenceResource persistenceResource;
-
- protected Persistence persistence;
-
-
- public GenericPersistenceXml(BaseJpaContent baseJpaContent, PersistenceResource persistenceResource) {
- super(baseJpaContent);
- this.initialize(persistenceResource);
- }
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
- @Override
- public IResource resource() {
- return persistenceResource.getFile();
- }
-
- // **************** persistence ********************************************
-
- public Persistence getPersistence() {
- return persistence;
- }
-
- public Persistence addPersistence() {
- if (persistence != null) {
- throw new IllegalStateException();
- }
-
- XmlPersistence xmlPersistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- persistence = buildPersistence(xmlPersistence);
- persistenceResource.getContents().add(xmlPersistence);
- firePropertyChanged(PERSISTENCE_PROPERTY, null, persistence);
- return persistence;
- }
-
- public void removePersistence() {
- if (persistence == null) {
- throw new IllegalStateException();
- }
-
- Persistence oldPersistence = persistence;
- persistence = null;
- XmlPersistence xmlPersistence = persistenceResource.getPersistence();
- persistenceResource.getContents().remove(xmlPersistence);
- firePropertyChanged(PERSISTENCE_PROPERTY, oldPersistence, null);
- }
-
- protected void setPersistence_(Persistence newPersistence) {
- Persistence oldPersistence = persistence;
- persistence = newPersistence;
- firePropertyChanged(PERSISTENCE_PROPERTY, oldPersistence, newPersistence);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(PersistenceResource persistenceResource) {
- this.persistenceResource = persistenceResource;
- if (persistenceResource.getPersistence() != null) {
- this.persistence = buildPersistence(persistenceResource.getPersistence());
- }
- }
-
- public void update(PersistenceResource persistenceResource) {
- if (! persistenceResource.equals(this.persistenceResource)) {
- this.persistenceResource = persistenceResource;
- this.persistenceResource.resourceModel().removeRootStructureNode(this);
- }
- if (persistenceResource.getPersistence() != null) {
- if (this.persistence != null) {
- this.persistence.update(persistenceResource.getPersistence());
- }
- else {
- setPersistence_(buildPersistence(persistenceResource.getPersistence()));
- }
- persistenceResource.resourceModel().addRootStructureNode(getPersistence());
- }
- else {
- setPersistence_(null);
- }
- }
-
- protected Persistence buildPersistence(XmlPersistence xmlPersistence) {
- return jpaFactory().buildPersistence(this, xmlPersistence);
- }
-
-
- // *************************************************************************
-
- @Override
- public PersistenceUnit persistenceUnit() {
- throw new UnsupportedOperationException("No PersistenceUnit in this context");
- }
-
-
- public JpaStructureNode structureNode(int textOffset) {
- if (persistence.containsOffset(textOffset)) {
- return persistence.structureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange selectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public TextRange validationTextRange() {
- return TextRange.Empty.instance();
- }
-
-
- // **************** validation *********************************************
-
- private boolean okToContinueValidation = true;
-
- @Override
- public void addToMessages(List<IMessage> messages) {
- super.addToMessages(messages);
- addInvalidPersistenceXmlContentMessage(messages);
-
- if (okToContinueValidation){
- getPersistence().addToMessages(messages);
- }
- }
-
- protected void addInvalidPersistenceXmlContentMessage(List<IMessage> messages) {
- if (this.persistence == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT,
- this)
- );
- okToContinueValidation = false;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java
deleted file mode 100644
index 92bcdda658..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericProperty.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-
-public class GenericProperty extends AbstractPersistenceJpaContextNode
- implements Property
-{
- protected String name;
-
- protected String value;
-
- protected XmlProperty property;
-
- public GenericProperty(PersistenceUnit parent, XmlProperty property) {
- super(parent);
- this.initialize(property);
- }
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.property.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** value **************************************************
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.property.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- // **************** updating ***********************************************
-
- protected void initialize(XmlProperty property) {
- this.property = property;
- this.name = property.getName();
- this.value = property.getValue();
- }
-
- public void update(XmlProperty property) {
- this.property = property;
- setName(property.getName());
- setValue(property.getValue());
- }
-
- // **************** validation ***********************************************
-
- public TextRange validationTextRange() {
- return this.property.validationTextRange();
- }
-
- // **************** toString
- @Override
- public void toString(StringBuilder sb)
- {
- sb.append(" (name: ");
- sb.append(name);
- sb.append(", value: ");
- sb.append(value);
- sb.append(')');
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/ComponentUtilities.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/ComponentUtilities.java
deleted file mode 100644
index 663b42740f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/ComponentUtilities.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.emfutility;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class ComponentUtilities
-{
- /**
- * Return the deployment path for the given source file. If there is no
- * corresponding deployment file, null will be returned.
- */
- public static IPath computeDeployPath(IFile sourceFile) {
- // Unfortunately, the only current way to do this is to exhaustively
- // search all deployment files and attempt to match to this file.
- // Bug 202943 has been logged to track this issue.
- for (IVirtualFile virtualFile : CollectionTools.iterable(allVirtualFiles(sourceFile.getProject()))) {
- for (IFile underlyingFile : virtualFile.getUnderlyingFiles()) {
- if (sourceFile.equals(underlyingFile)) {
- return virtualFile.getRuntimePath();
- }
- }
- }
- return null;
- }
-
- private static Iterator<IVirtualFile> allVirtualFiles(IProject project) {
- return new FilteringIterator<IVirtualResource, IVirtualFile>(allVirtualResources(project)) {
- @Override
- protected boolean accept(IVirtualResource o) {
- return o.getType() == IVirtualResource.FILE;
- }
- };
- }
-
- private static Iterator<IVirtualResource> allVirtualResources(IProject project) {
- IVirtualComponent virtualComponent = ComponentCore.createComponent(project);
-
- if (virtualComponent == null) {
- return EmptyIterator.instance();
- }
-
- return new TreeIterator<IVirtualResource>(virtualComponent.getRootFolder()) {
- @Override
- protected Iterator<? extends IVirtualResource> children(IVirtualResource next) {
- if (next.getType() == IVirtualResource.FOLDER) {
- try {
- return CollectionTools.iterator(((IVirtualFolder) next).members());
- }
- catch (CoreException ce) { /* fall through, return default case */ }
- }
- return EmptyIterator.instance();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java
deleted file mode 100644
index 65e0176227..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/emfutility/DOMUtilities.java
+++ /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
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.emfutility;
-
-import org.w3c.dom.Node;
-
-public class DOMUtilities
- extends org.eclipse.wst.common.internal.emf.utilities.DOMUtilities
-{
- /**
- * Get the attribute Node with the specified name
- */
- static public Node getChildAttributeNode(Node node, String attributeName) {
- return node.getAttributes().getNamedItem(attributeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
deleted file mode 100644
index ba468d5b45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.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.core.internal.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JpaFacetDataModelProperties extends IDataModelProperties
-{
- /**
- * Required, type String, identifies Jpa Platform
- */
- public static final String PLATFORM_ID = "IJpaFacetDataModelProperties.PLATFORM_ID";
-
- /**
- * Not required, type String, identifies database connection
- */
- public static final String CONNECTION = "IJpaFacetDataModelProperties.CONNECTION";
-
- /**
- * Internal, type IRuntime, identifies runtime associated with project
- * Used only in conjunction with validation of other properties, because this information
- * is otherwise inaccessible to this data model
- */
- public static final String RUNTIME = "IJpaFacetDataModelProperties.RUNTIME";
-
- /**
- * Required, type boolean, identifies whether server runtime provides
- * JPA implementation
- * If this is true, then the property JPA_LIBRARY is not used
- */
- public static final String USE_SERVER_JPA_IMPLEMENTATION = "IJpaFacetDataModelProperties.USE_SERVER_JPA_IMPLEMENTATION";
-
- /**
- * Not required, type String, identifies JPA implementation library.
- * Only used if the property USE_SERVER_JPA_IMPLEMENTATION is false.
- */
- public static final String JPA_LIBRARY = "IJpaFacetDataModelProperties.JPA_LIBRARY";
-
- /**
- * Required, type boolean, identifies whether all annotated classes are to be automatically
- * included as part of all persistence units
- */
- public static final String DISCOVER_ANNOTATED_CLASSES = "IJpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES";
-
- /**
- * Required, type boolean, details whether orm.xml should be created
- */
- public static final String CREATE_ORM_XML = "IJpaFacetDataModelProperties.CREATE_ORM_XML";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
deleted file mode 100644
index 33fdf7527c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
+++ /dev/null
@@ -1,208 +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.internal.facet;
-
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.prefs.JpaPreferenceConstants;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public class JpaFacetDataModelProvider
- extends FacetInstallDataModelProvider
- implements JpaFacetDataModelProperties
-{
- private static final String EJB_FACET_ID = IModuleConstants.JST_EJB_MODULE;
-
- private static final String RUNTIME_NONE = WTPCommonPlugin.getResourceString(org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages.RUNTIME_NONE, null);
-
- private static final IStatus PLATFORM_NOT_SPECIFIED_STATUS = buildErrorStatus(JptCoreMessages.VALIDATE_PLATFORM_NOT_SPECIFIED);
- private static final IStatus CONNECTION_NOT_CONNECTED_STATUS = buildInfoStatus(JptCoreMessages.VALIDATE_CONNECTION_NOT_CONNECTED);
- private static final IStatus RUNTIME_NOT_SPECIFIED_STATUS = buildWarningStatus(JptCoreMessages.VALIDATE_RUNTIME_NOT_SPECIFIED);
- private static final IStatus RUNTIME_DOES_NOT_SUPPORT_EJB_30_STATUS = buildWarningStatus(JptCoreMessages.VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30);
- private static final IStatus LIBRARY_NOT_SPECIFIED_STATUS = buildWarningStatus(JptCoreMessages.VALIDATE_LIBRARY_NOT_SPECIFIED);
-
- /**
- * required default constructor
- */
- public JpaFacetDataModelProvider() {
- super();
- }
-
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked")
- Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(PLATFORM_ID);
- propertyNames.add(CONNECTION);
- propertyNames.add(RUNTIME);
- propertyNames.add(USE_SERVER_JPA_IMPLEMENTATION);
- propertyNames.add(JPA_LIBRARY);
- propertyNames.add(DISCOVER_ANNOTATED_CLASSES);
- propertyNames.add(CREATE_ORM_XML);
- return propertyNames;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JptCorePlugin.FACET_ID;
- }
- if (propertyName.equals(PLATFORM_ID)) {
- return GenericJpaPlatform.ID;
- }
- if (propertyName.equals(CONNECTION)) {
- return "";
- }
- if (propertyName.equals(RUNTIME)) {
- return null;
- }
- if (propertyName.equals(USE_SERVER_JPA_IMPLEMENTATION)) {
- return this.runtimeSupportsEjb30(this.runtime());
- }
- if (propertyName.equals(JPA_LIBRARY)) {
- return JptCorePlugin.instance().getPluginPreferences().getString(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB);
- }
- if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return runtimeSupportsEjb30(this.runtime());
- }
- if (propertyName.equals(CREATE_ORM_XML)) {
- return Boolean.TRUE;
- }
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(RUNTIME)) {
- this.model.notifyPropertyChange(USE_SERVER_JPA_IMPLEMENTATION, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(DISCOVER_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG);
- }
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(JPA_LIBRARY)) {
- String[] libraries = CollectionTools.sort(JavaCore.getUserLibraryNames());
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[libraries.length + 1];
- descriptors[0] = new DataModelPropertyDescriptor("", RUNTIME_NONE);
-
- int i = 1;
- for (String library : libraries) {
- descriptors[i++] = new DataModelPropertyDescriptor(library, library);
- }
- return descriptors;
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- @Override
- public IStatus validate(String name) {
- if (name.equals(PLATFORM_ID)) {
- return this.validatePlatformId(this.getStringProperty(name));
- }
- if (name.equals(CONNECTION)) {
- return this.validateConnectionName(this.getStringProperty(name));
- }
- if (name.equals(USE_SERVER_JPA_IMPLEMENTATION)) {
- return this.validateJpaLibrary(this.getBooleanProperty(name));
- }
- if (name.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return this.validatePersistentClassManagement(this.getBooleanProperty(name));
- }
- return super.validate(name);
- }
-
- private IRuntime runtime() {
- return (IRuntime) this.getProperty(RUNTIME);
- }
-
- private boolean runtimeSupportsEjb30(IRuntime runtime) {
- IProjectFacetVersion ejb30 = ProjectFacetsManager.getProjectFacet(EJB_FACET_ID).getVersion("3.0");
- return (runtime == null) ? false : runtime.supports(ejb30);
- }
-
-
- // ********** validation **********
-
- private IStatus validatePlatformId(String platformId) {
- return StringTools.stringIsEmpty(platformId) ?
- PLATFORM_NOT_SPECIFIED_STATUS
- :
- OK_STATUS;
- }
-
- private IStatus validateConnectionName(String connectionName) {
- return ConnectionProfileRepository.instance().profileNamed(connectionName).isConnected() ?
- OK_STATUS
- :
- CONNECTION_NOT_CONNECTED_STATUS;
- }
-
- private IStatus validateJpaLibrary(boolean useServerJpaImplementation) {
- if (useServerJpaImplementation) {
- IRuntime runtime = this.runtime();
- if (runtime == null) {
- return RUNTIME_NOT_SPECIFIED_STATUS;
- }
- if ( ! this.runtimeSupportsEjb30(runtime)) {
- return RUNTIME_DOES_NOT_SUPPORT_EJB_30_STATUS;
- }
- } else {
- if (StringTools.stringIsEmpty(this.getStringProperty(JPA_LIBRARY))) {
- return LIBRARY_NOT_SPECIFIED_STATUS;
- }
- }
- return OK_STATUS;
- }
-
- private IStatus validatePersistentClassManagement(boolean discoverAnnotatedClasses) {
- // TODO warning if "discovery" is used, but no runtime specified ??
- return OK_STATUS;
- }
-
-
- // ********** static methods **********
-
- private static IStatus buildInfoStatus(String message) {
- return buildStatus(IStatus.INFO, message);
- }
-
- private static IStatus buildWarningStatus(String message) {
- return buildStatus(IStatus.WARNING, message);
- }
-
- private static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- private static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptCorePlugin.PLUGIN_ID, message);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
deleted file mode 100644
index 15705541c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
+++ /dev/null
@@ -1,126 +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.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
-import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * We don't really "install" the JPA facet here. We simply store all the various
- * data model properties in the appropriate preferences. These settings will
- * used in the POST_INSTALL event listener to build the JPA project.
- */
-public class JpaFacetInstallDelegate
- implements IDelegate, JpaFacetDataModelProperties
-{
-
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
- monitor = this.nonNullMonitor(monitor);
- try {
- this.execute_(project, fv, config, monitor);
- } finally {
- monitor.done();
- }
- }
-
- private void execute_(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- monitor.beginTask("", 1); //$NON-NLS-1$
-
- // NB: WTP Natures (including the JavaEMFNature)
- // should already be added, as this facet should
- // always coexist with a module facet.
-
- IJavaProject javaProject = JavaCore.create(project);
- IDataModel dataModel = (IDataModel) config;
- this.configureClasspath(javaProject, dataModel, monitor);
-
- JptCorePlugin.setJpaPlatformId(project, dataModel.getStringProperty(PLATFORM_ID));
- JptCorePlugin.setConnectionProfileName(project, dataModel.getStringProperty(CONNECTION));
- JptCorePlugin.setDiscoverAnnotatedClasses(project, dataModel.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES));
-
- monitor.worked(1);
- }
-
- private void configureClasspath(IJavaProject javaProject, IDataModel dataModel, IProgressMonitor monitor) throws CoreException {
- boolean useServerLibrary = dataModel.getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION);
- if (useServerLibrary) {
- return;
- }
-
- String jpaLibrary = dataModel.getStringProperty(JPA_LIBRARY);
- if (StringTools.stringIsEmpty(jpaLibrary)) {
- return;
- }
-
- // build the JPA library to be added to the classpath
- IClasspathAttribute[] attributes = this.buildClasspathAttributes(javaProject.getProject());
- IClasspathEntry jpaLibraryEntry =
- JavaCore.newContainerEntry(
- new Path(JavaCore.USER_LIBRARY_CONTAINER_ID + "/" + jpaLibrary),
- null, attributes, true
- );
-
- // if the JPA library is already there, do nothing
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- if (CollectionTools.contains(classpath, jpaLibraryEntry)) {
- return;
- }
-
- // add the JPA library to the classpath
- int len = classpath.length;
- IClasspathEntry[] newClasspath = new IClasspathEntry[len + 1];
- System.arraycopy(classpath, 0, newClasspath, 0, len);
- newClasspath[len] = jpaLibraryEntry;
- javaProject.setRawClasspath(newClasspath, monitor);
- }
-
- private static final IClasspathAttribute[] EMPTY_CLASSPATH_ATTRIBUTES = new IClasspathAttribute[0];
-
- private IClasspathAttribute[] buildClasspathAttributes(IProject project) {
- boolean webApp = JptCorePlugin.projectHasWebFacet(project);
- if ( ! webApp && this.projectIsStandalone(project)) {
- return EMPTY_CLASSPATH_ATTRIBUTES;
- }
- return new IClasspathAttribute[] {
- JavaCore.newClasspathAttribute(
- IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
- ClasspathDependencyUtil.getDefaultRuntimePath(webApp).toString()
- )
- };
- }
-
- private boolean projectIsStandalone(IProject project) {
- return J2EEProjectUtilities.isStandaloneProject(project);
- }
-
- private IProgressMonitor nonNullMonitor(IProgressMonitor monitor) {
- return (monitor != null) ? monitor : new NullProgressMonitor();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
deleted file mode 100644
index acdfa2dff5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.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.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JpaFacetUninstallDelegate
- implements IDelegate
-{
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- // There is nothing to do here. Everything is taken care of by the
- // JpaModelManager *whenever* the facet is removed (even via meta-file
- // editing and CVS updating), but this delegate needs to be here because
- // it is required by the facet extension point action element, and that
- // is required by the facet UI to allow uninstallation of this facet.
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeSearchUtil.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeSearchUtil.java
deleted file mode 100644
index 4fd236c212..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeSearchUtil.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.core.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.ClassInstanceCreation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-
-//copied from org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil
-//deleted code to limit the number of classes I had to copy
-public class ASTNodeSearchUtil {
-
- private ASTNodeSearchUtil() {
- //no instance
- }
-
-
- public static MethodDeclaration getMethodDeclarationNode(IMethod iMethod, CompilationUnit cuNode) throws JavaModelException {
- return (MethodDeclaration)ASTNodes.getParent(getNameNode(iMethod, cuNode), MethodDeclaration.class);
- }
-
- public static ASTNode getParent(ASTNode node, Class<?> parentClass) {
- do {
- node= node.getParent();
- } while (node != null && !parentClass.isInstance(node));
- return node;
- }
-
-
- public static AnnotationTypeMemberDeclaration getAnnotationTypeMemberDeclarationNode(IMethod iMethod, CompilationUnit cuNode) throws JavaModelException {
- return (AnnotationTypeMemberDeclaration) ASTNodes.getParent(getNameNode(iMethod, cuNode), AnnotationTypeMemberDeclaration.class);
- }
-
- public static VariableDeclarationFragment getFieldDeclarationFragmentNode(IField iField, CompilationUnit cuNode) throws JavaModelException {
- ASTNode node= getNameNode(iField, cuNode);
- if (node instanceof VariableDeclarationFragment)
- return (VariableDeclarationFragment)node;
- return (VariableDeclarationFragment)ASTNodes.getParent(node, VariableDeclarationFragment.class);
- }
-
- public static FieldDeclaration getFieldDeclarationNode(IField iField, CompilationUnit cuNode) throws JavaModelException {
- return (FieldDeclaration) ASTNodes.getParent(getNameNode(iField, cuNode), FieldDeclaration.class);
- }
-
- public static EnumConstantDeclaration getEnumConstantDeclaration(IField iField, CompilationUnit cuNode) throws JavaModelException {
- return (EnumConstantDeclaration) ASTNodes.getParent(getNameNode(iField, cuNode), EnumConstantDeclaration.class);
- }
-
- public static EnumDeclaration getEnumDeclarationNode(IType iType, CompilationUnit cuNode) throws JavaModelException {
- return (EnumDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), EnumDeclaration.class);
- }
-
- public static AnnotationTypeDeclaration getAnnotationTypeDeclarationNode(IType iType, CompilationUnit cuNode) throws JavaModelException {
- return (AnnotationTypeDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), AnnotationTypeDeclaration.class);
- }
-
- public static BodyDeclaration getBodyDeclarationNode(IMember iMember, CompilationUnit cuNode) throws JavaModelException {
- return (BodyDeclaration) ASTNodes.getParent(getNameNode(iMember, cuNode), BodyDeclaration.class);
- }
-
- public static AbstractTypeDeclaration getAbstractTypeDeclarationNode(IType iType, CompilationUnit cuNode) throws JavaModelException {
- return (AbstractTypeDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), AbstractTypeDeclaration.class);
- }
-
- public static TypeDeclaration getTypeDeclarationNode(IType iType, CompilationUnit cuNode) throws JavaModelException {
- return (TypeDeclaration) ASTNodes.getParent(getNameNode(iType, cuNode), TypeDeclaration.class);
- }
-
- public static ClassInstanceCreation getClassInstanceCreationNode(IType iType, CompilationUnit cuNode) throws JavaModelException {
- return (ClassInstanceCreation) ASTNodes.getParent(getNameNode(iType, cuNode), ClassInstanceCreation.class);
- }
-
- @SuppressWarnings("unchecked")
- public static List<BodyDeclaration> getBodyDeclarationList(IType iType, CompilationUnit cuNode) throws JavaModelException {
- if (iType.isAnonymous())
- return getClassInstanceCreationNode(iType, cuNode).getAnonymousClassDeclaration().bodyDeclarations();
- return getAbstractTypeDeclarationNode(iType, cuNode).bodyDeclarations();
- }
-
- private static ASTNode getNameNode(IMember iMember, CompilationUnit cuNode) throws JavaModelException {
- return NodeFinder.perform(cuNode, iMember.getNameRange());
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.java
deleted file mode 100644
index fda6200078..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodeTextRange.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Straightforward implementation of ITextRange that adapts an ASTNode.
- */
-public class ASTNodeTextRange implements TextRange {
- private final ASTNode astNode;
-
- public ASTNodeTextRange(ASTNode astNode) {
- super();
- this.astNode = astNode;
- }
-
- public int getOffset() {
- return this.astNode.getStartPosition();
- }
-
- public int getLength() {
- return this.astNode.getLength();
- }
-
- public int getLineNumber() {
- return ((CompilationUnit) this.astNode.getRoot()).getLineNumber(this.getOffset());
- }
-
- public boolean includes(int index) {
- return (this.getOffset() <= index) && (index < this.end());
- }
-
- public boolean touches(int index) {
- return this.includes(index) || (index == this.end());
- }
-
- /**
- * The end offset is "exclusive", i.e. the element at the end offset
- * is not included in the range.
- */
- private int end() {
- return this.getOffset() + this.getLength();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == this.getOffset())
- && (r.getLength() == this.getLength());
- }
-
- @Override
- public int hashCode() {
- return this.getOffset() ^ this.getLength();
- }
-
- @Override
- public String toString() {
- String start = String.valueOf(this.getOffset());
- String end = String.valueOf(this.getOffset() + this.getLength() - 1);
- return StringTools.buildToStringFor(this, start + ", " + end);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodes.java
deleted file mode 100644
index ce49d2ae54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ASTNodes.java
+++ /dev/null
@@ -1,726 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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
- * Dmitry Stalnov (dstalnov@fusionone.com) - contributed fix for
- * bug "inline method - doesn't handle implicit cast" (see
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=24941).
- * Dmitry Stalnov (dstalnov@fusionone.com) - contributed fix for
- * bug Encapsulate field can fail when two variables in one variable declaration (see
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=51540).
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.ISourceReference;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.jdt.core.dom.ArrayType;
-import org.eclipse.jdt.core.dom.Assignment;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor;
-import org.eclipse.jdt.core.dom.ClassInstanceCreation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.DoStatement;
-import org.eclipse.jdt.core.dom.EnhancedForStatement;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ForStatement;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.IfStatement;
-import org.eclipse.jdt.core.dom.InfixExpression;
-import org.eclipse.jdt.core.dom.Message;
-import org.eclipse.jdt.core.dom.MethodInvocation;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.ParameterizedType;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.QualifiedType;
-import org.eclipse.jdt.core.dom.ReturnStatement;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor;
-import org.eclipse.jdt.core.dom.Type;
-import org.eclipse.jdt.core.dom.VariableDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jdt.core.dom.WhileStatement;
-
-
-//copied from org.eclipse.jdt.internal.corext.dom.ASTNodes
-//deleted code to limit the number of classes I had to copy
-public class ASTNodes {
-
- public static final int NODE_ONLY= 0;
- public static final int INCLUDE_FIRST_PARENT= 1;
- public static final int INCLUDE_ALL_PARENTS= 2;
-
- public static final int WARNING= 1 << 0;
- public static final int ERROR= 1 << 1;
- public static final int PROBLEMS= WARNING | ERROR;
-
- private static final Message[] EMPTY_MESSAGES= new Message[0];
- private static final IProblem[] EMPTY_PROBLEMS= new IProblem[0];
-
- private static final int CLEAR_VISIBILITY= ~(Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE);
-
-
- private ASTNodes() {
- // no instance;
- }
-
- /**
- * Returns the list that contains the given ASTNode. If the node
- * isn't part of any list, <code>null</code> is returned.
- *
- * @param node the node in question
- * @return the list that contains the node or <code>null</code>
- */
- @SuppressWarnings("unchecked")
- public static List<ASTNode> getContainingList(ASTNode node) {
- StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
- if (locationInParent != null && locationInParent.isChildListProperty()) {
- return (List<ASTNode>) node.getParent().getStructuralProperty(locationInParent);
- }
- return null;
- }
-
- /**
- * Returns a list of the direct children of a node. The siblings are ordered by start offset.
- * @param node the node to get the children for
- * @return the children
- */
- public static List<ASTNode> getChildren(ASTNode node) {
- ChildrenCollector visitor= new ChildrenCollector();
- node.accept(visitor);
- return visitor.result;
- }
-
- private static class ChildrenCollector extends GenericVisitor {
- public List<ASTNode> result;
-
- public ChildrenCollector() {
- super(true);
- result= null;
- }
- @Override
- protected boolean visitNode(ASTNode node) {
- if (result == null) { // first visitNode: on the node's parent: do nothing, return true
- result= new ArrayList<ASTNode>();
- return true;
- }
- result.add(node);
- return false;
- }
- }
-
- /**
- * Returns true if this is an existing node, i.e. it was created as part of
- * a parsing process of a source code file. Returns false if this is a newly
- * created node which has not yet been given a source position.
- *
- * @param node the node to be tested.
- * @return true if this is an existing node, false if not.
- */
- public static boolean isExistingNode(ASTNode node) {
- return node.getStartPosition() != -1;
- }
-
- /**
- * Returns the element type. This is a convenience method that returns its
- * argument if it is a simple type and the element type if the parameter is an array type.
- * @param type The type to get the element type from.
- * @return The element type of the type or the type itself.
- */
- public static Type getElementType(Type type) {
- if (! type.isArrayType())
- return type;
- return ((ArrayType)type).getElementType();
- }
-
- public static ASTNode findDeclaration(IBinding binding, ASTNode root) {
- root= root.getRoot();
- if (root instanceof CompilationUnit) {
- return ((CompilationUnit)root).findDeclaringNode(binding);
- }
- return null;
- }
-
- public static VariableDeclaration findVariableDeclaration(IVariableBinding binding, ASTNode root) {
- if (binding.isField())
- return null;
- ASTNode result= findDeclaration(binding, root);
- if (result instanceof VariableDeclaration)
- return (VariableDeclaration)result;
-
- return null;
- }
-
- /**
- * Returns the type node for the given declaration.
- * @param declaration the declaration
- * @return the type node
- */
- public static Type getType(VariableDeclaration declaration) {
- if (declaration instanceof SingleVariableDeclaration) {
- return ((SingleVariableDeclaration)declaration).getType();
- } else if (declaration instanceof VariableDeclarationFragment) {
- ASTNode parent= ((VariableDeclarationFragment)declaration).getParent();
- if (parent instanceof VariableDeclarationExpression)
- return ((VariableDeclarationExpression)parent).getType();
- else if (parent instanceof VariableDeclarationStatement)
- return ((VariableDeclarationStatement)parent).getType();
- else if (parent instanceof FieldDeclaration)
- return ((FieldDeclaration)parent).getType();
- }
- Assert.isTrue(false, "Unknown VariableDeclaration"); //$NON-NLS-1$
- return null;
- }
-
- public static int getDimensions(VariableDeclaration declaration) {
- int dim= declaration.getExtraDimensions();
- Type type= getType(declaration);
- if (type instanceof ArrayType) {
- dim += ((ArrayType) type).getDimensions();
- }
- return dim;
- }
-
- @SuppressWarnings("unchecked")
- public static List<IExtendedModifier> getModifiers(VariableDeclaration declaration) {
- Assert.isNotNull(declaration);
- if (declaration instanceof SingleVariableDeclaration) {
- return ((SingleVariableDeclaration)declaration).modifiers();
- } else if (declaration instanceof VariableDeclarationFragment) {
- ASTNode parent= declaration.getParent();
- if (parent instanceof VariableDeclarationExpression)
- return ((VariableDeclarationExpression)parent).modifiers();
- else if (parent instanceof VariableDeclarationStatement)
- return ((VariableDeclarationStatement)parent).modifiers();
- }
- return new ArrayList<IExtendedModifier>(0);
- }
-
- public static boolean isSingleDeclaration(VariableDeclaration declaration) {
- Assert.isNotNull(declaration);
- if (declaration instanceof SingleVariableDeclaration) {
- return true;
- } else if (declaration instanceof VariableDeclarationFragment) {
- ASTNode parent= declaration.getParent();
- if (parent instanceof VariableDeclarationExpression)
- return ((VariableDeclarationExpression)parent).fragments().size() == 1;
- else if (parent instanceof VariableDeclarationStatement)
- return ((VariableDeclarationStatement)parent).fragments().size() == 1;
- }
- return false;
- }
-
- public static boolean isLiteral(Expression expression) {
- int type= expression.getNodeType();
- return type == ASTNode.BOOLEAN_LITERAL || type == ASTNode.CHARACTER_LITERAL || type == ASTNode.NULL_LITERAL ||
- type == ASTNode.NUMBER_LITERAL || type == ASTNode.STRING_LITERAL || type == ASTNode.TYPE_LITERAL;
- }
-
- public static boolean isLabel(SimpleName name) {
- int parentType= name.getParent().getNodeType();
- return parentType == ASTNode.LABELED_STATEMENT ||
- parentType == ASTNode.BREAK_STATEMENT || parentType != ASTNode.CONTINUE_STATEMENT;
- }
-
- public static boolean isStatic(BodyDeclaration declaration) {
- return Modifier.isStatic(declaration.getModifiers());
- }
-
- @SuppressWarnings("unchecked")
- public static List<BodyDeclaration> getBodyDeclarations(ASTNode node) {
- if (node instanceof AbstractTypeDeclaration) {
- return ((AbstractTypeDeclaration)node).bodyDeclarations();
- } else if (node instanceof AnonymousClassDeclaration) {
- return ((AnonymousClassDeclaration)node).bodyDeclarations();
- }
- // should not happen.
- Assert.isTrue(false);
- return null;
- }
-
- public static ChildListPropertyDescriptor getBodyDeclarationsProperty(ASTNode node) {
- if (node instanceof AbstractTypeDeclaration) {
- return ((AbstractTypeDeclaration)node).getBodyDeclarationsProperty();
- } else if (node instanceof AnonymousClassDeclaration) {
- return AnonymousClassDeclaration.BODY_DECLARATIONS_PROPERTY;
- }
- // should not happen.
- Assert.isTrue(false);
- return null;
- }
-
- public static String getTypeName(Type type) {
- final StringBuffer buffer= new StringBuffer();
- ASTVisitor visitor= new ASTVisitor() {
- @Override
- public boolean visit(PrimitiveType node) {
- buffer.append(node.getPrimitiveTypeCode().toString());
- return false;
- }
- @Override
- public boolean visit(SimpleName node) {
- buffer.append(node.getIdentifier());
- return false;
- }
- @Override
- public boolean visit(QualifiedName node) {
- buffer.append(node.getName().getIdentifier());
- return false;
- }
- @Override
- public void endVisit(ArrayType node) {
- buffer.append("[]"); //$NON-NLS-1$
- }
- };
- type.accept(visitor);
- return buffer.toString();
- }
-
- public static InfixExpression.Operator convertToInfixOperator(Assignment.Operator operator) {
- if (operator.equals(Assignment.Operator.PLUS_ASSIGN))
- return InfixExpression.Operator.PLUS;
-
- if (operator.equals(Assignment.Operator.MINUS_ASSIGN))
- return InfixExpression.Operator.MINUS;
-
- if (operator.equals(Assignment.Operator.TIMES_ASSIGN))
- return InfixExpression.Operator.TIMES;
-
- if (operator.equals(Assignment.Operator.DIVIDE_ASSIGN))
- return InfixExpression.Operator.DIVIDE;
-
- if (operator.equals(Assignment.Operator.BIT_AND_ASSIGN))
- return InfixExpression.Operator.AND;
-
- if (operator.equals(Assignment.Operator.BIT_OR_ASSIGN))
- return InfixExpression.Operator.OR;
-
- if (operator.equals(Assignment.Operator.BIT_XOR_ASSIGN))
- return InfixExpression.Operator.XOR;
-
- if (operator.equals(Assignment.Operator.REMAINDER_ASSIGN))
- return InfixExpression.Operator.REMAINDER;
-
- if (operator.equals(Assignment.Operator.LEFT_SHIFT_ASSIGN))
- return InfixExpression.Operator.LEFT_SHIFT;
-
- if (operator.equals(Assignment.Operator.RIGHT_SHIFT_SIGNED_ASSIGN))
- return InfixExpression.Operator.RIGHT_SHIFT_SIGNED;
-
- if (operator.equals(Assignment.Operator.RIGHT_SHIFT_UNSIGNED_ASSIGN))
- return InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED;
-
- Assert.isTrue(false, "Cannot convert assignment operator"); //$NON-NLS-1$
- return null;
- }
-
- /**
- * Returns true if a node at a given location is a body of a control statement. Such body nodes are
- * interesting as when replacing them, it has to be evaluates if a Block is needed instead.
- * E.g. <code> if (x) do(); -> if (x) { do1(); do2() } </code>
- *
- * @param locationInParent Location of the body node
- * @return Returns true if the location is a body node location of a control statement.
- */
- public static boolean isControlStatementBody(StructuralPropertyDescriptor locationInParent) {
- return locationInParent == IfStatement.THEN_STATEMENT_PROPERTY
- || locationInParent == IfStatement.ELSE_STATEMENT_PROPERTY
- || locationInParent == ForStatement.BODY_PROPERTY
- || locationInParent == EnhancedForStatement.BODY_PROPERTY
- || locationInParent == WhileStatement.BODY_PROPERTY
- || locationInParent == DoStatement.BODY_PROPERTY;
- }
-
- public static boolean needsParentheses(Expression expression) {
- int type= expression.getNodeType();
- return type == ASTNode.INFIX_EXPRESSION || type == ASTNode.CONDITIONAL_EXPRESSION ||
- type == ASTNode.PREFIX_EXPRESSION || type == ASTNode.POSTFIX_EXPRESSION ||
- type == ASTNode.CAST_EXPRESSION || type == ASTNode.INSTANCEOF_EXPRESSION;
- }
-
-
- public static boolean substituteMustBeParenthesized(Expression substitute, Expression location) {
- if (!needsParentheses(substitute))
- return false;
-
- ASTNode parent= location.getParent();
- if (parent instanceof VariableDeclarationFragment){
- VariableDeclarationFragment vdf= (VariableDeclarationFragment)parent;
- if (vdf.getInitializer().equals(location))
- return false;
- } else if (parent instanceof MethodInvocation){
- MethodInvocation mi= (MethodInvocation)parent;
- if (mi.arguments().contains(location))
- return false;
- } else if (parent instanceof ReturnStatement)
- return false;
-
- return true;
- }
-
- public static ASTNode getParent(ASTNode node, Class<? extends ASTNode> parentClass) {
- do {
- node= node.getParent();
- } while (node != null && !parentClass.isInstance(node));
- return node;
- }
-
- public static ASTNode getParent(ASTNode node, int nodeType) {
- do {
- node= node.getParent();
- } while (node != null && node.getNodeType() != nodeType);
- return node;
- }
-
- public static ASTNode findParent(ASTNode node, StructuralPropertyDescriptor[][] pathes) {
- for (int p= 0; p < pathes.length; p++) {
- StructuralPropertyDescriptor[] path= pathes[p];
- ASTNode current= node;
- int d= path.length - 1;
- for (; d >= 0 && current != null; d--) {
- StructuralPropertyDescriptor descriptor= path[d];
- if (!descriptor.equals(current.getLocationInParent()))
- break;
- current= current.getParent();
- }
- if (d < 0)
- return current;
- }
- return null;
- }
-
- public static ASTNode getNormalizedNode(ASTNode node) {
- ASTNode current= node;
- // normalize name
- if (QualifiedName.NAME_PROPERTY.equals(current.getLocationInParent())) {
- current= current.getParent();
- }
- // normalize type
- if (QualifiedType.NAME_PROPERTY.equals(current.getLocationInParent()) ||
- SimpleType.NAME_PROPERTY.equals(current.getLocationInParent())) {
- current= current.getParent();
- }
- // normalize parameterized types
- if (ParameterizedType.TYPE_PROPERTY.equals(current.getLocationInParent())) {
- current= current.getParent();
- }
- return current;
- }
-
- public static boolean isParent(ASTNode node, ASTNode parent) {
- Assert.isNotNull(parent);
- do {
- node= node.getParent();
- if (node == parent)
- return true;
- } while (node != null);
- return false;
- }
-
- public static int getExclusiveEnd(ASTNode node){
- return node.getStartPosition() + node.getLength();
- }
-
- public static int getInclusiveEnd(ASTNode node){
- return node.getStartPosition() + node.getLength() - 1;
- }
-
- public static IMethodBinding getMethodBinding(Name node) {
- IBinding binding= node.resolveBinding();
- if (binding instanceof IMethodBinding)
- return (IMethodBinding)binding;
- return null;
- }
-
- public static IVariableBinding getVariableBinding(Name node) {
- IBinding binding= node.resolveBinding();
- if (binding instanceof IVariableBinding)
- return (IVariableBinding)binding;
- return null;
- }
-
- public static IVariableBinding getLocalVariableBinding(Name node) {
- IVariableBinding result= getVariableBinding(node);
- if (result == null || result.isField())
- return null;
-
- return result;
- }
-
- public static IVariableBinding getFieldBinding(Name node) {
- IVariableBinding result= getVariableBinding(node);
- if (result == null || !result.isField())
- return null;
-
- return result;
- }
-
- public static ITypeBinding getTypeBinding(Name node) {
- IBinding binding= node.resolveBinding();
- if (binding instanceof ITypeBinding)
- return (ITypeBinding)binding;
- return null;
- }
-
- /**
- * Returns the receiver's type binding of the given method invocation.
- *
- * @param invocation method invocation to resolve type of
- * @return the type binding of the receiver
- */
- public static ITypeBinding getReceiverTypeBinding(MethodInvocation invocation) {
- ITypeBinding result= null;
- Expression exp= invocation.getExpression();
- if(exp != null) {
- return exp.resolveTypeBinding();
- }
- AbstractTypeDeclaration type= (AbstractTypeDeclaration)getParent(invocation, AbstractTypeDeclaration.class);
- if (type != null)
- return type.resolveBinding();
- return result;
- }
-
- public static ITypeBinding getEnclosingType(ASTNode node) {
- while(node != null) {
- if (node instanceof AbstractTypeDeclaration) {
- return ((AbstractTypeDeclaration)node).resolveBinding();
- } else if (node instanceof AnonymousClassDeclaration) {
- return ((AnonymousClassDeclaration)node).resolveBinding();
- }
- node= node.getParent();
- }
- return null;
- }
-
- public static IProblem[] getProblems(ASTNode node, int scope, int severity) {
- ASTNode root= node.getRoot();
- if (!(root instanceof CompilationUnit))
- return EMPTY_PROBLEMS;
- IProblem[] problems= ((CompilationUnit)root).getProblems();
- if (root == node)
- return problems;
- final int iterations= computeIterations(scope);
- List<IProblem> result= new ArrayList<IProblem>(5);
- for (int i= 0; i < problems.length; i++) {
- IProblem problem= problems[i];
- boolean consider= false;
- if ((severity & PROBLEMS) == PROBLEMS)
- consider= true;
- else if ((severity & WARNING) != 0)
- consider= problem.isWarning();
- else if ((severity & ERROR) != 0)
- consider= problem.isError();
- if (consider) {
- ASTNode temp= node;
- int count= iterations;
- do {
- int nodeOffset= temp.getStartPosition();
- int problemOffset= problem.getSourceStart();
- if (nodeOffset <= problemOffset && problemOffset < nodeOffset + temp.getLength()) {
- result.add(problem);
- count= 0;
- } else {
- count--;
- }
- } while ((temp= temp.getParent()) != null && count > 0);
- }
- }
- return result.toArray(new IProblem[result.size()]);
- }
-
- public static Message[] getMessages(ASTNode node, int flags) {
- ASTNode root= node.getRoot();
- if (!(root instanceof CompilationUnit))
- return EMPTY_MESSAGES;
- Message[] messages= ((CompilationUnit)root).getMessages();
- if (root == node)
- return messages;
- final int iterations= computeIterations(flags);
- List<Message> result= new ArrayList<Message>(5);
- for (int i= 0; i < messages.length; i++) {
- Message message= messages[i];
- ASTNode temp= node;
- int count= iterations;
- do {
- int nodeOffset= temp.getStartPosition();
- int messageOffset= message.getStartPosition();
- if (nodeOffset <= messageOffset && messageOffset < nodeOffset + temp.getLength()) {
- result.add(message);
- count= 0;
- } else {
- count--;
- }
- } while ((temp= temp.getParent()) != null && count > 0);
- }
- return result.toArray(new Message[result.size()]);
- }
-
- private static int computeIterations(int flags) {
- switch (flags) {
- case NODE_ONLY:
- return 1;
- case INCLUDE_ALL_PARENTS:
- return Integer.MAX_VALUE;
- case INCLUDE_FIRST_PARENT:
- return 2;
- default:
- return 1;
- }
- }
-
- public static SimpleName getLeftMostSimpleName(Name name) {
- if (name instanceof SimpleName) {
- return (SimpleName)name;
- }
- final SimpleName[] result= new SimpleName[1];
- ASTVisitor visitor= new ASTVisitor() {
- @Override
- public boolean visit(QualifiedName qualifiedName) {
- Name left= qualifiedName.getQualifier();
- if (left instanceof SimpleName)
- result[0]= (SimpleName)left;
- else
- left.accept(this);
- return false;
- }
- };
- name.accept(visitor);
- return result[0];
- }
-
- public static SimpleType getLeftMostSimpleType(QualifiedType type) {
- final SimpleType[] result= new SimpleType[1];
- ASTVisitor visitor= new ASTVisitor() {
- @Override
- public boolean visit(QualifiedType qualifiedType) {
- Type left= qualifiedType.getQualifier();
- if (left instanceof SimpleType)
- result[0]= (SimpleType)left;
- else
- left.accept(this);
- return false;
- }
- };
- type.accept(visitor);
- return result[0];
- }
-
- public static Name getTopMostName(Name name) {
- Name result= name;
- while(result.getParent() instanceof Name) {
- result= (Name)result.getParent();
- }
- return result;
- }
-
- public static Type getTopMostType(Type type) {
- Type result= type;
- while(result.getParent() instanceof Type) {
- result= (Type)result.getParent();
- }
- return result;
- }
-
- public static int changeVisibility(int modifiers, int visibility) {
- return (modifiers & CLEAR_VISIBILITY) | visibility;
- }
-
- /**
- * Adds flags to the given node and all its descendants.
- * @param root The root node
- * @param flags The flags to set
- */
- public static void setFlagsToAST(ASTNode root, final int flags) {
- root.accept(new GenericVisitor(true) {
- @Override
- protected boolean visitNode(ASTNode node) {
- node.setFlags(node.getFlags() | flags);
- return true;
- }
- });
- }
-
- public static String getQualifier(Name name) {
- if (name.isQualifiedName()) {
- return ((QualifiedName) name).getQualifier().getFullyQualifiedName();
- }
- return ""; //$NON-NLS-1$
- }
-
- public static String getSimpleNameIdentifier(Name name) {
- if (name.isQualifiedName()) {
- return ((QualifiedName) name).getName().getIdentifier();
- }
- return ((SimpleName) name).getIdentifier();
- }
-
- public static boolean isDeclaration(Name name) {
- if (name.isQualifiedName()) {
- return ((QualifiedName) name).getName().isDeclaration();
- }
- return ((SimpleName) name).isDeclaration();
- }
-
- public static Modifier findModifierNode(int flag, List<?> modifiers) {
- for (int i= 0; i < modifiers.size(); i++) {
- Object curr= modifiers.get(i);
- if (curr instanceof Modifier && ((Modifier) curr).getKeyword().toFlagValue() == flag) {
- return (Modifier) curr;
- }
- }
- return null;
- }
-
- public static ITypeBinding getTypeBinding(CompilationUnit root, IType type) throws JavaModelException {
- if (type.isAnonymous()) {
- final IJavaElement parent= type.getParent();
- if (parent instanceof IField && Flags.isEnum(((IMember) parent).getFlags())) {
- final EnumConstantDeclaration constant= (EnumConstantDeclaration) NodeFinder.perform(root, ((ISourceReference) parent).getSourceRange());
- if (constant != null) {
- final AnonymousClassDeclaration declaration= constant.getAnonymousClassDeclaration();
- if (declaration != null)
- return declaration.resolveBinding();
- }
- } else {
- final ClassInstanceCreation creation= (ClassInstanceCreation) getParent(NodeFinder.perform(root, type.getNameRange()), ClassInstanceCreation.class);
- if (creation != null)
- return creation.resolveTypeBinding();
- }
- } else {
- final AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) getParent(NodeFinder.perform(root, type.getNameRange()), AbstractTypeDeclaration.class);
- if (declaration != null)
- return declaration.resolveBinding();
- }
- return null;
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.java
deleted file mode 100644
index f2eb31f7cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractAnnotationAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Adapt a member and a declaration annotation adapter.
- */
-public abstract class AbstractAnnotationAdapter implements AnnotationAdapter {
- private final Member member;
- private final DeclarationAnnotationAdapter daa;
-
-
- // ********** constructor **********
-
- public AbstractAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) {
- super();
- this.member = member;
- this.daa = daa;
- }
-
-
- // ********** AnnotationAdapter implementation **********
-
- public Annotation getAnnotation() {
- return this.daa.getAnnotation(this.member.modifiedDeclaration());
- }
-
- public Annotation getAnnotation(CompilationUnit astRoot) {
- return this.daa.getAnnotation(this.member.modifiedDeclaration(astRoot));
- }
-
- public void newMarkerAnnotation() {
- this.edit(this.buildNewMarkerAnnotationEditor());
- }
-
- public void newSingleMemberAnnotation() {
- this.edit(this.buildNewSingleMemberAnnotationEditor());
- }
-
- public void newNormalAnnotation() {
- this.edit(this.buildNewNormalAnnotationEditor());
- }
-
- public void removeAnnotation() {
- this.edit(this.buildRemoveAnnotationEditor());
- }
-
- public ASTNode astNode() {
- return this.daa.astNode(this.member.modifiedDeclaration());
- }
-
- public ASTNode astNode(CompilationUnit astRoot) {
- return this.daa.astNode(this.member.modifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daa);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(Member.Editor editor) {
- this.member.edit(editor);
- }
-
-
- // ********** factory methods **********
-
- protected Member.Editor buildNewMarkerAnnotationEditor() {
- return new NewMarkerAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildNewSingleMemberAnnotationEditor() {
- return new NewSingleMemberAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildNewNormalAnnotationEditor() {
- return new NewNormalAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildRemoveAnnotationEditor() {
- return new RemoveAnnotationEditor(this.daa);
- }
-
-
- // ********** member classes **********
-
- protected static class NewMarkerAnnotationEditor implements Member.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewMarkerAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newMarkerAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class NewSingleMemberAnnotationEditor implements Member.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewSingleMemberAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newSingleMemberAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class NewNormalAnnotationEditor implements Member.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- NewNormalAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.newNormalAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- protected static class RemoveAnnotationEditor implements Member.Editor {
- private final DeclarationAnnotationAdapter daa;
-
- RemoveAnnotationEditor(DeclarationAnnotationAdapter daa) {
- super();
- this.daa = daa;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daa.removeAnnotation(declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java
deleted file mode 100644
index 9fd0f25d9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,148 +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.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- *
- */
-public abstract class AbstractDeclarationAnnotationAdapter implements DeclarationAnnotationAdapter {
- private final String annotationName;
-
-
- // ********** constructors **********
-
- protected AbstractDeclarationAnnotationAdapter(String annotationName) {
- super();
- this.annotationName = annotationName;
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- MarkerAnnotation annotation = this.newMarkerAnnotation(declaration.getAST());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- SingleMemberAnnotation annotation = this.newSingleMemberAnnotation(declaration.getAST());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = this.newNormalAnnotation(declaration.getAST());
- this.addAnnotationAndImport(declaration, annotation);
- return annotation;
- }
-
- /**
- * Add the appropriate import statement, then shorten the annotation's
- * name before adding it to the declaration.
- */
- protected void addAnnotationAndImport(ModifiedDeclaration declaration, Annotation annotation) {
- declaration.addImport(this.annotationName);
- annotation.setTypeName(declaration.getAST().newName(this.shortAnnotationName()));
- this.addAnnotation(declaration, annotation);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.annotationName);
- }
-
-
- // ********** abstract methods **********
-
- public abstract Annotation getAnnotation(ModifiedDeclaration declaration);
-
- public abstract void removeAnnotation(ModifiedDeclaration declaration);
-
- public abstract ASTNode astNode(ModifiedDeclaration declaration);
-
- /**
- * Add the specified annotation to the specified declaration,
- * replacing the original annotation if present.
- */
- protected abstract void addAnnotation(ModifiedDeclaration declaration, Annotation annotation);
-
-
- // ********** public methods **********
-
- public String getAnnotationName() {
- return this.annotationName;
- }
-
-
- // ********** helper methods **********
-
- protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation) {
- return this.nameMatches(declaration, annotation, this.annotationName);
- }
-
- protected boolean nameMatches(ModifiedDeclaration declaration, Annotation annotation, String name) {
- return declaration.annotationIsNamed(annotation, name);
- }
-
- protected MarkerAnnotation newMarkerAnnotation(AST ast) {
- return this.newMarkerAnnotation(ast, this.annotationName);
- }
-
- protected MarkerAnnotation newMarkerAnnotation(AST ast, String name) {
- MarkerAnnotation annotation = ast.newMarkerAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast) {
- return this.newSingleMemberAnnotation(ast, this.annotationName);
- }
-
- protected SingleMemberAnnotation newSingleMemberAnnotation(AST ast, String name) {
- SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected NormalAnnotation newNormalAnnotation(AST ast) {
- return this.newNormalAnnotation(ast, this.annotationName);
- }
-
- protected NormalAnnotation newNormalAnnotation(AST ast, String name) {
- NormalAnnotation annotation = ast.newNormalAnnotation();
- annotation.setTypeName(ast.newName(name));
- return annotation;
- }
-
- protected String shortAnnotationName() {
- return this.shortName(this.annotationName);
- }
-
- protected String shortName(String name) {
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.java
deleted file mode 100644
index 11f4ad34ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Gather together the common implementation behavior.
- * T is the type of the object to be converted to and from an expression.
- *
- * We're still figuring out Java Generics here.... The methods in this abstract
- * class work fine with any subclass of Expression E; but a ClassCastException
- * will occur as soon as we call any method implemented by a subclass
- * (e.g. StringExpressionConverter) that expects a particular subclass of
- * Expression (e.g. StringLiteral).
- */
-public abstract class AbstractExpressionConverter<T>
- implements ExpressionConverter<T>
-{
-
- protected AbstractExpressionConverter() {
- super();
- }
-
-
- // ********** object -> expression **********
-
- public Expression convert(T object, AST ast) {
- return (object == null) ? this.convertNull(ast) : this.convertObject(object, ast);
- }
-
- /**
- * Return the expression for a null object. By default, a null object will
- * be converted into a null expression.
- */
- protected Expression convertNull(AST ast) {
- return null;
- }
-
- /**
- * The specified object is not null.
- * @see #convert(T, AST)
- */
- protected abstract Expression convertObject(T object, AST ast);
-
-
- // ********** expression -> object **********
-
- public T convert(Expression expression) {
- return (expression == null) ? this.convertNull() : this.convertExpression(expression);
- }
-
- /**
- * Return the object for a null expression. By default, a null expression will
- * be converted into a null object.
- */
- protected T convertNull() {
- return null;
- }
-
- /**
- * The specified expression is not null.
- * @see #convert(Expression)
- */
- protected abstract T convertExpression(Expression expression);
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index b9cdce5a9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AbstractNestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,420 +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.internal.jdtutility;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-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.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-
-/**
- * Pull together some of the behavior common to NestedDeclarationAnnotationAdapter
- * and IndexedNestedDeclarationAnnotationAdapter
- */
-public abstract class AbstractNestedDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter {
- private final DeclarationAnnotationAdapter outerAnnotationAdapter;
- private final String elementName;
- private final boolean removeOuterAnnotationWhenEmpty;
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) {
- this(outerAnnotationAdapter, "value", annotationName);
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) {
- this(outerAnnotationAdapter, elementName, annotationName, true);
- }
-
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(annotationName);
- this.outerAnnotationAdapter = outerAnnotationAdapter;
- this.elementName = elementName;
- this.removeOuterAnnotationWhenEmpty = removeOuterAnnotationWhenEmpty;
- }
-
-
- // ********** AbstractDeclarationAnnotationAdapter implementation **********
-
- @Override
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- return null;
- }
- Expression value = this.elementValue(outer);
- if (value == null) {
- return null;
- }
- Annotation inner = this.getAnnotation(value);
- if (inner == null) {
- return null;
- }
- // return the annotation only if it has a matching name(?)
- return this.nameMatches(declaration, inner) ? inner : null;
- }
-
- @Override
- public void removeAnnotation(ModifiedDeclaration declaration) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- return;
- }
- Expression value = this.elementValue(outer);
- if (value == null) {
- return;
- }
- // hack to allow short-circuit when the value is an array initializer
- if (this.removeAnnotation(declaration, outer, value)) {
- return;
- }
- Annotation inner = this.annotationValue(value);
- if (inner == null) {
- return;
- }
- // remove the annotation only if it has a matching name(?)
- if (this.nameMatches(declaration, inner)) {
- this.removeElementAndNormalize(declaration, outer);
- }
- }
-
- @Override
- public ASTNode astNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, return the outer annotation's node
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : this.outerAnnotationAdapter.astNode(declaration);
- }
-
- @Override
- protected void addAnnotation(ModifiedDeclaration declaration, Annotation inner) {
- Annotation outer = this.outerAnnotationAdapter.getAnnotation(declaration);
- if (outer == null) {
- this.buildNewOuterAnnotation(declaration, inner);
- } else if (outer.isMarkerAnnotation()) {
- this.modifyAnnotation(declaration, (MarkerAnnotation) outer, inner);
- } else if (outer.isSingleMemberAnnotation()) {
- this.modifyAnnotation(declaration, (SingleMemberAnnotation) outer, inner);
- } else if (outer.isNormalAnnotation()) {
- this.modifyAnnotation(declaration, (NormalAnnotation) outer, inner);
- } else {
- throw new IllegalStateException("unknown annotation type: " + outer);
- }
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return an annotation extracted from the specified expression,
- * which is the value of the adapter's element.
- */
- protected abstract Annotation getAnnotation(Expression value);
-
- /**
- * Remove the annotation from the specified expression,
- * which is the value of the adapter's element.
- * Return whether the removal was successful.
- */
- protected abstract boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value);
-
- /**
- * Set the value of the specified outer annotation to the
- * specified inner annotation.
- */
- protected abstract void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner);
-
- /**
- * Set the value of the specified member value pair to the
- * specified inner annotation.
- */
- protected abstract void modifyMemberValuePair(MemberValuePair pair, Annotation inner);
-
-
- // ********** public methods **********
-
- public DeclarationAnnotationAdapter getOuterAnnotationAdapter() {
- return this.outerAnnotationAdapter;
- }
-
- public String getElementName() {
- return this.elementName;
- }
-
-
- // ********** internal methods **********
-
- /**
- * If the specified expression is an annotation, cast it to an annotation;
- * otherwise return null.
- */
- protected Annotation annotationValue(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- return (Annotation) expression;
- default:
- return null;
- }
- }
-
- /**
- * Remove the *first* annotation element with the specified name
- * from the specified annotation, converting the annotation as appropriate.
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, Annotation outer) {
- if (outer.isNormalAnnotation()) {
- this.removeElementAndNormalize(declaration, (NormalAnnotation) outer);
- } else if (outer.isSingleMemberAnnotation()) {
- this.removeElementAndNormalize(declaration, (SingleMemberAnnotation) outer);
- } else if (outer.isMarkerAnnotation()) {
- this.removeElementAndNormalize(declaration, (MarkerAnnotation) outer);
- } else {
- throw new IllegalArgumentException("unknown annotation type: " + outer);
- }
- }
-
- /**
- * Remove the *first* annotation element with the adapter's element name
- * from the specified annotation. Convert the annotation to
- * a marker annotation or single member annotation if appropriate.
- * <pre>
- * &#64;Outer(name="Fred", foo=&#64;Inner) => &#64;Outer(name="Fred")
- * &#64;Outer(foo=&#64;Inner) => &#64;Outer
- * </pre>
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, NormalAnnotation outer) {
- this.removeElement(outer);
- this.normalizeAnnotation(declaration, outer);
- }
-
- /**
- * Remove from the specified annotation the element with
- * the adapter's element name.
- */
- protected void removeElement(NormalAnnotation annotation) {
- for (Iterator<MemberValuePair> stream = this.values(annotation).iterator(); stream.hasNext(); ) {
- MemberValuePair pair = stream.next();
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- stream.remove();
- break;
- }
- }
- }
-
- /**
- * Convert the specified normal annotation to a marker annotation or
- * single member annotation if appropriate.
- */
- protected void normalizeAnnotation(ModifiedDeclaration declaration, NormalAnnotation outer) {
- List<MemberValuePair> values = this.values(outer);
- switch (values.size()) {
- case 0:
- // if the elements are all gone, remove the annotation or convert it to a marker annotation
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- } else {
- // convert the annotation to a marker annotation
- this.outerAnnotationAdapter.newMarkerAnnotation(declaration);
- }
- break;
- case 1:
- MemberValuePair pair = values.get(0);
- if (pair.getName().getFullyQualifiedName().equals("value")) {
- // if the last remaining element is 'value', convert the annotation to a single member annotation
- Expression vv = pair.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- }
- break;
- default:
- // do nothing
- break;
- }
- }
-
- /**
- * Convert the specified single member annotation to a marker annotation
- * if the adapter's element name is "value".
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, SingleMemberAnnotation outer) {
- if (this.elementName.equals("value")) {
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- } else {
- // convert the annotation to a marker annotation
- this.outerAnnotationAdapter.newMarkerAnnotation(declaration);
- }
- }
- }
-
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, MarkerAnnotation outer) {
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- }
- }
-
- /**
- * Return the value of the *first* annotation element
- * with the adapter's element 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 elementValue(Annotation annotation) {
- if (annotation.isNormalAnnotation()) {
- return this.elementValue((NormalAnnotation) annotation);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.elementValue((SingleMemberAnnotation) annotation);
- }
- return null;
- }
-
- protected Expression elementValue(NormalAnnotation annotation) {
- MemberValuePair pair = this.memberValuePair(annotation);
- return (pair == null) ? null : pair.getValue();
- }
-
- /**
- * If the adapter's element name is "value", return the value of the
- * annotation, otherwise return null.
- */
- protected Expression elementValue(SingleMemberAnnotation annotation) {
- return this.elementName.equals("value") ? annotation.getValue() : null;
- }
-
- /**
- * Return the *first* member value pair for the adapter's element name.
- * Return null if the specified annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * Build a new outer annotation and add the specified
- * inner annotation to it:
- * <pre>
- * &#64;Outer(&#64;Inner)
- * </pre>
- * or
- * <pre>
- * &#64;Outer(foo=&#64;Inner)
- * </pre>
- */
- protected void buildNewOuterAnnotation(ModifiedDeclaration declaration, Annotation inner) {
- if (this.elementName.equals("value")) {
- this.outerAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(this.buildNewInnerExpression(inner));
- } else {
- List<MemberValuePair> values = this.values(this.outerAnnotationAdapter.newNormalAnnotation(declaration));
- values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner)));
- }
- }
-
- /**
- * Build an expression to be added to a new outer annotation
- * for the specified inner annotation.
- */
- protected abstract Expression buildNewInnerExpression(Annotation inner);
-
- /**
- * Build a new member value pair with the specified name and value.
- */
- protected MemberValuePair newMemberValuePair(String name, Expression value) {
- AST ast = value.getAST();
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(ast.newSimpleName(name));
- pair.setValue(value);
- return pair;
- }
-
- /**
- * Build a new member value pair with the adapter's element name
- * and the specified inner annotation.
- */
- protected MemberValuePair newMemberValuePair(Expression value) {
- return this.newMemberValuePair(this.elementName, value);
- }
-
- /**
- * Add the specified inner annotation to the marker annotation.
- */
- protected void modifyAnnotation(ModifiedDeclaration declaration, MarkerAnnotation outer, Annotation inner) {
- this.buildNewOuterAnnotation(declaration, inner);
- }
-
- /**
- * Add the specified inner annotation to the single member annotation.
- */
- protected void modifyAnnotation(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) {
- if (this.elementName.equals("value")) {
- this.modifyAnnotationValue(outer, inner);
- } else {
- this.modifyAnnotationNonValue(declaration, outer, inner);
- }
- }
-
- /**
- * Add the specified inner annotation to the single member annotation,
- * converting it to a normal annotation:
- * <pre>
- * &#64;Outer("lorem ipsum") => &#64;Outer(value="lorem ipsum", foo=&#64;Inner)
- * </pre>
- */
- protected void modifyAnnotationNonValue(ModifiedDeclaration declaration, SingleMemberAnnotation outer, Annotation inner) {
- Expression vv = outer.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- NormalAnnotation newOuter = this.outerAnnotationAdapter.newNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newOuter);
- values.add(this.newMemberValuePair("value", vv));
- values.add(this.newMemberValuePair(this.buildNewInnerExpression(inner)));
- }
-
- /**
- * Add the specified inner annotation to the normal annotation:
- * <pre>
- * &#64;Outer(bar="lorem ipsum") => &#64;Outer(bar="lorem ipsum", foo=&#64;Inner)
- * </pre>
- * or
- * <pre>
- * &#64;Outer(foo=&#64;Inner("lorem ipsum")) => &#64;Outer(foo=&#64;Inner)
- * </pre>
- */
- protected void modifyAnnotation(ModifiedDeclaration declaration, NormalAnnotation outer, Annotation inner) {
- MemberValuePair pair = this.memberValuePair(outer);
- if (pair == null) {
- List<MemberValuePair> values = this.values(outer);
- values.add(this.newMemberValuePair(inner));
- } else {
- this.modifyMemberValuePair(pair, inner);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java
deleted file mode 100644
index 8190d36122..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationAdapter.java
+++ /dev/null
@@ -1,72 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Adapt a Java annotation with a simple-to-use interface.
- */
-public interface AnnotationAdapter {
-
- /**
- * Return the value of the adapter's annotation.
- * If the compilation unit is available, #getAnnotation(CompilationUnit)
- * might be more performant.
- * @see #getAnnotation(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- Annotation getAnnotation();
-
- /**
- * Given the specified compilation unit, return the value of the
- * adapter's annotation.
- * @see #getAnnotation()
- */
- Annotation getAnnotation(CompilationUnit astRoot);
-
- /**
- * Build a new marker annotation, replacing the original annotation if present.
- */
- void newMarkerAnnotation();
-
- /**
- * Build a new single member annotation, replacing the original annotation if present.
- */
- void newSingleMemberAnnotation();
-
- /**
- * Build a new normal annotation, replacing the original annotation if present.
- */
- void newNormalAnnotation();
-
- /**
- * Remove the annotation.
- */
- void removeAnnotation();
-
- /**
- * Return the AST node corresponding to the annotation.
- * If the annotation is missing, return the annotation's parent's node.
- * If the compilation unit is available, #astNode(CompilationUnit)
- * might be more performant.
- * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- ASTNode astNode();
-
- /**
- * Return the AST node corresponding to the annotation.
- * If the annotation is missing, return the annotation's parent node.
- * @see #astNode()
- */
- ASTNode astNode(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java
deleted file mode 100644
index 91eb53cf09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationEditFormatter.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-public interface AnnotationEditFormatter {
-
- /**
- * Review the specified edits and format the specified document as needed.
- */
- void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java
deleted file mode 100644
index 5e25607ab3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationElementAdapter.java
+++ /dev/null
@@ -1,78 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Adapt a Java annotation element with a simple-to-use interface.
- */
-public interface AnnotationElementAdapter<T> {
-
- /**
- * Return the value of the adapter's annotation element.
- * Return null if the element is not present.
- * If the compilation unit is available, #getValue(CompilationUnit)
- * might be more performant.
- * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- T getValue();
-
- /**
- * Given the specified compilation unit, return the value of the
- * adapter's annotation element.
- * Return null if the element is not present.
- * @see #getValue()
- */
- T getValue(CompilationUnit astRoot);
-
- /**
- * Set the value of the adapter's annotation element.
- * Setting the value of the element to null will cause
- * the element to be removed from its annotation.
- */
- void setValue(T value);
-
- /**
- * Return the expression value of the adapter's annotation element.
- * Return null if the element is not present.
- * If the compilation unit is available, #expression(CompilationUnit)
- * might be more performant.
- * @see #expression(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- Expression expression();
-
- /**
- * Given the specified compilation unit, return the expression value of the
- * adapter's annotation element.
- * Return null if the element is not present.
- * @see #expression()
- */
- Expression expression(CompilationUnit astRoot);
-
- /**
- * Return the AST node corresponding to the element.
- * If the element is missing, return the annotation's node.
- * If the compilation unit is available, #astNode(CompilationUnit)
- * might be more performant.
- * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- ASTNode astNode();
-
- /**
- * Return the AST node corresponding to the element.
- * If the element is missing, return the annotation's node.
- * @see #astNode()
- */
- ASTNode astNode(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationStringArrayExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationStringArrayExpressionConverter.java
deleted file mode 100644
index 21557f6944..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/AnnotationStringArrayExpressionConverter.java
+++ /dev/null
@@ -1,95 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Convert an array initializer or single expression to/from an array of
- * strings (e.g. {"text0", "text1"}).
- * E is the type of the expressions to be found either standalone or
- * as elements in the array initializer.
- */
-public class AnnotationStringArrayExpressionConverter
- extends AbstractExpressionConverter<String[]>
-{
- private final ExpressionConverter<String> elementConverter;
- private final StringArrayExpressionConverter arrayConverter;
-
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public AnnotationStringArrayExpressionConverter(ExpressionConverter<String> elementConverter) {
- this(elementConverter, true);
- }
-
- public AnnotationStringArrayExpressionConverter(ExpressionConverter<String> elementConverter, boolean removeArrayInitializerWhenEmpty) {
- super();
- this.elementConverter = elementConverter;
- this.arrayConverter = new StringArrayExpressionConverter(elementConverter, removeArrayInitializerWhenEmpty);
- }
-
- /**
- * if we only have a single string in the array return the single expression,
- * without braces, instead of an array initializer
- */
- @Override
- protected Expression convertObject(String[] strings, AST ast) {
- return (strings.length == 1) ?
- this.elementConverter.convert(strings[0], ast)
- :
- this.arrayConverter.convertObject(strings, ast);
- }
-
- @Override
- protected String[] convertNull() {
- return this.arrayConverter.convertNull();
- }
-
- /**
- * check for a single expression with no surrounding braces, implying a
- * single-entry array
- */
- @Override
- protected String[] convertExpression(Expression expression) {
- return (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- this.arrayConverter.convertArrayInitializer((ArrayInitializer) expression)
- :
- new String[] {this.elementConverter.convert(expression)};
- }
-
-
- // ********** factory methods **********
-
- /**
- * Build an expression converter for an annotation element of type String[].
- * @Foo(bar={"text0", "text1"})
- * or
- * @Foo(bar="text0")
- */
- public static AnnotationStringArrayExpressionConverter forStrings() {
- return new AnnotationStringArrayExpressionConverter(StringExpressionConverter.instance());
- }
-
- /**
- * Build an expression converter for an annotation element of type <enum>[].
- * @Foo(bar={BAZ, BAT})
- * or
- * @Foo(bar=BAZ)
- */
- public static AnnotationStringArrayExpressionConverter forNames() {
- return new AnnotationStringArrayExpressionConverter(NameStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java
deleted file mode 100644
index d241205d92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Attribute.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-
-/**
- * Combine behavior common to FieldAttribute and MethodAttribute.
- */
-public abstract class Attribute extends Member {
-
- Attribute(IMember jdtMember, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- super(jdtMember, modifySharedDocumentCommandExecutorProvider);
- }
-
- Attribute(IMember jdtMember, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider, AnnotationEditFormatter annotationEditFormatter) {
- super(jdtMember, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- public boolean isField() {
- return false;
- }
-
- public boolean isMethod() {
- return false;
- }
-
- public abstract String attributeName();
-
- /**
- * Resolve the attribute.
- * Return the fully-qualified type name or return null if it cannot be
- * resolved unambiguously.
- */
- public String resolvedTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = typeBinding(astRoot);
- if (typeBinding != null) {
- return typeBinding.getQualifiedName();
- }
- return null;
- }
-
- /**
- * this will throw a NPE for a top-level type
- */
- TypeDeclaration declaringTypeDeclaration(CompilationUnit astRoot) {
- //assume no enums or annotation types since they have no field or method declarations
- return (TypeDeclaration) this.getDeclaringType().bodyDeclaration(astRoot);
- }
-
- /**
- * Return the ITypeBinding for the attribute's type, not it's declaring type
- * @param astRoot
- * @return
- */
- public abstract ITypeBinding typeBinding(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java
deleted file mode 100644
index 6a1eb8894b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanAnnotationAdapter.java
+++ /dev/null
@@ -1,77 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Adapt a "boolean" Java annotation with a simple-to-use interface.
- */
-public interface BooleanAnnotationAdapter {
-
- /**
- * Return the "boolean" value of the adapter's annotation.
- * Return true if the annotation is present; otherwise return false.
- * If the compilation unit is available, #getValue(CompilationUnit)
- * might be more performant.
- * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- boolean getValue();
-
- /**
- * Given the specified compilation unit, return the "boolean" value of the
- * adapter's annotation.
- * Return true if the annotation is present; otherwise return false.
- * @see #getValue()
- */
- boolean getValue(CompilationUnit astRoot);
-
- /**
- * Set the "boolean" value of the adapter's annotation.
- * Setting the value to true will cause the annotation to be added
- * to its declaration; setting it to false will cause the annotation
- * to be removed.
- */
- void setValue(boolean value);
-
- /**
- * Return the value of the adapter's annotation.
- * If the compilation unit is available, #getAnnotation(CompilationUnit)
- * might be more performant.
- * @see #getAnnotation(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- Annotation getAnnotation();
-
- /**
- * Given the specified compilation unit, return the value of the
- * adapter's annotation.
- * @see #getAnnotation()
- */
- Annotation getAnnotation(CompilationUnit astRoot);
-
- /**
- * Return the AST node corresponding to the annotation.
- * If the annotation is missing, return the annotation's parent's node.
- * If the compilation unit is available, #astNode(CompilationUnit)
- * might be more performant.
- * @see #astNode(org.eclipse.jdt.core.dom.CompilationUnit)
- */
- ASTNode astNode();
-
- /**
- * Return the AST node corresponding to the annotation.
- * If the annotation is missing, return the annotation's parent node.
- * @see #astNode()
- */
- ASTNode astNode(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanExpressionConverter.java
deleted file mode 100644
index b1c26905bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/BooleanExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Convert a boolean literal to/from a Boolean
- * (e.g. Boolean.TRUE).
- */
-public final class BooleanExpressionConverter
- extends AbstractExpressionConverter<Boolean>
-{
- private static final ExpressionConverter<Boolean> INSTANCE = new BooleanExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Boolean> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BooleanExpressionConverter() {
- super();
- }
-
- @Override
- protected BooleanLiteral convertObject(Boolean booleanObject, AST ast) {
- return ast.newBooleanLiteral(booleanObject.booleanValue());
- }
-
- @Override
- protected Boolean convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Boolean) ? ((Boolean) value) : null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.java
deleted file mode 100644
index 4bb2de9ec5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CharacterStringExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Convert a character literal to/from a string representation of a character
- * (e.g. "A").
- */
-public final class CharacterStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new CharacterStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private CharacterStringExpressionConverter() {
- super();
- }
-
- @Override
- protected CharacterLiteral convertObject(String string, AST ast) {
- CharacterLiteral characterLiteral = ast.newCharacterLiteral();
- characterLiteral.setCharValue(string.charAt(0));
- return characterLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Character) ? ((Character) value).toString() : null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 21b1bce7bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/CombinationIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,490 +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.internal.jdtutility;
-
-import java.util.List;
-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.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Manipulate an annotation that either occurs stand-alone, e.g.
- * <pre>
- * &#64;Inner("zero")
- * private int id;
- * </pre>
- *
- * or is embedded in an element array within another annotation, e.g.
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- *
- * annotationName = "Inner"
- * containerAnnotationName = "Outer"
- * elementName = "foo"
- * index = 0-2
- * </pre>
- *
- * This is a useful pattern because a declaration cannot have more
- * than one annotation of the same type, and allowing the stand-alone
- * configuration reduces clutter.
- * <br>
- * NB: This configuration only makes sense for "top-level" annotations, as
- * opposed to "nested" annotations. This is because annotation elements
- * can only be declared with a type of a single annotation and annotations
- * cannot be part of an inheritance hierarchy.
- * For example, the following configurations cannot *both* be supported:
- * <pre>
- * &#64;Foo(bar=&#64;Outer(...))
- * private int id;
- *
- * &#64;Foo(bar=&#64;Inner(...)) // not allowed
- * private int id;
- * </pre>
- *
- * NB: Behavior is undefined when both the stand-alone and the nested
- * configurations annotate the same declaration, e.g.
- * <pre>
- * // undefined behavior
- * &#64;Inner("zero")
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- * </pre>
- */
-public class CombinationIndexedDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
-
- /**
- * this adapter is used when the annotation is "stand-alone":
- * <pre>
- * &#64;Inner("zero")
- * </pre>
- * and is only used when the index is 0 or 1
- */
- private final SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter;
-
- /**
- * this adapter is used when the annotation is "nested":
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one")})
- * </pre>
- */
- private final NestedIndexedDeclarationAnnotationAdapter nestedAnnotationAdapter;
-
- /**
- * this adapter is for the "nested" annotation at the zero index;
- * and is only used when the index is 1
- */
- private final NestedIndexedDeclarationAnnotationAdapter zeroNestedAnnotationAdapter;
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value"
- * <pre>
- * &#64;Inner("zero")
- * &#64;Outer({&#64;Inner("zero"), &#64;Inner("one")})
- * </pre>
- */
- public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, int index) {
- this(annotationName, containerAnnotationName, "value", index);
- }
-
- public CombinationIndexedDeclarationAnnotationAdapter(String annotationName, String containerAnnotationName, String elementName, int index) {
- this(new SimpleDeclarationAnnotationAdapter(annotationName), new SimpleDeclarationAnnotationAdapter(containerAnnotationName), elementName, index, annotationName);
- }
-
- /**
- * default element name is "value"
- */
- public CombinationIndexedDeclarationAnnotationAdapter(
- SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter,
- SimpleDeclarationAnnotationAdapter containerAnnotationAdapter,
- int index,
- String nestedAnnotationName
- ) {
- this(standAloneAnnotationAdapter, containerAnnotationAdapter, "value", index, nestedAnnotationName);
- }
-
- public CombinationIndexedDeclarationAnnotationAdapter(
- SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter,
- SimpleDeclarationAnnotationAdapter containerAnnotationAdapter,
- String elementName,
- int index,
- String nestedAnnotationName
- ) {
- super();
- this.standAloneAnnotationAdapter = standAloneAnnotationAdapter;
- this.nestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, index, nestedAnnotationName);
- this.zeroNestedAnnotationAdapter = new NestedIndexedDeclarationAnnotationAdapter(containerAnnotationAdapter, elementName, 0, nestedAnnotationName);
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- // check for the stand-alone annotation
- Annotation standAloneAnnotation = this.standAloneAnnotation(declaration);
- if (standAloneAnnotation != null) {
- return standAloneAnnotation;
- }
- }
- return this.nestedAnnotation(declaration);
- }
-
- /**
- * <pre>
- * [none] => &#64;Inner
- * or
- * &#64;Inner("lorem ipsum") => &#64;Inner
- * or
- * &#64;Inner(text="lorem ipsum") => &#64;Inner
- * or
- * &#64;Outer(foo={&#64;Inner, &#64;Inner}) => &#64;Outer(foo={&#64;Inner, &#64;Inner, &#64;Inner})
- * or
- * &#64;Outer(foo=&#64;Inner) => &#64;Outer(foo={&#64;Inner, &#64;Inner})
- * or
- * &#64;Inner => &#64;Outer(foo={&#64;Inner, &#64;Inner})
- * etc.
- * </pre>
- */
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- return (MarkerAnnotation) this.newAnnotation(MARKER_ANNOTATION_FACTORY, declaration);
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return (SingleMemberAnnotation) this.newAnnotation(SINGLE_MEMBER_ANNOTATION_FACTORY, declaration);
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- return (NormalAnnotation) this.newAnnotation(NORMAL_ANNOTATION_FACTORY, declaration);
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- // check for the stand-alone annotation
- if (this.standAloneAnnotationIsPresent(declaration)) {
- this.removeStandAloneAnnotation(declaration);
- return;
- }
- }
- this.removeNestedAnnotation(declaration);
- if (this.nestedElementCanBeConvertedToStandAlone(declaration)) {
- this.convertLastElementAnnotationToStandAloneAnnotation(declaration);
- }
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, delegate to the nested annotation adapter
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : this.nestedAnnotationAdapter.astNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.annotationName());
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return this.nestedAnnotationAdapter.getIndex();
- }
-
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- int oldIndex = this.getIndex();
- if (newIndex == oldIndex) {
- return;
- }
-
- Annotation standAloneAnnotation = this.standAloneAnnotation(declaration);
- if (standAloneAnnotation == null) {
- this.moveNestedAnnotation(newIndex, declaration);
- if (this.nestedElementCanBeConvertedToStandAlone(declaration)) {
- this.convertLastElementAnnotationToStandAloneAnnotation(declaration);
- }
- } else {
- if ((oldIndex == 0) && (newIndex == 1)) {
- // this is one of two situations where we transition from standalone to container
- this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration);
- this.moveNestedAnnotation(newIndex, declaration);
- } else if (newIndex == 0) {
- // we are moving a 'null' entry on top of the standalone, so remove it
- this.removeStandAloneAnnotation(declaration);
- } else {
- throw new IllegalStateException("old index = " + oldIndex + "; new index = " + newIndex);
- }
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * build the appropriate new annotation,
- * which may require moving the 0th annotation from "stand-alone" to "nested"
- */
- private Annotation newAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) {
- if (this.getIndex() == 0) {
- return this.newZeroAnnotation(annotationFactory, declaration);
- }
- if (this.zeroNestedAnnotationIsPresent(declaration)) {
- // manipulate the container annotation - ignore the stand-alone annotation(?)
- // @Outer(foo=@Inner("zero")) => @Outer(foo={@Inner("zero"), @Inner})
- // or
- // @Outer(foo={@Inner("zero"), @Inner("one")}) => @Outer(foo={@Inner("zero"), @Inner})
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
-
- // this is one of two situations where we transition from standalone to container
- this.moveStandAloneAnnotationToContainerAnnotation(declaration);
- // once the stand-alone annotation is moved to index=0, build the new annotation at index=1
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
-
- /**
- * the index is 0 - build the appropriate new annotation,
- * which may be either "stand-alone" or "nested"
- */
- private Annotation newZeroAnnotation(AnnotationFactory annotationFactory, ModifiedDeclaration declaration) {
- if (this.standAloneAnnotationIsPresent(declaration)) {
- // replace the stand-alone annotation - ignore the container annotation(?)
- // @Inner(text="lorem ipsum") => @Inner
- return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration);
- }
- if (this.containerAnnotationIsPresent(declaration)) {
- // manipulate the container annotation
- // @Outer(foo=@Inner(text="lorem ipsum")) => @Outer(foo=@Inner)
- return annotationFactory.newAnnotation(this.nestedAnnotationAdapter, declaration);
- }
- // neither annotation is present - add a new stand-alone annotation
- return annotationFactory.newAnnotation(this.standAloneAnnotationAdapter, declaration);
- }
-
- /**
- * move the stand-alone annotation to the container annotation at index=0
- */
- private void moveStandAloneAnnotationToContainerAnnotation(ModifiedDeclaration declaration) {
- Annotation standAloneAnnotation = this.standAloneAnnotation(declaration);
- if (standAloneAnnotation == null) {
- throw new IllegalStateException("the stand-alone annotation is missing");
- }
- this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration);
- }
-
- /**
- * move the specified, non-null, stand-alone annotation to
- * the container annotation at index=0
- */
- private void moveStandAloneAnnotationToContainerAnnotation(Annotation standAloneAnnotation, ModifiedDeclaration declaration) {
- if (standAloneAnnotation.isMarkerAnnotation()) {
- this.zeroNestedAnnotationAdapter.newMarkerAnnotation(declaration);
- } else if (standAloneAnnotation.isSingleMemberAnnotation()) {
- Expression vv = ((SingleMemberAnnotation) standAloneAnnotation).getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.zeroNestedAnnotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- } else if (standAloneAnnotation.isNormalAnnotation()) {
- NormalAnnotation newNA = this.zeroNestedAnnotationAdapter.newNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newNA);
- for (MemberValuePair pair : this.values((NormalAnnotation) standAloneAnnotation)) {
- values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair));
- }
- } else {
- throw new IllegalStateException("unknown annotation type: " + standAloneAnnotation);
- }
- this.removeStandAloneAnnotation(declaration);
- }
-
- /**
- * return whether the "nested" annotation container has been reduced to
- * a single element (and the array initializer is converted to just
- * the single remaining element) and can be further converted to the
- * "stand-alone" annotation:
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one")}) =>
- * &#64;Outer(foo=&#64;Inner("zero")) =>
- * &#64;Inner("zero")
- * </pre>
- */
- private boolean nestedElementCanBeConvertedToStandAlone(ModifiedDeclaration declaration) {
- Annotation containerAnnotation = this.containerAnnotation(declaration);
- if (containerAnnotation == null) {
- return false;
- }
- if (containerAnnotation.isMarkerAnnotation()) {
- return false;
- }
- if (containerAnnotation.isSingleMemberAnnotation()) {
- if (this.elementName().equals("value")) {
- return (((SingleMemberAnnotation) containerAnnotation).getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER)
- && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null);
- }
- return false;
- }
- if (containerAnnotation.isNormalAnnotation()) {
- NormalAnnotation na = (NormalAnnotation) containerAnnotation;
- if (na.values().size() == 0) {
- return false; // there are no elements present
- }
- if (na.values().size() != 1) {
- return false; // there are other elements present - leave them all alone
- }
- MemberValuePair pair = (MemberValuePair) na.values().get(0);
- if (this.elementName().equals(pair.getName().getFullyQualifiedName())) {
- return (pair.getValue().getNodeType() != ASTNode.ARRAY_INITIALIZER)
- && (this.zeroNestedAnnotationAdapter.getAnnotation(declaration) != null);
- }
- return false;
- }
- throw new IllegalStateException("unknown annotation type: " + containerAnnotation);
- }
-
- /**
- * move the annotation in the container annotation at index=0
- * to the stand-alone annotation
- */
- private void convertLastElementAnnotationToStandAloneAnnotation(ModifiedDeclaration declaration) {
- Annotation last = this.zeroNestedAnnotationAdapter.getAnnotation(declaration);
- if (last == null) {
- throw new IllegalStateException("the last nested annotation is missing");
- } else if (last.isMarkerAnnotation()) {
- this.newStandAloneMarkerAnnotation(declaration);
- } else if (last.isSingleMemberAnnotation()) {
- Expression vv = ((SingleMemberAnnotation) last).getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.newStandAloneSingleMemberAnnotation(declaration).setValue(vv);
- } else if (last.isNormalAnnotation()) {
- NormalAnnotation newNA = this.newStandAloneNormalAnnotation(declaration);
- List<MemberValuePair> values = this.values(newNA);
- for (MemberValuePair pair : this.values((NormalAnnotation) last)) {
- values.add((MemberValuePair) ASTNode.copySubtree(pair.getAST(), pair));
- }
- } else {
- throw new IllegalStateException("unknown annotation type: " + last);
- }
- this.zeroNestedAnnotationAdapter.removeAnnotation(declaration);
- }
-
- private boolean standAloneAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.standAloneAnnotation(declaration) != null;
- }
-
- private Annotation standAloneAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.getAnnotation(declaration);
- }
-
- private MarkerAnnotation newStandAloneMarkerAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newMarkerAnnotation(declaration);
- }
-
- private SingleMemberAnnotation newStandAloneSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newSingleMemberAnnotation(declaration);
- }
-
- private NormalAnnotation newStandAloneNormalAnnotation(ModifiedDeclaration declaration) {
- return this.standAloneAnnotationAdapter.newNormalAnnotation(declaration);
- }
-
- private void removeStandAloneAnnotation(ModifiedDeclaration declaration) {
- this.standAloneAnnotationAdapter.removeAnnotation(declaration);
- }
-
- private Annotation nestedAnnotation(ModifiedDeclaration declaration) {
- return this.nestedAnnotationAdapter.getAnnotation(declaration);
- }
-
- private void moveNestedAnnotation(int newIndex, ModifiedDeclaration declaration) {
- this.nestedAnnotationAdapter.moveAnnotation(newIndex, declaration);
- }
-
- private void removeNestedAnnotation(ModifiedDeclaration declaration) {
- this.nestedAnnotationAdapter.removeAnnotation(declaration);
- }
-
- private boolean containerAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.containerAnnotation(declaration) != null;
- }
-
- private Annotation containerAnnotation(ModifiedDeclaration declaration) {
- return this.nestedAnnotationAdapter.getOuterAnnotationAdapter().getAnnotation(declaration);
- }
-
- private boolean zeroNestedAnnotationIsPresent(ModifiedDeclaration declaration) {
- return this.zeroNestedAnnotation(declaration) != null;
- }
-
- private Annotation zeroNestedAnnotation(ModifiedDeclaration declaration) {
- return this.zeroNestedAnnotationAdapter.getAnnotation(declaration);
- }
-
- private String annotationName() {
- return this.nestedAnnotationAdapter.getAnnotationName();
- }
-
- private String elementName() {
- return this.nestedAnnotationAdapter.getElementName();
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-
- // ********** annotation factories **********
-
- /**
- * define interface that allows us to "re-use" the nasty code in
- * #newAnnotation(AnnotationFactory, ModifiedDeclaration)
- */
- private interface AnnotationFactory {
- Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration);
- }
-
- private static final AnnotationFactory MARKER_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newMarkerAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "MarkerAnnotationFactory";
- }
- };
-
- private static final AnnotationFactory SINGLE_MEMBER_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newSingleMemberAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "SingleMemberAnnotationFactory";
- }
- };
-
- private static final AnnotationFactory NORMAL_ANNOTATION_FACTORY = new AnnotationFactory() {
- public Annotation newAnnotation(DeclarationAnnotationAdapter adapter, ModifiedDeclaration declaration) {
- return adapter.newNormalAnnotation(declaration);
- }
- @Override
- public String toString() {
- return "NormalAnnotationFactory";
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index c222091734..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ConversionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,199 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap a declaration annotation element adapter that deals with AST
- * expressions, converting them to/from various other objects.
- * T is the type of the object to be passed to and returned by the adapter.
- */
-public class ConversionDeclarationAnnotationElementAdapter<T>
- implements DeclarationAnnotationElementAdapter<T>
-{
- /**
- * The wrapped adapter that returns and takes AST expressions.
- */
- private final DeclarationAnnotationElementAdapter<Expression> adapter;
-
- /**
- * The converter that converts AST expressions to other objects
- * (e.g. Strings).
- */
- private final ExpressionConverter<T> converter;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter), converter);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter, elementName), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter, elementName, removeAnnotationWhenEmpty), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Expression> adapter, ExpressionConverter<T> converter) {
- super();
- this.adapter = adapter;
- this.converter = converter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public T getValue(ModifiedDeclaration declaration) {
- Expression expression = this.adapter.getValue(declaration);
- return this.converter.convert(expression);
- }
-
- public void setValue(T value, ModifiedDeclaration declaration) {
- Expression expression;
- try {
- expression = this.converter.convert(value, declaration.getAST());
- } catch (IllegalArgumentException ex) {
- // if there is a problem converting the 'value' to an Expression we get this exception
- return; // don't set the value if it is "illegal"
- }
- this.adapter.setValue(expression, declaration);
- }
-
- public Expression expression(ModifiedDeclaration declaration) {
- return this.adapter.expression(declaration);
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- return this.adapter.astNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter);
- }
-
-
- // ********** factory static methods **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, StringExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; the default expression converter expects
- * string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, StringExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, StringExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; the default expression converter expects
- * number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, removeAnnotationWhenEmpty, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; the default expression converter expects
- * boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, removeAnnotationWhenEmpty, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, CharacterStringExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; the default expression converter expects
- * character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, CharacterStringExpressionConverter.instance());
- }
-
- /**
- * The default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, CharacterStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.java
deleted file mode 100644
index b8c551bc83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-
-/**
- * Provide clients with a pluggable way to manipulate an
- * annotation modifying a "declaration".
- *
- * TODO specify how multiple annotations with the same name are to be handled
- */
-public interface DeclarationAnnotationAdapter {
-
- /**
- * Given the specified declaration, return the annotation.
- */
- Annotation getAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new marker annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new single member annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, modify it with
- * a new normal annotation, replacing the original annotation if present.
- * Return the new annotation.
- */
- NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Remove the annotation from the specified declaration.
- */
- void removeAnnotation(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the AST node
- * corresponding to the annotation.
- * If the annotation is missing, return its parent node.
- */
- ASTNode astNode(ModifiedDeclaration declaration);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.java
deleted file mode 100644
index c8a1be2939..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DeclarationAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Provide clients with a pluggable way to manipulate an
- * annotation element modifying a "declaration".
- * T is the type of the object to be passed to and returned by the adapter.
- */
-public interface DeclarationAnnotationElementAdapter<T> {
-
- /**
- * Given the specified declaration, return the value of the
- * annotation element. Return null or an empty array
- * if the element is not present.
- */
- T getValue(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, set the value of the
- * annotation element. Setting the value of the element
- * to null will cause the element to be removed from its
- * annotation.
- */
- void setValue(T value, ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the element's value expression.
- * Return null if the element is not present.
- */
- Expression expression(ModifiedDeclaration declaration);
-
- /**
- * Given the specified declaration, return the AST node
- * corresponding to the element's value.
- * If the element is missing, return the annotation's node.
- */
- ASTNode astNode(ModifiedDeclaration declaration);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DefaultAnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DefaultAnnotationEditFormatter.java
deleted file mode 100644
index 90be1b58a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/DefaultAnnotationEditFormatter.java
+++ /dev/null
@@ -1,218 +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.internal.jdtutility;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.InsertEdit;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * This implementation will clean up some of the nasty Eclipse annotation
- * formatting (or lack thereof); e.g. arrays of annotations.
- */
-public final class DefaultAnnotationEditFormatter
- implements AnnotationEditFormatter
-{
- private static final DefaultAnnotationEditFormatter INSTANCE = new DefaultAnnotationEditFormatter();
-
- /**
- * Return the singleton.
- */
- public static DefaultAnnotationEditFormatter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DefaultAnnotationEditFormatter() {
- super();
- }
-
- /**
- * TODO
- */
- public void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException {
- TextEdit[] edits = editTree.getChildren();
- int len = edits.length;
- if (len == 0) {
- return;
- }
-
- MultiTextEdit extraEdits = new MultiTextEdit();
- for (int i = 0; i < len; i++) {
- TextEdit edit1 = edits[i];
- if ( ! (edit1 instanceof InsertEdit)) {
- continue; // if the edit is not an insert, skip to the next edit
- }
- InsertEdit insert1 = (InsertEdit) edit1;
- int j = i + 1;
- if (j < len) {
- TextEdit edit2 = edits[j];
- if (edit2 instanceof InsertEdit) {
- InsertEdit insert2 = (InsertEdit) edit2;
- String text1 = insert1.getText();
- String text2 = insert2.getText();
- int offset1 = insert1.getOffset();
- int offset2 = insert2.getOffset();
- if (this.stringIsAnnotation(text1) && text2.equals(" ")) {
- // an annotation was inserted before something on the same line;
- // replace the trailing space with a newline and appropriate indent
- extraEdits.addChild(new ReplaceEdit(offset2, 1, this.buildCR(doc, offset2)));
- i++; // jump the index past 'edit2'
- continue; // go to the next edit
- }
- int comma1Length = this.commaLength(text1);
- if ((comma1Length != 0) && this.stringIsAnnotation(text2)) {
- // an annotation was inserted in an array initializer on the
- // same line as the previous array element;
- // replace the preceding space with a newline and appropriate indent
- extraEdits.addChild(new ReplaceEdit(offset1 + comma1Length, text1.length() - comma1Length, this.buildCR(doc, offset1)));
- i++; // jump the index past 'edit2'
- continue; // go to the next edit
- }
- }
- }
- this.formatArrayInitializer(doc, insert1, extraEdits);
- }
- extraEdits.apply(doc, TextEdit.NONE);
- }
-
- /**
- * If the insert edit is inserting an annotation containing an array of annotations as
- * its value then format them nicely.
- */
- private void formatArrayInitializer(IDocument doc, InsertEdit insertEdit, MultiTextEdit extraEdits) throws BadLocationException {
- String s = insertEdit.getText();
- if ( ! this.stringIsAnnotation(s)) {
- return;
- }
- int len = s.length();
- int pos = 1; // skip '@'
- while (pos < len) {
- char c = s.charAt(pos);
- pos++; // bump to just past first '('
- if (c == '(') {
- break;
- }
- }
- if (pos == len) {
- return; // reached end of string
- }
- while (pos < len) {
- char c = s.charAt(pos);
- pos++; // bump to just past first '{'
- if (c == '{') {
- break;
- }
- if (c != ' ') {
- return;
- }
- }
- if (pos == len) {
- return; // reached end of string
- }
- // now look for '@' not inside parentheses and put in
- // line delimeter and indent string before each
- int offset = insertEdit.getOffset();
- String indent = null;
- int parenDepth = 0;
- while (pos < len) {
- switch (s.charAt(pos)) {
- case '(' :
- parenDepth++;
- break;
- case ')' :
- parenDepth--;
- break;
- case '@' :
- if (parenDepth == 0) {
- if (indent == null) {
- indent = this.buildCR(doc, offset, "\t"); // TODO use tab preference?
- }
- extraEdits.addChild(new InsertEdit(offset + pos, indent));
- }
- break;
- case '}' :
- if (parenDepth == 0) {
- extraEdits.addChild(new InsertEdit(offset + pos, this.buildCR(doc, offset)));
- }
- break;
- }
- pos++;
- }
- }
-
- /**
- * Build a string containing a line delimeter and indenting characters
- * matching the indent level of the line containing the character offset
- * (i.e. the new line's indent matches the current line).
- */
- private String buildCR(IDocument doc, int offset) throws BadLocationException {
- return this.buildCR(doc, offset, "");
- }
-
- private String buildCR(IDocument doc, int offset, String suffix) throws BadLocationException {
- int line = doc.getLineOfOffset(offset);
- StringBuilder sb = new StringBuilder();
- sb.append(doc.getLineDelimiter(line)); // use same CR as current line
-
- int o = doc.getLineOffset(line); // match the whitespace of the current line
- char c = doc.getChar(o++);
- while ((c == ' ') || (c == '\t')) {
- sb.append(c);
- c = doc.getChar(o++);
- }
- sb.append(suffix);
- return sb.toString();
- }
-
- /**
- * Return whether the specified string is an annotation.
- */
- private boolean stringIsAnnotation(String string) {
- return (string.length() > 1) && string.charAt(0) == '@';
- }
-
- /**
- * If the specified string is a single comma, possibly surrounded by
- * spaces, return the length of the substring containing the
- * initial spaces and the comma.
- */
- private int commaLength(String string) {
- boolean comma = false;
- int len = string.length();
- int result = 0;
- for (int i = 0; i < len; i++) {
- switch (string.charAt(i)) {
- case ' ' :
- if ( ! comma) {
- result++; // space preceding comma
- }
- break;
- case ',' :
- if (comma) {
- return 0; // second comma!
- }
- comma = true;
- result++;
- break;
- default:
- return 0; // non-comma, non-space char
- }
- }
- return result;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 69e71b913f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumArrayDeclarationAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Wrap a declaration annotation element adapter and simply
- * add an import for the enums when necessary.
- */
-public class EnumArrayDeclarationAnnotationElementAdapter
- implements DeclarationAnnotationElementAdapter<String[]>
-{
- /**
- * The wrapped adapter that returns and takes name strings (enums).
- */
- private final ConversionDeclarationAnnotationElementAdapter<String[]> adapter;
-
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, "value");
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed and remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- this(annotationAdapter, elementName, removeAnnotationWhenEmpty, true);
- }
-
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty, boolean removeArrayInitializerWhenEmpty) {
- this(new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, removeAnnotationWhenEmpty, buildExpressionConverter(removeArrayInitializerWhenEmpty)));
- }
-
- private static ExpressionConverter<String[]> buildExpressionConverter(boolean removeArrayInitializerWhenEmpty) {
- return new AnnotationStringArrayExpressionConverter(NameStringExpressionConverter.instance(), removeArrayInitializerWhenEmpty);
- }
-
- protected EnumArrayDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter<String[]> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public String[] getValue(ModifiedDeclaration declaration) {
- // ignore the adapter's getValue() - we want the expression
- return this.resolve(this.adapter.expression(declaration), declaration);
- }
-
- public void setValue(String[] value, ModifiedDeclaration declaration) {
- this.adapter.setValue(this.convertToShortNames(value, declaration), declaration);
- }
-
- public Expression expression(ModifiedDeclaration declaration) {
- return this.adapter.expression(declaration);
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- return this.adapter.astNode(declaration);
- }
-
-
- // ********** internal methods **********
-
- /**
- * resolve the enums, which can be
- * null
- * or
- * {FOO, BAR, BAZ}
- * or
- * FOO
- */
- protected String[] resolve(Expression expression, ModifiedDeclaration declaration) {
- if (expression == null) {
- return EMPTY_STRING_ARRAY;
- } else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.resolveArray((ArrayInitializer) expression, declaration);
- } else {
- return this.resolveSingleElement(expression, declaration);
- }
- }
-
- protected String[] resolveArray(ArrayInitializer ai, ModifiedDeclaration declaration) {
- List<Expression> expressions = this.expressions(ai);
- int len = expressions.size();
- String[] enums = new String[len];
- for (int i = len; i-- > 0; ) {
- enums[i] = this.resolveEnum(expressions.get(i));
- }
- return enums;
- }
-
- protected String[] resolveSingleElement(Expression enumExpression, ModifiedDeclaration declaration) {
- return new String[] {this.resolveEnum(enumExpression)};
- }
-
- protected String resolveEnum(Expression expression) {
- return JDTTools.resolveEnum(expression);
- }
-
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /**
- * convert the fully-qualified enums to static imports and short names;
- * NB: the imports are added as a side-effect :-(
- */
- protected String[] convertToShortNames(String[] enums, ModifiedDeclaration declaration) {
- if (enums == null) {
- return null;
- }
- int len = enums.length;
- String[] shortNames = new String[len];
- for (int i = len; i-- > 0; ) {
- declaration.addStaticImport(enums[i]); // e.g. "javax.persistence.CascadeType.REFRESH"
- shortNames[i] = this.shortName(enums[i]); // e.g. "EAGER"
- }
- return shortNames;
- }
-
- protected String shortTypeName(String name) {
- return name.substring(0, name.lastIndexOf('.'));
- }
-
- protected String shortName(String name) {
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index eda5853562..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/EnumDeclarationAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Wrap a declaration annotation element adapter and simply
- * add an import for the enum when necessary.
- */
-public class EnumDeclarationAnnotationElementAdapter
- implements DeclarationAnnotationElementAdapter<String>
-{
- /**
- * The wrapped adapter that returns and takes name strings (enums).
- */
- private final ConversionDeclarationAnnotationElementAdapter<String> adapter;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, "value");
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- this(new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, NameStringExpressionConverter.instance()));
- }
-
- protected EnumDeclarationAnnotationElementAdapter(ConversionDeclarationAnnotationElementAdapter<String> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public String getValue(ModifiedDeclaration declaration) {
- return this.resolve(this.adapter.expression(declaration));
- }
-
- public void setValue(String value, ModifiedDeclaration declaration) {
- this.adapter.setValue(this.convertToShortName(value, declaration), declaration);
- }
-
- public Expression expression(ModifiedDeclaration declaration) {
- return this.adapter.expression(declaration);
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- return this.adapter.astNode(declaration);
- }
-
-
- // ********** internal methods **********
-
- /**
- * resolve the enum
- */
- protected String resolve(Expression expression) {
- return JDTTools.resolveEnum(expression);
- }
-
- /**
- * convert the fully-qualified enum to a static import and its short name
- */
- protected String convertToShortName(String string, ModifiedDeclaration declaration) {
- if (string == null) {
- return null;
- }
- declaration.addStaticImport(string); // e.g. "javax.persistence.FetchType.EAGER"
- return this.shortName(string); // e.g. "EAGER"
- }
-
- protected String shortTypeName(String name) {
- return name.substring(0, name.lastIndexOf('.'));
- }
-
- protected String shortName(String name) {
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.java
deleted file mode 100644
index fce8284cfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Define the protocol for converting an AST expression back and forth
- * from an arbitrary type (e.g. StringLiteral <=> String).
- * T is the type of the object to be converted to and from an expression.
- */
-public interface ExpressionConverter<T> {
-
- /**
- * Convert the specified object to an
- * expression that is owned by the specified AST.
- * The type of the object is determined by the
- * contract specified by the client.
- */
- Expression convert(T object, AST ast);
-
- /**
- * Convert the specified expression to an object of some
- * pre-determined type.
- */
- T convert(Expression expression);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 9f7cd03a5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ExpressionDeclarationAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-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.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Most obvious implementation of the interface.
- * Assume the element's value is an Expression.
- */
-public class ExpressionDeclarationAnnotationElementAdapter<E extends Expression>
- implements DeclarationAnnotationElementAdapter<E>
-{
- /**
- * Adapter used to manipulate the element's annotation.
- */
- private final DeclarationAnnotationAdapter annotationAdapter;
-
- /**
- * The name of the relevant annotation element.
- */
- private final String elementName;
-
- /**
- * Flag to indicate whether the element's annotation is to be
- * completely removed if, when the element itself is removed,
- * the annotation has no remaining elements.
- */
- private final boolean removeAnnotationWhenEmpty;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, "value");
- }
-
- /**
- * The default element name is "value".
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, boolean removeAnnotationWhenEmpty) {
- this(annotationAdapter, "value", removeAnnotationWhenEmpty);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- super();
- this.annotationAdapter = annotationAdapter;
- this.elementName = elementName;
- this.removeAnnotationWhenEmpty = removeAnnotationWhenEmpty;
- }
-
-
- // ********** DeclarationAnnotationElementAdapter implementation **********
-
- public E getValue(ModifiedDeclaration declaration) {
- // return the expression unmodified
- return this.expression(declaration);
- }
-
- public void setValue(E value, ModifiedDeclaration declaration) {
- this.setValue(value, this.annotationAdapter.getAnnotation(declaration), declaration);
- }
-
- public E expression(ModifiedDeclaration declaration) {
- return this.expression(this.annotationAdapter.getAnnotation(declaration));
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- Expression exp = this.expression(declaration);
- return (exp != null) ? exp : this.annotationAdapter.astNode(declaration);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.elementName);
- }
-
-
- // ********** expression **********
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element 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 E expression(Annotation annotation) {
- if (annotation == null) {
- return this.expressionNoAnnotation();
- }
- if (annotation.isMarkerAnnotation()) {
- return this.expressionMarkerAnnotation((MarkerAnnotation) annotation);
- }
- if (annotation.isSingleMemberAnnotation()) {
- return this.expressionSingleMemberAnnotation((SingleMemberAnnotation) annotation);
- }
- if (annotation.isNormalAnnotation()) {
- return this.expressionNormalAnnotation((NormalAnnotation) annotation);
- }
- throw new IllegalArgumentException("unknown annotation type: " + annotation);
- }
-
- protected E expressionNoAnnotation() {
- return null;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionMarkerAnnotation(MarkerAnnotation annotation) {
- return null;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionSingleMemberAnnotation(SingleMemberAnnotation annotation) {
- return this.downcast(this.elementName.equals("value") ? annotation.getValue() : null);
- }
-
- @SuppressWarnings("unchecked")
- private E downcast(Expression e) {
- return (E) e;
- }
-
- /**
- * Return the expression value of the *first* annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected E expressionNormalAnnotation(NormalAnnotation annotation) {
- MemberValuePair pair = this.memberValuePair(annotation);
- return this.downcast((pair == null) ? null : pair.getValue());
- }
-
-
- // ********** set value **********
-
- /**
- * set non-null, non-empty value
- */
- protected void setValue(Expression value, Annotation annotation, ModifiedDeclaration declaration) {
- if (value == null) {
- this.removeElement(annotation, declaration);
- }
- else if (annotation == null) {
- this.setValueNoAnnotation(value, declaration);
- }
- else if (annotation.isMarkerAnnotation()) {
- this.setValueMarkerAnnotation(value, (MarkerAnnotation) annotation, declaration);
- }
- else if (annotation.isSingleMemberAnnotation()) {
- this.setValueSingleMemberAnnotation(value, (SingleMemberAnnotation) annotation, declaration);
- }
- else if (annotation.isNormalAnnotation()) {
- this.setValueNormalAnnotation(value, (NormalAnnotation) annotation, declaration);
- }
- else {
- throw new IllegalArgumentException("unknown annotation type: " + annotation);
- }
- }
-
- /**
- * add non-null, non-empty value
- */
- protected void setValueNoAnnotation(Expression value, ModifiedDeclaration declaration) {
- if (this.elementName.equals("value")) {
- // @Foo("xxx")
- this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(value);
- } else {
- // @Foo(bar="xxx")
- this.addValue(value, this.annotationAdapter.newNormalAnnotation(declaration));
- }
- }
-
- protected void addValue(Expression value, NormalAnnotation annotation) {
- this.addValue(value, annotation, this.elementName);
- }
-
- protected void addValue(Expression value, NormalAnnotation annotation, String annotationElementName) {
- AST ast = annotation.getAST();
- MemberValuePair pair = ast.newMemberValuePair();
- pair.setName(ast.newSimpleName(annotationElementName));
- pair.setValue(value);
- List<MemberValuePair> values = this.values(annotation);
- values.add(pair);
- }
-
- protected void setValueMarkerAnnotation(Expression value, MarkerAnnotation annotation, ModifiedDeclaration declaration) {
- // @Foo => @Foo("xxx")
- // or
- // @Foo => @Foo(bar="xxx")
- this.setValueNoAnnotation(value, declaration);
- }
-
- protected void setValueSingleMemberAnnotation(Expression value, SingleMemberAnnotation annotation, ModifiedDeclaration declaration) {
- if (this.elementName.equals("value")) {
- // @Foo("yyy") => @Foo("xxx")
- annotation.setValue(value);
- } else {
- // @Foo("yyy") => @Foo(value="yyy", bar="xxx")
- Expression vv = annotation.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- NormalAnnotation normalAnnotation = this.annotationAdapter.newNormalAnnotation(declaration);
- this.addValue(vv, normalAnnotation, "value");
- this.addValue(value, normalAnnotation);
- }
- }
-
- protected void setValueNormalAnnotation(Expression value, NormalAnnotation annotation, ModifiedDeclaration declaration) {
- MemberValuePair pair = this.memberValuePair(annotation);
- if (pair == null) {
- this.addValue(value, annotation);
- } else {
- pair.setValue(value);
- }
- }
-
-
- // ********** remove element **********
-
- protected void removeElement(Annotation annotation, ModifiedDeclaration declaration) {
- if (annotation == null) {
- this.removeElementNoAnnotation(declaration);
- }
- else if (annotation.isMarkerAnnotation()) {
- this.removeElementMarkerAnnotation((MarkerAnnotation) annotation, declaration);
- }
- else if (annotation.isSingleMemberAnnotation()) {
- this.removeElementSingleMemberAnnotation((SingleMemberAnnotation) annotation, declaration);
- }
- else if (annotation.isNormalAnnotation()) {
- this.removeElementNormalAnnotation((NormalAnnotation) annotation, declaration);
- }
- else {
- throw new IllegalArgumentException("unknown annotation type: " + annotation);
- }
- }
-
- protected void removeElementNoAnnotation(ModifiedDeclaration declaration) {
- // the element is already gone (?)
- }
-
- protected void removeElementMarkerAnnotation(MarkerAnnotation annotation, ModifiedDeclaration declaration) {
- // the element is already gone (?)
- }
-
- protected void removeElementSingleMemberAnnotation(SingleMemberAnnotation annotation, ModifiedDeclaration declaration) {
- if (this.elementName.equals("value")) {
- if (this.removeAnnotationWhenEmpty) {
- // @Foo("xxx") =>
- this.annotationAdapter.removeAnnotation(declaration);
- } else {
- // @Foo("xxx") => @Foo
- this.annotationAdapter.newMarkerAnnotation(declaration);
- }
- } else {
- // the [non-'value'] element is already gone (?)
- }
- }
-
- protected void removeElementNormalAnnotation(NormalAnnotation annotation, ModifiedDeclaration declaration) {
- List<MemberValuePair> values = this.values(annotation);
- if ((values.size() == 1) && values.get(0).getName().getFullyQualifiedName().equals(this.elementName)) {
- if (this.removeAnnotationWhenEmpty) {
- // @Foo(bar="xxx") =>
- this.annotationAdapter.removeAnnotation(declaration);
- } else {
- // @Foo(bar="xxx") => @Foo
- this.annotationAdapter.newMarkerAnnotation(declaration);
- }
- } else {
- this.removeElement(annotation);
- if (values.size() == 1) {
- MemberValuePair pair = values.get(0);
- if (pair.getName().getFullyQualifiedName().equals("value")) {
- // @Foo(bar="xxx", value="yyy") => @Foo("yyy")
- Expression vv = pair.getValue();
- vv = (Expression) ASTNode.copySubtree(vv.getAST(), vv);
- this.annotationAdapter.newSingleMemberAnnotation(declaration).setValue(vv);
- } else {
- // @Foo(bar="xxx", baz="yyy") => @Foo(baz="yyy")
- }
- } else {
- // @Foo(bar="xxx", baz="yyy", joo="xxx") => @Foo(baz="yyy", joo="xxx")
- }
- }
- }
-
- /**
- * Remove the *first* member value pair from the specified annotation element
- * with the adapter's element name.
- */
- protected void removeElement(NormalAnnotation annotation) {
- for (Iterator<MemberValuePair> stream = this.values(annotation).iterator(); stream.hasNext(); ) {
- MemberValuePair pair = stream.next();
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- stream.remove();
- }
- }
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the *first* member value pair for the specified annotation element
- * with the adapter's element name.
- * Return null if the annotation has no such element.
- */
- protected MemberValuePair memberValuePair(NormalAnnotation annotation) {
- for (MemberValuePair pair : this.values(annotation)) {
- if (pair.getName().getFullyQualifiedName().equals(this.elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- protected List<MemberValuePair> values(NormalAnnotation na) {
- return na.values();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java
deleted file mode 100644
index ba2c468d20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/FieldAttribute.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-
-/**
- * Adapt and extend a jdt field.
- * Attribute based on a Java field, e.g.
- * private int foo;
- */
-public class FieldAttribute extends Attribute {
-
- public FieldAttribute(IField field, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- super(field, modifySharedDocumentCommandExecutorProvider);
- }
-
- public FieldAttribute(IField field, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider, AnnotationEditFormatter annotationEditFormatter) {
- super(field, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- @Override
- public IField getJdtMember() {
- return (IField) super.getJdtMember();
- }
-
-
- // ********** Member implementation **********
-
- @Override
- public FieldDeclaration bodyDeclaration(CompilationUnit astRoot) {
- String fieldName = this.getName();
- for (FieldDeclaration fieldDeclaration : this.declaringTypeDeclaration(astRoot).getFields()) {
- // handle multiple fields declared in a single statement:
- // private int foo, bar;
- for (VariableDeclarationFragment fragment : this.fragments(fieldDeclaration)) {
- if (fragment.getName().getFullyQualifiedName().equals(fieldName)) {
- return fieldDeclaration;
- }
- }
- }
- return null;
- }
-
- private VariableDeclarationFragment fragment(CompilationUnit astRoot) {
- FieldDeclaration fieldDeclaration = bodyDeclaration(astRoot);
- for (VariableDeclarationFragment fragment : this.fragments(fieldDeclaration)) {
- if (fragment.getName().getFullyQualifiedName().equals(getName())) {
- return fragment;
- }
- }
- //TODO could this ever happen, should I throw an exception instead?
- return null;
- }
-
- @Override
- public IVariableBinding binding(CompilationUnit astRoot) {
- return fragment(astRoot).resolveBinding();
- }
-
- // ********** Attribute implementation **********
-
- @Override
- public boolean isField() {
- return true;
- }
-
- @Override
- public String attributeName() {
- return this.getName();
- }
-
- @Override
- public ITypeBinding typeBinding(CompilationUnit astRoot) {
- return bodyDeclaration(astRoot).getType().resolveBinding();
- }
-
- // ********** miscellaneous **********
-
- @SuppressWarnings("unchecked")
- protected List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/GenericVisitor.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/GenericVisitor.java
deleted file mode 100644
index be7b366875..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/GenericVisitor.java
+++ /dev/null
@@ -1,795 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.AnnotationTypeDeclaration;
-import org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration;
-import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.jdt.core.dom.ArrayAccess;
-import org.eclipse.jdt.core.dom.ArrayCreation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.ArrayType;
-import org.eclipse.jdt.core.dom.AssertStatement;
-import org.eclipse.jdt.core.dom.Assignment;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.BlockComment;
-import org.eclipse.jdt.core.dom.BooleanLiteral;
-import org.eclipse.jdt.core.dom.BreakStatement;
-import org.eclipse.jdt.core.dom.CastExpression;
-import org.eclipse.jdt.core.dom.CatchClause;
-import org.eclipse.jdt.core.dom.CharacterLiteral;
-import org.eclipse.jdt.core.dom.ClassInstanceCreation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ConditionalExpression;
-import org.eclipse.jdt.core.dom.ConstructorInvocation;
-import org.eclipse.jdt.core.dom.ContinueStatement;
-import org.eclipse.jdt.core.dom.DoStatement;
-import org.eclipse.jdt.core.dom.EmptyStatement;
-import org.eclipse.jdt.core.dom.EnhancedForStatement;
-import org.eclipse.jdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.ExpressionStatement;
-import org.eclipse.jdt.core.dom.FieldAccess;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.ForStatement;
-import org.eclipse.jdt.core.dom.IfStatement;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.InfixExpression;
-import org.eclipse.jdt.core.dom.Initializer;
-import org.eclipse.jdt.core.dom.InstanceofExpression;
-import org.eclipse.jdt.core.dom.Javadoc;
-import org.eclipse.jdt.core.dom.LabeledStatement;
-import org.eclipse.jdt.core.dom.LineComment;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberRef;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.MethodInvocation;
-import org.eclipse.jdt.core.dom.MethodRef;
-import org.eclipse.jdt.core.dom.MethodRefParameter;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.NullLiteral;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-import org.eclipse.jdt.core.dom.PackageDeclaration;
-import org.eclipse.jdt.core.dom.ParameterizedType;
-import org.eclipse.jdt.core.dom.ParenthesizedExpression;
-import org.eclipse.jdt.core.dom.PostfixExpression;
-import org.eclipse.jdt.core.dom.PrefixExpression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.QualifiedType;
-import org.eclipse.jdt.core.dom.ReturnStatement;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.jdt.core.dom.SuperFieldAccess;
-import org.eclipse.jdt.core.dom.SuperMethodInvocation;
-import org.eclipse.jdt.core.dom.SwitchCase;
-import org.eclipse.jdt.core.dom.SwitchStatement;
-import org.eclipse.jdt.core.dom.SynchronizedStatement;
-import org.eclipse.jdt.core.dom.TagElement;
-import org.eclipse.jdt.core.dom.TextElement;
-import org.eclipse.jdt.core.dom.ThisExpression;
-import org.eclipse.jdt.core.dom.ThrowStatement;
-import org.eclipse.jdt.core.dom.TryStatement;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclarationStatement;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jdt.core.dom.TypeParameter;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jdt.core.dom.WhileStatement;
-import org.eclipse.jdt.core.dom.WildcardType;
-
-//copied from org.eclipse.jdt.internal.corext.dom.GenericVisitor
-//deleted code to limit the number of classes I had to copy
-public class GenericVisitor extends ASTVisitor {
-
- public GenericVisitor() {
- super();
- }
-
- /**
- * @param visitJavadocTags <code>true</code> if doc comment tags are
- * to be visited by default, and <code>false</code> otherwise
- * @see Javadoc#tags()
- * @see #visit(Javadoc)
- * @since 3.0
- */
- public GenericVisitor(boolean visitJavadocTags) {
- super(visitJavadocTags);
- }
-
- //---- Hooks for subclasses -------------------------------------------------
-
- protected boolean visitNode(ASTNode node) {
- return true;
- }
-
- protected void endVisitNode(ASTNode node) {
- // do nothing
- }
-
- @Override
- public boolean visit(AnonymousClassDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ArrayAccess node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ArrayCreation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ArrayInitializer node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ArrayType node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(AssertStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(Assignment node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(Block node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(BooleanLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(BreakStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(CastExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(CatchClause node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(CharacterLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ClassInstanceCreation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(CompilationUnit node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ConditionalExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ConstructorInvocation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ContinueStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(DoStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(EmptyStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ExpressionStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(FieldAccess node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(FieldDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ForStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(IfStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ImportDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(InfixExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(InstanceofExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(Initializer node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(Javadoc node) {
- return (super.visit(node)) ? visitNode(node) : false;
- }
- @Override
- public boolean visit(LabeledStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MethodDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MethodInvocation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(NullLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(NumberLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(PackageDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ParenthesizedExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(PostfixExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(PrefixExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(PrimitiveType node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(QualifiedName node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ReturnStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SimpleName node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SimpleType node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(StringLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SuperConstructorInvocation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SuperFieldAccess node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SuperMethodInvocation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SwitchCase node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SwitchStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SynchronizedStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ThisExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ThrowStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TryStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TypeDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TypeDeclarationStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TypeLiteral node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SingleVariableDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(VariableDeclarationExpression node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(VariableDeclarationStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(VariableDeclarationFragment node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(WhileStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(AnnotationTypeDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(AnnotationTypeMemberDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(BlockComment node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(EnhancedForStatement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(EnumConstantDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(EnumDeclaration node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(LineComment node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MemberRef node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MemberValuePair node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MethodRef node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(MethodRefParameter node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(Modifier node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(NormalAnnotation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(ParameterizedType node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(QualifiedType node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TagElement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TextElement node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(TypeParameter node) {
- return visitNode(node);
- }
- @Override
- public boolean visit(WildcardType node) {
- return visitNode(node);
- }
-
- @Override
- public void endVisit(AnonymousClassDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ArrayAccess node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ArrayCreation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ArrayInitializer node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ArrayType node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(AssertStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(Assignment node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(Block node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(BooleanLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(BreakStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(CastExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(CatchClause node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(CharacterLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ClassInstanceCreation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(CompilationUnit node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ConditionalExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ConstructorInvocation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ContinueStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(DoStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(EmptyStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ExpressionStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(FieldAccess node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(FieldDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ForStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(IfStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ImportDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(InfixExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(InstanceofExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(Initializer node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(Javadoc node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(LabeledStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MethodDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MethodInvocation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(NullLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(NumberLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(PackageDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ParenthesizedExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(PostfixExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(PrefixExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(PrimitiveType node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(QualifiedName node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ReturnStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SimpleName node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SimpleType node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(StringLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SuperConstructorInvocation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SuperFieldAccess node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SuperMethodInvocation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SwitchCase node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SwitchStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SynchronizedStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ThisExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ThrowStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TryStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TypeDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TypeDeclarationStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TypeLiteral node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SingleVariableDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(VariableDeclarationExpression node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(VariableDeclarationStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(VariableDeclarationFragment node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(WhileStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(AnnotationTypeDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(AnnotationTypeMemberDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(BlockComment node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(EnhancedForStatement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(EnumConstantDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(EnumDeclaration node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(LineComment node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MarkerAnnotation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MemberRef node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MemberValuePair node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MethodRef node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(MethodRefParameter node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(Modifier node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(NormalAnnotation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(ParameterizedType node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(QualifiedType node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(SingleMemberAnnotation node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TagElement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TextElement node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(TypeParameter node) {
- endVisitNode(node);
- }
- @Override
- public void endVisit(WildcardType node) {
- endVisitNode(node);
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.java
deleted file mode 100644
index 47ba35c993..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedAnnotationAdapter.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.core.internal.jdtutility;
-
-/**
- * Adapt an indexed Java annotation with a simple-to-use interface.
- */
-public interface IndexedAnnotationAdapter extends AnnotationAdapter {
-
- /**
- * Return the the index at which the annotation is situated.
- */
- int index();
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- void moveAnnotation(int newIndex);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index e3add1b167..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/IndexedDeclarationAnnotationAdapter.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.core.internal.jdtutility;
-
-/**
- * Allow clients to manipulate an annotation within an array of annotations.
- */
-public interface IndexedDeclarationAnnotationAdapter extends DeclarationAnnotationAdapter {
-
- /**
- * Return the the index at which the annotation is situated.
- */
- int getIndex();
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- void moveAnnotation(int newIndex, ModifiedDeclaration declaration);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.java
deleted file mode 100644
index e2426f83b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JDTTools.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.IAnnotationBinding;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-
-public class JDTTools {
-
- // TODO get rid of the "lightweight" methods after reworking how
- // ValidationMessages determine line numbers
- /**
- * Build an AST for the specified member's compilation unit or
- * (source-attached) class file. Build the AST without its bindings
- * resolved.
- */
- public static CompilationUnit buildLightweightASTRoot(IMember member) {
- return buildASTRoot(member, false);
- }
-
- /**
- * Build an AST for the specified member's compilation unit or
- * (source-attached) class file. Build the AST with its bindings
- * resolved (and the resultant performance hit).
- */
- public static CompilationUnit buildASTRoot(IMember member) {
- return buildASTRoot(member, true);
- }
-
- /**
- * Build an AST for the specified member's compilation unit or
- * (source-attached) class file.
- */
- private static CompilationUnit buildASTRoot(IMember member, boolean resolveBindings) {
- return (member.isBinary()) ?
- buildASTRoot(member.getClassFile(), resolveBindings) // the class file must have a source attachment
- :
- buildASTRoot(member.getCompilationUnit(), resolveBindings);
- }
-
- public static CompilationUnit buildASTRoot(IClassFile classFile) {
- return buildASTRoot(classFile, true);
- }
-
- private static CompilationUnit buildASTRoot(IClassFile classFile, boolean resolveBindings) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(classFile);
- parser.setResolveBindings(resolveBindings);
- return (CompilationUnit) parser.createAST(null);
- }
-
- public static CompilationUnit buildASTRoot(ICompilationUnit compilationUnit) {
- return buildASTRoot(compilationUnit, true);
- }
-
- private static CompilationUnit buildASTRoot(ICompilationUnit compilationUnit, boolean resolveBindings) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(compilationUnit);
- parser.setResolveBindings(resolveBindings);
- return (CompilationUnit) parser.createAST(null);
- }
-
- public static String resolveEnum(Expression expression) {
- if (expression == null) {
- return null;
- }
- switch (expression.getNodeType()) {
- case ASTNode.QUALIFIED_NAME:
- case ASTNode.SIMPLE_NAME:
- return resolveEnum((Name) expression);
- default:
- return null;
- }
- }
-
- public static String resolveEnum(Name enumExpression) {
- IBinding binding = enumExpression.resolveBinding();
- if (binding == null) {
- return null; // TODO figure why this is null sometimes
- }
- if (binding.getKind() != IBinding.VARIABLE) {
- return null;
- }
- IVariableBinding variableBinding = (IVariableBinding) binding;
- return variableBinding.getType().getQualifiedName() + "." + variableBinding.getName();
- }
-
- public static String resolveAnnotation(Annotation node) {
- IAnnotationBinding annotationBinding = node.resolveAnnotationBinding();
- if (annotationBinding == null) {
- return null;
- }
- ITypeBinding annotationTypeBinding = annotationBinding.getAnnotationType();
- if (annotationTypeBinding == null) {
- return null;
- }
- return annotationTypeBinding.getQualifiedName();
- }
-
- public static String resolveFullyQualifiedName(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- ITypeBinding resolvedTypeBinding = ((TypeLiteral) expression).getType().resolveBinding();
- if (resolvedTypeBinding != null) {
- return resolvedTypeBinding.getQualifiedName();
- }
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JPTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JPTTools.java
deleted file mode 100644
index 8c3ec2d2b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/JPTTools.java
+++ /dev/null
@@ -1,186 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.Modifier;
-
-public class JPTTools {
-
- /**
- * Return whether the specified field may be "persisted".
- * According to the spec, "All non-transient instance variables that are not
- * annotated with the Transient annotation are persistent."
- */
- public static boolean fieldIsPersistable(IVariableBinding field) {
- int modifiers = field.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return false;
- }
- if (Modifier.isTransient(modifiers)) {
- return false;
- }
- return true;
- }
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- public static boolean methodIsPersistablePropertyGetter(IMethodBinding methodBinding) {
- if (methodHasBadModifiers(methodBinding)) {
- return false;
- }
-
- ITypeBinding returnType = methodBinding.getReturnType();
- if (returnType == null) {
- return false;
- }
- String returnTypeName = returnType.getQualifiedName();
- if (returnTypeName.equals("void")) {
- return false;
- }
- if (methodBinding.getParameterTypes().length != 0) {
- return false;
- }
-
- String methodName = methodBinding.getName();
- int beginIndex = 0;
- boolean booleanGetter = false;
- if (methodName.startsWith("is")) {
- if (returnTypeName.equals("boolean")) {
- beginIndex = 2;
- } else {
- return false;
- }
- } else {
- if (methodName.startsWith("get")) {
- beginIndex = 3;
- if (returnTypeName.equals("boolean")) {
- booleanGetter = true;
- }
- } else {
- return false;
- }
- }
-
- String capitalizedAttributeName = methodName.substring(beginIndex);
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty()
- // (see the JavaBeans spec 1.01)
- if (booleanGetter) {
- IMethodBinding isMethod = methodBindingNoParameters(methodBinding.getDeclaringClass(), "is" + capitalizedAttributeName);
- if (isMethod == null) {
- return false;
- }
- if (isMethod.getReturnType().getName().equals("boolean")) {
- return false;
- }
- }
- IMethodBinding setMethod = methodBindingOneParameter(methodBinding.getDeclaringClass(), "set" + capitalizedAttributeName, returnTypeName);
- if (setMethod == null) {
- return false;
- }
- if (methodHasBadModifiers(setMethod)) {
- return false;
- }
- if ( ! setMethod.getReturnType().getName().equals("void")) {
- return false;
- }
- return true;
- }
-
- private static IMethodBinding methodBindingNoParameters(ITypeBinding typeBinding, String methodName) {
- for (IMethodBinding method : typeBinding.getDeclaredMethods()) {
- if (method.getName().equals(methodName)) {
- if (method.getParameterTypes().length == 0) {
- return method;
- }
- }
- }
- return null;
- }
-
- private static IMethodBinding methodBindingOneParameter(ITypeBinding typeBinding, String methodName, String parameterTypeName) {
- for (IMethodBinding method : typeBinding.getDeclaredMethods()) {
- if (method.getName().equals(methodName)) {
- if (method.getParameterTypes().length == 1) {
- if (method.getParameterTypes()[0].getQualifiedName().equals(parameterTypeName)) {
- return method;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasBadModifiers(IMethodBinding methodBinding) {
- if (methodBinding.isConstructor()) {
- return true;
- }
- int modifiers = methodBinding.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- if (Modifier.isFinal(modifiers)) {
- return true;
- }
- if ( ! (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers))) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the type may be "persisted", ie marked as Entity, MappedSuperclass, Embeddable
- */
- //TODO should persistability be dependent on having a no-arg constructor or should that just be validation?
- //seems like final, or a member type being static could be dealt with through validation instead of filtering them out.
- public static boolean typeIsPersistable(ITypeBinding typeBinding) {
- if (typeBinding.isInterface()) {
- return false;
- }
- if (typeBinding.isAnnotation()) {
- return false;
- }
- if (typeBinding.isEnum()) {
- return false;
- }
- if (typeBinding.isLocal()) {
- return false;
- }
- if (typeBinding.isAnonymous()) {
- return false;
- }
- int modifiers = typeBinding.getModifiers();
- if (Modifier.isFinal(modifiers)) {
- return false;
- }
- if (typeBinding.isMember()) {
- if (!Modifier.isStatic(modifiers)) {
- return false;
- }
- }
- return true;
- }
-
- public static boolean typeIsAbstract(ITypeBinding typeBinding) {
- return Modifier.isAbstract(typeBinding.getModifiers());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java
deleted file mode 100644
index b6237bc18f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Member.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.SimpleTextRange;
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-/**
- * Adapt and extend a JDT member with simplified annotation handling.
- */
-public abstract class Member {
-
- private final IMember jdtMember;
-
- /** this will be null for a top-level type */
- private final Type declaringType;
-
- private final CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- private final AnnotationEditFormatter annotationEditFormatter;
-
- // ********** constructor **********
-
- Member(IMember jdtMember, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- this(jdtMember, modifySharedDocumentCommandExecutorProvider, DefaultAnnotationEditFormatter.instance());
- }
-
- Member(IMember jdtMember, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider, AnnotationEditFormatter annotationEditFormatter) {
- super();
- this.jdtMember = jdtMember;
- IType jdtDeclaringType = jdtMember.getDeclaringType();
- this.declaringType = (jdtDeclaringType == null) ? null : new Type(jdtDeclaringType, modifySharedDocumentCommandExecutorProvider);
- this.modifySharedDocumentCommandExecutorProvider = modifySharedDocumentCommandExecutorProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- }
-
-
- // ********** accessors **********
-
- public IMember getJdtMember() {
- return this.jdtMember;
- }
-
- public boolean wraps(IMember member) {
- return this.jdtMember.exists()
- && this.jdtMember.equals(member);
- }
-
- /**
- * this will return null for a top-level type
- */
- public Type getDeclaringType() {
- return this.declaringType;
- }
-
- public abstract IBinding binding(CompilationUnit astRoot);
-
- // ********** miscellaneous **********
-
- public ICompilationUnit compilationUnit() {
- return this.jdtMember.getCompilationUnit();
- }
-
- public String getName() {
- return this.jdtMember.getElementName();
- }
-
- public Type topLevelDeclaringType() {
- return this.declaringType.topLevelDeclaringType();
- }
-
- /**
- * note: this creates a *new* AST
- */
- public CompilationUnit astRoot() {
- return JDTTools.buildASTRoot(this.jdtMember);
- }
-
- /**
- * note: this creates a *new* AST
- */
- private CompilationUnit lightweightASTRoot() {
- return JDTTools.buildLightweightASTRoot(this.jdtMember);
- }
-
- public ModifiedDeclaration modifiedDeclaration() {
- return this.modifiedDeclaration(this.astRoot());
- }
-
- public ModifiedDeclaration modifiedDeclaration(CompilationUnit astRoot) {
- return new ModifiedDeclaration(this.bodyDeclaration(astRoot));
- }
-
- public TextRange textRange() {
- return this.textRange(this.lightweightASTRoot());
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return this.textRange(this.bodyDeclaration(astRoot));
- }
-
- TextRange textRange(ASTNode astNode) {
- return (astNode == null) ? null : new ASTNodeTextRange(astNode);
- }
-
- public TextRange nameTextRange() {
- return this.nameTextRange(this.lightweightASTRoot());
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- ISourceRange sourceRange = this.nameSourceRange();
- return
- new SimpleTextRange(
- sourceRange.getOffset(),
- sourceRange.getLength(),
- astRoot.getLineNumber(sourceRange.getOffset())
- );
- }
-
- private ISourceRange nameSourceRange() {
- try {
- return this.jdtMember.getNameRange();
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return the member's body declaration.
- */
- public abstract BodyDeclaration bodyDeclaration(CompilationUnit astRoot);
-
-
- // ********** annotations **********
-
- public Annotation annotation(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) {
- return adapter.getAnnotation(this.modifiedDeclaration(astRoot));
- }
-
- public Annotation annotation(DeclarationAnnotationAdapter adapter) {
- return this.annotation(adapter, this.astRoot());
- }
-
- public boolean containsAnnotation(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) {
- return this.annotation(adapter, astRoot) != null;
- }
-
- public boolean containsAnnotation(DeclarationAnnotationAdapter adapter) {
- return this.containsAnnotation(adapter, this.astRoot());
- }
-
- /**
- * Return whether the member contains any one of the specified annotations.
- */
- public boolean containsAnyAnnotation(DeclarationAnnotationAdapter[] adapters) {
- return this.containsAnyAnnotation(adapters, this.astRoot());
- }
-
- /**
- * Return whether the member contains any one of the specified annotations.
- */
- public boolean containsAnyAnnotation(DeclarationAnnotationAdapter[] adapters, CompilationUnit astRoot) {
- for (DeclarationAnnotationAdapter adapter : adapters) {
- if (this.containsAnnotation(adapter, astRoot)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the text range corresponding to the specified annotation.
- * If the annotation is missing, return null.
- */
- public TextRange annotationTextRange(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) {
- return this.textRange(this.annotation(adapter, astRoot));
- }
-
- /**
- * Return the text range corresponding to the specified annotation.
- * If the annotation is missing, return null.
- */
- public TextRange annotationTextRange(DeclarationAnnotationAdapter adapter) {
- return this.annotationTextRange(adapter, this.astRoot());
- }
-
- /**
- * Return the AST node corresponding to the specified annotation.
- * If the annotation is missing, return its parent node.
- */
- public ASTNode annotationASTNode(DeclarationAnnotationAdapter adapter, CompilationUnit astRoot) {
- return adapter.astNode(this.modifiedDeclaration(astRoot));
- }
-
- /**
- * Return the AST node corresponding to the specified annotation.
- * If the annotation is missing, return its parent node.
- */
- public ASTNode annotationASTNode(DeclarationAnnotationAdapter adapter) {
- return this.annotationASTNode(adapter, this.astRoot());
- }
-
- /**
- * Add the specified marker annotation to the member.
- */
- public void newMarkerAnnotation(final DeclarationAnnotationAdapter adapter) {
- this.edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- adapter.newMarkerAnnotation(declaration);
- }
- });
- }
-
- /**
- * Add the specified single member annotation to the member.
- */
- public void newSingleMemberAnnotation(final DeclarationAnnotationAdapter adapter) {
- this.edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- adapter.newSingleMemberAnnotation(declaration);
- }
- });
- }
-
- /**
- * Add the specified normal annotation to the member.
- */
- public void newNormalAnnotation(final DeclarationAnnotationAdapter adapter) {
- this.edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- adapter.newNormalAnnotation(declaration);
- }
- });
- }
-
- /**
- * Remove the specified annotation from the member.
- */
- public void removeAnnotation(final DeclarationAnnotationAdapter adapter) {
- this.edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- adapter.removeAnnotation(declaration);
- }
- });
- }
-
-
- // ********** annotation elements **********
-
- public <T> T annotationElementValue(DeclarationAnnotationElementAdapter<T> adapter, CompilationUnit astRoot) {
- return adapter.getValue(this.modifiedDeclaration(astRoot));
- }
-
- public <T> T annotationElementValue(DeclarationAnnotationElementAdapter<T> adapter) {
- return this.annotationElementValue(adapter, this.astRoot());
- }
-
- public Expression annotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.expression(this.modifiedDeclaration(astRoot));
- }
-
- public Expression annotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter) {
- return this.annotationElementExpression(adapter, this.astRoot());
- }
-
- public boolean containsAnnotationElement(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return this.annotationElementExpression(adapter, astRoot) != null;
- }
-
- public boolean containsAnnotationElement(DeclarationAnnotationElementAdapter<?> adapter) {
- return this.containsAnnotationElement(adapter, this.astRoot());
- }
-
- /**
- * Return the text range corresponding to the specified element.
- * If the element is missing, return null.
- */
- public TextRange annotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return this.textRange(this.annotationElementExpression(adapter, astRoot));
- }
-
- /**
- * Return the text range corresponding to the specified element.
- * If the element is missing, return null.
- */
- public TextRange annotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter) {
- return this.annotationElementTextRange(adapter, this.astRoot());
- }
-
- /**
- * Return the AST node corresponding to the specified element.
- * If the element is missing, return its parent node.
- */
- public ASTNode annotationElementASTNode(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.astNode(this.modifiedDeclaration(astRoot));
- }
-
- /**
- * Return the AST node corresponding to the specified element.
- * If the element is missing, return its parent node.
- */
- public ASTNode annotationElementASTNode(DeclarationAnnotationElementAdapter<?> adapter) {
- return this.annotationElementASTNode(adapter, this.astRoot());
- }
-
- /**
- * Set the value of the specified element.
- */
- public <T> void setAnnotationElementValue(final DeclarationAnnotationElementAdapter<T> adapter, final T value) {
- this.edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- adapter.setValue(value, declaration);
- }
- });
- }
-
-
- // ********** editing **********
-
- /**
- * Edit the member with the specified editor.
- * The editor will be invoked once the member's compilation unit
- * is in an editable state.
- */
- public void edit(Editor editor) {
- try {
- this.edit_(editor);
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- } catch (BadLocationException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * NB: Be careful changing this method.
- * Things to look out for:
- * - when editing via the JavaEditor there is no need to create a working copy
- * - when editing headlessly, a "working copy" must be created
- * (at least as far as I can tell ~kfm)
- * - when editing via a plain text editor, make a working copy or else things are screwed
- * up the second time you edit through the XmlPersistence XmlProperties View
- */
- private void edit_(Editor editor) throws JavaModelException, BadLocationException {
- ICompilationUnit compilationUnit = this.compilationUnit();
- if ( ! compilationUnit.isWorkingCopy()) {
- compilationUnit.becomeWorkingCopy(null);
- }
-
- ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(compilationUnit.getResource().getFullPath(), LocationKind.NORMALIZE);
- boolean sharedDocument = (buffer != null); // documents are typically shared when they are already open in an editor
- IDocument doc = sharedDocument ?
- buffer.getDocument()
- :
- new Document(compilationUnit.getBuffer().getContents());
-
- CompilationUnit astRoot = this.astRoot();
- astRoot.recordModifications();
-
- editor.edit(this.modifiedDeclaration(astRoot));
-
- TextEdit edits = astRoot.rewrite(doc, compilationUnit.getJavaProject().getOptions(true));
- if (sharedDocument) {
- this.modifySharedDocumentCommandExecutor().execute(new ModifySharedDocumentCommand(edits, doc));
- } else {
- this.applyEdits(edits, doc);
- }
-
- if ( ! sharedDocument) {
- compilationUnit.getBuffer().setContents(doc.get());
- compilationUnit.commitWorkingCopy(true, null); // true="force"
- compilationUnit.discardWorkingCopy();
- }
- }
-
- /**
- * apply the specified edits to the specified document,
- * reformatting the document if necessary
- */
- void applyEdits(TextEdit edits, IDocument doc) throws MalformedTreeException, BadLocationException {
- edits.apply(doc, TextEdit.UPDATE_REGIONS);
- this.annotationEditFormatter().format(doc, edits);
- }
-
- private AnnotationEditFormatter annotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- private CommandExecutor modifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutorProvider.commandExecutor();
- }
-
-
- // ********** "editor" interface **********
-
- /**
- * This interface defines a callback that is invoked when the member's
- * compilation unit is in a state to be manipulated.
- */
- public interface Editor {
-
- /**
- * Edit the specified declaration.
- */
- void edit(ModifiedDeclaration declaration);
-
- }
-
-
- // ********** modify shared document command class **********
-
- /**
- * simple command that calls back to the member to apply the edits
- * in the same way as if the document were not shared
- */
- class ModifySharedDocumentCommand implements Command {
- private final TextEdit edits;
- private final IDocument doc;
-
- ModifySharedDocumentCommand(TextEdit edits, IDocument doc) {
- super();
- this.edits = edits;
- this.doc = doc;
- }
-
- public void execute() {
- try {
- Member.this.applyEdits(this.edits, this.doc);
- } catch (MalformedTreeException ex) {
- throw new RuntimeException(ex);
- } catch (BadLocationException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.java
deleted file mode 100644
index 2ab8e28a5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationAdapter.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.core.internal.jdtutility;
-
-/**
- * Adapt a member and a declaration annotation adapter.
- */
-public class MemberAnnotationAdapter extends AbstractAnnotationAdapter {
-
-
- // ********** constructor **********
-
- public MemberAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) {
- super(member, daa);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.java
deleted file mode 100644
index 7c4d725480..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.utility.internal.StringTools;
-
- /**
- * Adapt a member and a declaration annotation element adapter.
- */
-public class MemberAnnotationElementAdapter<T>
- implements AnnotationElementAdapter<T>
-{
- private final Member member;
- private final DeclarationAnnotationElementAdapter<T> daea;
-
-
- // ********** constructor **********
-
- public MemberAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) {
- super();
- this.member = member;
- this.daea = daea;
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- public T getValue() {
- return this.daea.getValue(this.member.modifiedDeclaration());
- }
-
- public T getValue(CompilationUnit astRoot) {
- return this.daea.getValue(this.member.modifiedDeclaration(astRoot));
- }
-
- public void setValue(T value) {
- this.edit(this.buildSetValueEditor(value));
- }
-
- public Expression expression() {
- return this.daea.expression(this.member.modifiedDeclaration());
- }
-
- public Expression expression(CompilationUnit astRoot) {
- return this.daea.expression(this.member.modifiedDeclaration(astRoot));
- }
-
- public ASTNode astNode() {
- return this.daea.astNode(this.member.modifiedDeclaration());
- }
-
- public ASTNode astNode(CompilationUnit astRoot) {
- return this.daea.astNode(this.member.modifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daea);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(Member.Editor editor) {
- this.member.edit(editor);
- }
-
- protected Member.Editor buildSetValueEditor(T value) {
- return new SetValueEditor<T>(value, this.daea);
- }
-
-
- // ********** member classes **********
-
- protected static class SetValueEditor<T> implements Member.Editor {
- private final DeclarationAnnotationElementAdapter<T> daea;
- private final T value;
-
- SetValueEditor(T value, DeclarationAnnotationElementAdapter<T> daea) {
- super();
- this.value = value;
- this.daea = daea;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.daea.setValue(this.value, declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.java
deleted file mode 100644
index 2358e4ec39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MemberIndexedAnnotationAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Adapt a member and an indexed declaration annotation adapter.
- */
-public class MemberIndexedAnnotationAdapter
- extends AbstractAnnotationAdapter
- implements IndexedAnnotationAdapter
-{
- private final IndexedDeclarationAnnotationAdapter idaa;
-
-
- // ********** constructor **********
-
- public MemberIndexedAnnotationAdapter(Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(member, idaa);
- this.idaa = idaa;
- }
-
-
- // ********** IndexedAnnotationAdapter implementation **********
-
- public int index() {
- return this.idaa.getIndex();
- }
-
- public void moveAnnotation(int newIndex) {
- this.edit(this.buildMoveAnnotationEditor(newIndex));
- }
-
-
- // ********** factory methods **********
-
- protected Member.Editor buildMoveAnnotationEditor(int newIndex) {
- return new MoveAnnotationEditor(this.idaa, newIndex);
- }
-
-
- // ********** member classes **********
-
- protected static class MoveAnnotationEditor implements Member.Editor {
- private final IndexedDeclarationAnnotationAdapter idaa;
- private int index;
-
- MoveAnnotationEditor(IndexedDeclarationAnnotationAdapter idaa, int index) {
- super();
- this.idaa = idaa;
- this.index = index;
- }
- public void edit(ModifiedDeclaration declaration) {
- this.idaa.moveAnnotation(this.index, declaration);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java
deleted file mode 100644
index cc465da546..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/MethodAttribute.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import java.beans.Introspector;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-
-/**
- * Adapt and extend a jdt method.
- * Attribute based on a Java property, e.g.
- * private int getFoo() {
- * return foo;
- * }
- * private void setFoo(int foo) {
- * this.foo = foo;
- * }
- *
- * For now we only hold the getter method, since that's where the
- * annotations are put.
- */
-public class MethodAttribute extends Attribute {
-
- public MethodAttribute(IMethod getMethod, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- super(getMethod, modifySharedDocumentCommandExecutorProvider);
- }
-
- public MethodAttribute(IMethod getMethod, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider, AnnotationEditFormatter annotationEditFormatter) {
- super(getMethod, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- @Override
- public IMethod getJdtMember() {
- return (IMethod) super.getJdtMember();
- }
-
-
- // ********** Member implementation **********
-
- @Override
- public MethodDeclaration bodyDeclaration(CompilationUnit astRoot) {
- try {
- return ASTNodeSearchUtil.getMethodDeclarationNode(getJdtMember(), astRoot);
- } catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public IMethodBinding binding(CompilationUnit astRoot) {
- return bodyDeclaration(astRoot).resolveBinding();
- }
-
- // ********** Attribute implementation **********
-
- @Override
- public boolean isMethod() {
- return true;
- }
-
- /**
- * "foo" returned for a method named "getFoo" or "isFoo"
- */
- @Override
- public String attributeName() {
- String methodName = super.getName();
- int beginIndex = 0;
- if (methodName.startsWith("get")) {
- beginIndex = 3;
- } else if (methodName.startsWith("is")) {
- beginIndex = 2;
- }
- return Introspector.decapitalize(methodName.substring(beginIndex));
- }
-
- @Override
- public ITypeBinding typeBinding(CompilationUnit astRoot) {
- IMethodBinding methodBinding = bodyDeclaration(astRoot).resolveBinding();
- if (methodBinding != null) {
- return methodBinding.getReturnType();
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java
deleted file mode 100644
index e018eca002..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ModifiedDeclaration.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.ImportDeclaration;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * Define a wrapper that provides a common protocol for all the various AST
- * declarations that have modifiers (i.e. there are a number of AST node
- * classes that implement the method #modifiers(), but they do not implement
- * a common interface):
- * BodyDeclaration
- * SingleVariableDeclaration
- * VariableDeclarationExpression
- * VariableDeclarationStatement
- */
-public class ModifiedDeclaration {
- private final Adapter adapter;
-
-
- // ********** constructors **********
-
- public ModifiedDeclaration(Adapter adapter) {
- super();
- this.adapter = adapter;
- }
-
- public ModifiedDeclaration(BodyDeclaration declaration) {
- this(new BodyDeclarationAdapter(declaration));
- }
-
- public ModifiedDeclaration(SingleVariableDeclaration declaration) {
- this(new SingleVariableDeclarationAdapter(declaration));
- }
-
- public ModifiedDeclaration(VariableDeclarationExpression declaration) {
- this(new VariableDeclarationExpressionAdapter(declaration));
- }
-
- public ModifiedDeclaration(VariableDeclarationStatement declaration) {
- this(new VariableDeclarationStatementAdapter(declaration));
- }
-
-
- // ********** public methods **********
-
- /**
- * Return the "declaration" AST node.
- */
- public ASTNode getDeclaration() {
- return this.adapter.declaration();
- }
-
- /**
- * Return the declaration's list of modifiers.
- * Element type: org.eclipse.jdt.core.dom.IExtendedModifier
- */
- public List<IExtendedModifier> modifiers() {
- return this.adapter.modifiers();
- }
-
- /**
- * Return the "declaration" AST.
- */
- public AST getAST() {
- return this.getDeclaration().getAST();
- }
-
- public CompilationUnit compilationUnit() {
- return (CompilationUnit) this.getDeclaration().getRoot();
- }
-
- public ICompilationUnit iCompilationUnit() {
- return (ICompilationUnit) this.compilationUnit().getJavaElement();
- }
-
- public IType type() {
- return this.compilationUnit().getTypeRoot().findPrimaryType();
- }
-
- /**
- * Return the declaration's annotations.
- */
- public Iterator<Annotation> annotations() {
- return new FilteringIterator<IExtendedModifier, Annotation>(this.modifiers().iterator()) {
- @Override
- protected boolean accept(IExtendedModifier next) {
- return next.isAnnotation();
- }
- };
- }
-
- /**
- * Return the *first* annotation with the specified name.
- * Return null if the declaration has no such annotation.
- */
- public Annotation getAnnotationNamed(String annotationName) {
- for (Iterator<Annotation> stream = this.annotations(); stream.hasNext(); ) {
- Annotation annotation = stream.next();
- if (this.annotationIsNamed(annotation, annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- /**
- * Return whether the declaration has an annotation with the specified name.
- */
- public boolean containsAnnotationNamed(String annotationName) {
- return this.getAnnotationNamed(annotationName) != null;
- }
-
- /**
- * Add the specified annotation to the declaration.
- * By convention annotations precede the "standard" (JLS2) modifiers;
- * though, technically, they can be interspersed.
- */
- public void addAnnotation(Annotation annotation) {
- List<IExtendedModifier> modifiers = this.modifiers();
- for (ListIterator<IExtendedModifier> stream = modifiers.listIterator(); stream.hasNext(); ) {
- if (stream.next().isModifier()) {
- stream.previous(); // put the annotation *before* the first "standard" (JLS2) modifier
- stream.add(annotation);
- return;
- }
- }
- modifiers.add(annotation); // just tack it on to the end
- }
-
- /**
- * Remove the *first* annotation with the specified name from the declaration.
- */
- public void removeAnnotationNamed(String annotationName) {
- for (Iterator<IExtendedModifier> stream = this.modifiers().iterator(); stream.hasNext(); ) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isAnnotation()) {
- if (this.annotationIsNamed((Annotation) modifier, annotationName)) {
- stream.remove();
- break;
- }
- }
- }
- }
-
- /**
- * Remove the specified annotation from the declaration.
- */
- public void removeAnnotation(Annotation annotation) {
- if ( ! this.modifiers().remove(annotation)) {
- throw new IllegalArgumentException("invalid annotation: " + annotation);
- }
- }
-
- /**
- * Replace the specified old annotation with the specified new annotation.
- */
- public void replaceAnnotation(Annotation oldAnnotation, Annotation newAnnotation) {
- for (ListIterator<IExtendedModifier> stream = this.modifiers().listIterator(); stream.hasNext(); ) {
- if (stream.next().equals(oldAnnotation)) {
- stream.set(newAnnotation);
- return;
- }
- }
- throw new IllegalArgumentException("invalid old annotation: " + oldAnnotation);
- }
-
- /**
- * Replace the specified old annotation with the specified new annotation.
- * If there is no annotation with the specified name, simply add the new
- * annotation to the declaration's modifiers.
- */
- public void replaceAnnotationNamed(String oldAnnotationName, Annotation newAnnotation) {
- List<IExtendedModifier> modifiers = this.modifiers();
- for (ListIterator<IExtendedModifier> stream = modifiers.listIterator(); stream.hasNext(); ) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isAnnotation()) {
- if (this.annotationIsNamed((Annotation) modifier, oldAnnotationName)) {
- stream.set(newAnnotation);
- return;
- }
- }
- }
- this.addAnnotation(newAnnotation);
- }
-
- /**
- * Add the specified import to the declaration's compilation unit.
- */
- public void addImport(String importName) {
- this.addImport(importName, false);
- }
-
- /**
- * Add the specified static import to the declaration's compilation unit.
- */
- public void addStaticImport(String importName) {
- this.addImport(importName, true);
- }
-
- /**
- * Add the specified import to the declaration's compilation unit.
- */
- public void addImport(String importName, boolean static_) {
- if (importName.indexOf('.') != -1) {
- this.addImportTo(this.compilationUnit(), importName, static_);
- }
- }
-
- public String importFor(String shortName) {
- return this.importFor(shortName, false);
- }
-
- public String staticImportFor(String shortName) {
- return this.importFor(shortName, true);
- }
-
- // TODO handle wildcards
- public String importFor(String shortName, boolean static_) {
- if (shortName.indexOf('.') != -1) {
- return shortName;
- }
- List<ImportDeclaration> imports = this.imports(this.compilationUnit());
- for (ImportDeclaration importDeclaration : imports) {
- if (this.importIsFor(importDeclaration, shortName, static_)) {
- return importDeclaration.getName().getFullyQualifiedName();
- }
- }
- return null;
- }
-
- protected boolean importIsFor(ImportDeclaration importDeclaration, String shortName, boolean static_) {
- if (importDeclaration.isStatic() != static_) {
- return false;
- }
- String importDeclarationName = importDeclaration.getName().getFullyQualifiedName();
- return importDeclarationName.endsWith(shortName);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter.toString());
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return whether the specified annotation has the specified name.
- */
- boolean annotationIsNamed(Annotation annotation, String name) {
- String qualifiedName = this.qualifiedName(annotation);
- return (qualifiedName != null) && qualifiedName.equals(name);
- }
-
- // TODO?
- private String qualifiedName(Annotation annotation) {
- ITypeBinding typeBinding = annotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- // hack(?): check for a matching import because when moving a stand-alone
- // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter
- // the container's import is added but then it won't "resolve" upon
- // subsequent lookups... :-(
- return this.importFor(annotation.getTypeName().getFullyQualifiedName()); // look for a matching import
-
- // OLD METHOD SOURCE:
-// String name = annotation.getTypeName().getFullyQualifiedName();
-// if (name.indexOf('.') != -1) {
-// return name; // name is already qualified
-// }
-// String resolvedName = JDTTools.resolve(name, this.type());
-// // hack(?): check for a matching import because when moving a stand-alone
-// // annotation to its container in CombinationIndexedDeclarationAnnotationAdapter
-// // the container's import is added but then it won't "resolve" upon
-// // subsequent lookups... :-(
-// return this.importFor(name); // look for a matching import
- }
-
- /**
- * Return whether the specified import was added without a collision.
- */
- // TODO handle collisions (e.g. java.util.Date vs. java.sql.Date)
- protected void addImportTo(CompilationUnit astRoot, String importName, boolean static_) {
- List<ImportDeclaration> imports = this.imports(astRoot);
- if (this.importsInclude(imports, importName, static_)) {
- return;
- }
- AST ast = astRoot.getAST();
- ImportDeclaration import_ = ast.newImportDeclaration();
- import_.setName(ast.newName(importName));
- import_.setStatic(static_);
- imports.add(import_);
- }
-
- @SuppressWarnings("unchecked")
- protected List<ImportDeclaration> imports(CompilationUnit astRoot) {
- return astRoot.imports();
- }
-
- protected boolean importsInclude(List<ImportDeclaration> imports, String importName, boolean static_) {
- for (ImportDeclaration importDeclaration : imports) {
- if (this.importIncludes(importDeclaration, importName, static_)) {
- return true;
- }
- }
- return false;
- }
-
- protected boolean importIncludes(ImportDeclaration importDeclaration, String importName, boolean static_) {
- if (importDeclaration.isStatic() != static_) {
- return false;
- }
- String importDeclarationName = importDeclaration.getName().getFullyQualifiedName();
- if (importName.equals(importDeclarationName)) {
- return true;
- }
- if (importDeclaration.isOnDemand()
- && this.onDemandNameFor(importName).equals(importDeclarationName)) {
- return true;
- }
- return false;
- }
-
- protected String onDemandNameFor(String importName) {
- int lastPeriod = importName.lastIndexOf('.');
- return (lastPeriod == -1) ? "" : importName.substring(0, lastPeriod);
- }
-
-
- // ********** declaration adapter interface and implementations **********
-
- /**
- * Define common protocol among the various "declarations".
- */
- public interface Adapter {
-
- /**
- * Return the adapted "declaration".
- */
- ASTNode declaration();
-
- /**
- * Return the "declaration"'s list of modifiers.
- * Element type: org.eclipse.jdt.core.dom.IExtendedModifier
- */
- List<IExtendedModifier> modifiers();
-
- }
-
- public static class BodyDeclarationAdapter implements Adapter {
- private final BodyDeclaration declaration;
- public BodyDeclarationAdapter(BodyDeclaration declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode declaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> modifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class SingleVariableDeclarationAdapter implements Adapter {
- private final SingleVariableDeclaration declaration;
- public SingleVariableDeclarationAdapter(SingleVariableDeclaration declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode declaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> modifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class VariableDeclarationExpressionAdapter implements Adapter {
- private final VariableDeclarationExpression declaration;
- public VariableDeclarationExpressionAdapter(VariableDeclarationExpression declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode declaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> modifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
- public static class VariableDeclarationStatementAdapter implements Adapter {
- private final VariableDeclarationStatement declaration;
- public VariableDeclarationStatementAdapter(VariableDeclarationStatement declaration) {
- super();
- this.declaration = declaration;
- }
- public ASTNode declaration() {
- return this.declaration;
- }
- @SuppressWarnings("unchecked")
- public List<IExtendedModifier> modifiers() {
- return this.declaration.modifiers();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.declaration.toString());
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.java
deleted file mode 100644
index bbd572af0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NameStringExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.Name;
-
-/**
- * Convert a name to/from a string representation of a name/identifier
- * (e.g. "com.xxx.Foo.VALUE1" or "value").
- */
-public final class NameStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new NameStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NameStringExpressionConverter() {
- super();
- }
-
- @Override
- protected Name convertObject(String string, AST ast) {
- return ast.newName(string);
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- switch (expression.getNodeType()) {
- case ASTNode.QUALIFIED_NAME:
- case ASTNode.SIMPLE_NAME:
- return ((Name) expression).getFullyQualifiedName();
- default:
- return null;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index b373a16599..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,93 +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.internal.jdtutility;
-
-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.SingleMemberAnnotation;
-
-/**
- * Manipulate an annotation that is embedded as an element within
- * another annotation, e.g.
- * <pre>
- * &#64;Outer(foo=&#64;Inner)
- * private int id;
- * outerAnnotationAdapter = AnnotationAdapter<&#64;Outer>
- * elementName = "foo"
- * annotationName = "Inner"
- * </pre>
- */
-public class NestedDeclarationAnnotationAdapter extends AbstractNestedDeclarationAnnotationAdapter {
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) {
- super(outerAnnotationAdapter, annotationName);
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) {
- super(outerAnnotationAdapter, elementName, annotationName);
- }
-
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(outerAnnotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty);
- }
-
-
- // ********** AbstractNestedDeclarationAnnotationAdapter implementation **********
-
- @Override
- protected Annotation getAnnotation(Expression value) {
- return this.annotationValue(value);
- }
-
- @Override
- protected Expression buildNewInnerExpression(Annotation inner) {
- return inner;
- }
-
- /**
- * the annotation is the expression itself, so the annotation cannot be
- * "removed" from itself - return 'false'
- */
- @Override
- protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) {
- return false;
- }
-
- /**
- * <pre>
- * &#64;Outer("lorem ipsum") => &#64;Outer(&#64;Inner)
- * </pre>
- */
- @Override
- protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) {
- // replace(?) the current element value
- outer.setValue(inner);
- }
-
- /**
- * Simply set the pair's value.
- */
- @Override
- protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) {
- pair.setValue(inner);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 78a9988d76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NestedIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,331 +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.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-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.SingleMemberAnnotation;
-
-/**
- * Manipulate an annotation that is embedded in an element array within
- * another annotation, e.g.
- * <pre>
- * &#64;Outer(foo={&#64;Inner("zero"), &#64;Inner("one"), &#64;Inner("two")})
- * private int id;
- * outerAnnotationAdapter = AnnotationAdapter<&#64;Outer>
- * elementName = "foo"
- * index = 0-2
- * annotationName = "Inner"
- * </pre>
- */
-public class NestedIndexedDeclarationAnnotationAdapter
- extends AbstractNestedDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
- private int index;
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, int index, String annotationName) {
- super(annotationAdapter, annotationName);
- this.index = index;
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName) {
- super(annotationAdapter, elementName, annotationName);
- this.index = index;
- }
-
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(annotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty);
- this.index = index;
- }
-
-
- // ********** AbstractNestedDeclarationAnnotationAdapter implementation **********
-
- @Override
- protected Annotation getAnnotation(Expression value) {
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- return this.getAnnotation((ArrayInitializer) value);
- }
- return (this.index == 0) ? this.annotationValue(value) : null;
- }
-
- @Override
- protected Expression buildNewInnerExpression(Annotation inner) {
- return (this.index == 0) ? inner : (Expression) this.buildNewInnerArrayInitializer(inner);
- }
-
- @Override
- protected boolean removeAnnotation(ModifiedDeclaration declaration, Annotation outer, Expression value) {
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- this.removeAnnotation(declaration, outer, (ArrayInitializer) value);
- return true;
- }
- // if our index is greater than zero, but we don't have an array,
- // then the annotation must already be gone
- return (this.index != 0);
- }
-
- /**
- * <pre>
- * &#64;Outer({&#64;Inner(0), &#64;Inner(1)}) => &#64;Outer({&#64;Inner(0), &#64;Inner(1), &#64;Inner(2)})
- * or
- * &#64;Outer("lorem ipsum") => &#64;Outer(&#64;Inner(0))
- * or
- * &#64;Outer(&#64;Inner(0)) => &#64;Outer({&#64;Inner(0), &#64;Inner(1)})
- * </pre>
- */
- @Override
- protected void modifyAnnotationValue(SingleMemberAnnotation outer, Annotation inner) {
- this.modifyExpression(outer, SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER, inner);
- }
-
- /**
- * <pre>
- * &#64;Outer(text="lorem ipsum") => &#64;Outer(text="lorem ipsum", foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1)}) => &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1), &#64;Inner(2)})
- * or
- * &#64;Outer(foo="lorem ipsum") => &#64;Outer(foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo=&#64;NotInner) => &#64;Outer(foo=&#64;Inner(0))
- * or
- * &#64;Outer(foo=&#64;Inner(0)) => &#64;Outer(foo={&#64;Inner(0), &#64;Inner(1)})
- * </pre>
- */
- @Override
- protected void modifyMemberValuePair(MemberValuePair pair, Annotation inner) {
- this.modifyExpression(pair, MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER, inner);
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Move the annotation to the specified index, leaving its original
- * position cleared out.
- */
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- int oldIndex = this.index;
- if (newIndex == oldIndex) {
- return;
- }
-
- Annotation original = this.getAnnotation(declaration);
- if (original == null) {
- this.index = newIndex;
- this.removeAnnotation(declaration); // clear out the new location (?)
- } else {
- Annotation copy = (Annotation) ASTNode.copySubtree(original.getAST(), original);
- this.index = newIndex;
- this.addAnnotation(declaration, copy); // install the copy in the new location
- this.index = oldIndex;
- this.removeAnnotation(declaration); // go back and clear out the original location (AFTER the move)
- this.index = newIndex;
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return the adapter's annotation from the specified array initializer.
- */
- private Annotation getAnnotation(ArrayInitializer value) {
- List<Expression> expressions = this.expressions(value);
- return (this.index >= expressions.size()) ? null : this.annotationValue(expressions.get(this.index));
- }
-
- /**
- * Build a new array initializer to hold the specified annotation,
- * padding it with 'null' literals as necessary
- */
- private ArrayInitializer buildNewInnerArrayInitializer(Annotation inner) {
- ArrayInitializer ai = inner.getAST().newArrayInitializer();
- this.addInnerToExpressions(inner, this.expressions(ai));
- return ai;
- }
-
- /**
- * Add the specified annotation to the specified array initializer,
- * padding it with 'null' literals as necessary
- */
- private void addInnerToExpressions(Annotation inner, List<Expression> expressions) {
- if (expressions.size() > this.index) {
- throw new IllegalStateException("expressions size is greater than index - size: " + expressions.size() + " - index: " + this.index);
- }
- while (expressions.size() < this.index) {
- expressions.add(inner.getAST().newNullLiteral());
- }
- expressions.add(inner);
- }
-
- /**
- * Remove the adapter's annotation from the specified array initializer.
- */
- private void removeAnnotation(ModifiedDeclaration declaration, Annotation outer, ArrayInitializer value) {
- List<Expression> expressions = this.expressions(value);
- if (this.index >= expressions.size()) {
- return; // avoid IndexOutOfBoundsException(?)
- }
- Annotation inner = this.annotationValue(expressions.get(this.index));
- if (inner == null) {
- return;
- }
- if ( ! this.nameMatches(declaration, inner)) {
- return;
- }
- if (this.index == (expressions.size() - 1)) {
- expressions.remove(this.index);
- } else {
- expressions.set(this.index, value.getAST().newNullLiteral());
- }
- this.trimExpressions(declaration, outer, expressions);
- }
-
- /**
- * Strip all the null literals off the end of the specified list of expressions
- * and normalize the specified outer annotation.
- */
- private void trimExpressions(ModifiedDeclaration declaration, Annotation outer, List<Expression> expressions) {
- // start at the end of the list
- for (int i = expressions.size(); i-- > 0; ) {
- if (expressions.get(i).getNodeType() == ASTNode.NULL_LITERAL) {
- expressions.remove(i);
- } else {
- break; // stop with the first non-null literal encountered
- }
- }
- switch (expressions.size()) {
- case 0:
- this.removeElementAndNormalize(declaration, outer);
- break;
- case 1:
- this.convertArrayToLastRemainingExpression(outer, expressions.get(0));
- break;
- default:
- break;
- }
- }
-
- /**
- * When there is only a single element in an array initializer, convert the
- * expression to be just the single element; e.g.
- * <pre>
- * &#64;Foo(xxx={"abc"}) => &#64;Foo(xxx="abc")
- * or
- * &#64;Foo({"abc"}) => &#64;Foo("abc")
- * </pre>
- */
- private void convertArrayToLastRemainingExpression(Annotation outer, Expression lastValue) {
- lastValue = (Expression) ASTNode.copySubtree(lastValue.getAST(), lastValue);
- if (outer.isNormalAnnotation()) {
- this.memberValuePair((NormalAnnotation) outer).setValue(lastValue);
- } else if (outer.isSingleMemberAnnotation()) {
- ((SingleMemberAnnotation) outer).setValue(lastValue);
- } else {
- throw new IllegalArgumentException("unexpected annotation type: " + outer);
- }
- }
-
- /**
- * Manipulate the specified expression appropriately.
- * If it is an array initializer, add the specified annotation to it.
- * If it is not, replace the expression or convert it into an array
- * initializer.
- */
- private void modifyExpression(ASTNode node, ExpressionProvider expProvider, Annotation inner) {
- Expression value = expProvider.getExpression(node);
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- // ignore the other entries in the array initializer(?) - they may not be matching Annotations...
- List<Expression> expressions = this.expressions((ArrayInitializer) value);
- if (this.index >= expressions.size()) {
- this.addInnerToExpressions(inner, expressions);
- } else {
- expressions.set(this.index, inner);
- }
- } else {
- if (this.index == 0) {
- // replace whatever was there before
- expProvider.setExpression(node, inner);
- } else {
- // convert to an array
- ArrayInitializer ai = inner.getAST().newArrayInitializer();
- List<Expression> expressions = this.expressions(ai);
- expressions.add((Expression) ASTNode.copySubtree(value.getAST(), value));
- this.addInnerToExpressions(inner, expressions);
- expProvider.setExpression(node, ai);
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected List<Expression> expressions(ArrayInitializer ai) {
- return ai.expressions();
- }
-
-
- // ********** expression providers **********
-
- /**
- * define interface that allows us to "re-use" the code in
- * #modifyExpression(ASTNode, ExpressionProvider, Annotation)
- */
- private interface ExpressionProvider {
- Expression getExpression(ASTNode node);
- void setExpression(ASTNode node, Expression expression);
- }
-
- private static final ExpressionProvider MEMBER_VALUE_PAIR_EXPRESSION_PROVIDER = new ExpressionProvider() {
- public Expression getExpression(ASTNode node) {
- return ((MemberValuePair) node).getValue();
- }
- public void setExpression(ASTNode node, Expression expression) {
- ((MemberValuePair) node).setValue(expression);
- }
- @Override
- public String toString() {
- return "MemberValuePairExpressionProvider";
- }
- };
-
- private static final ExpressionProvider SINGLE_MEMBER_ANNOTATION_EXPRESSION_PROVIDER = new ExpressionProvider() {
- public Expression getExpression(ASTNode node) {
- return ((SingleMemberAnnotation) node).getValue();
- }
- public void setExpression(ASTNode node, Expression expression) {
- ((SingleMemberAnnotation) node).setValue(expression);
- }
- @Override
- public String toString() {
- return "SingleMemberAnnotationExpressionProvider";
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NodeFinder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NodeFinder.java
deleted file mode 100644
index 0231fb697d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NodeFinder.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.dom.ASTNode;
-/**
- * For a give range finds the node covered and the node covering.
- *
- * @since 2.1
- */
-//copied from org.eclipse.jdt.internal.corext.dom.NodeFinder
-//deleted code to limit the number of classes I had to copy
-public class NodeFinder extends GenericVisitor {
-
- /**
- * A visitor that maps a selection to a given ASTNode. The result node is
- * determined as follows:
- * <ul>
- * <li>first the visitor tries to find a node with the exact start and length</li>
- * <li>if no such node exists than the node that encloses the range defined by
- * start and end is returned.</li>
- * <li>if the length is zero than also nodes are considered where the node's
- * start or end position matches <code>start</code>.</li>
- * <li>otherwise <code>null</code> is returned.</li>
- * </ul>
- *
- * @param root the root node from which the search starts
- * @param start the start offset
- * @param length the length
- *
- * @return the result node
- *
- * @since 2.1
- */
- public static ASTNode perform(ASTNode root, int start, int length) {
- NodeFinder finder= new NodeFinder(start, length);
- root.accept(finder);
- ASTNode result= finder.getCoveredNode();
- if (result == null || result.getStartPosition() != start || result.getLength() != length) {
- return finder.getCoveringNode();
- }
- return result;
- }
-
- public static ASTNode perform(ASTNode root, ISourceRange range) {
- return perform(root, range.getOffset(), range.getLength());
- }
-
- private int fStart;
- private int fEnd;
-
- private ASTNode fCoveringNode;
- private ASTNode fCoveredNode;
-
- public NodeFinder(int offset, int length) {
- super(true); // include Javadoc tags
- fStart= offset;
- fEnd= offset + length;
- }
-
- @Override
- protected boolean visitNode(ASTNode node) {
- int nodeStart= node.getStartPosition();
- int nodeEnd= nodeStart + node.getLength();
- if (nodeEnd < fStart || fEnd < nodeStart) {
- return false;
- }
- if (nodeStart <= fStart && fEnd <= nodeEnd) {
- fCoveringNode= node;
- }
- if (fStart <= nodeStart && nodeEnd <= fEnd) {
- if (fCoveringNode == node) { // nodeStart == fStart && nodeEnd == fEnd
- fCoveredNode= node;
- return true; // look further for node with same length as parent
- } else if (fCoveredNode == null) { // no better found
- fCoveredNode= node;
- }
- return false;
- }
- return true;
- }
-
- /**
- * Returns the covered node. If more than one nodes are covered by the selection, the
- * returned node is first covered node found in a top-down traversal of the AST
- * @return ASTNode
- */
- public ASTNode getCoveredNode() {
- return fCoveredNode;
- }
-
- /**
- * Returns the covering node. If more than one nodes are covering the selection, the
- * returned node is last covering node found in a top-down traversal of the AST
- * @return ASTNode
- */
- public ASTNode getCoveringNode() {
- return fCoveringNode;
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullAnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullAnnotationEditFormatter.java
deleted file mode 100644
index 8fb1828628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullAnnotationEditFormatter.java
+++ /dev/null
@@ -1,41 +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.internal.jdtutility;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
-
-public final class NullAnnotationEditFormatter
- implements AnnotationEditFormatter
-{
-
- private static final NullAnnotationEditFormatter INSTANCE = new NullAnnotationEditFormatter();
-
- /**
- * Return the singleton.
- */
- public static AnnotationEditFormatter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullAnnotationEditFormatter() {
- super();
- }
-
- public void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException {
- // no formatting
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java
deleted file mode 100644
index 9dc042ea6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,80 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-
-/**
- * Behaviorless implementation.
- */
-public final class NullDeclarationAnnotationAdapter
- implements IndexedDeclarationAnnotationAdapter
-{
-
- // singleton
- private static final NullDeclarationAnnotationAdapter INSTANCE = new NullDeclarationAnnotationAdapter();
-
- /**
- * Return the singleton.
- */
- public static IndexedDeclarationAnnotationAdapter instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NullDeclarationAnnotationAdapter() {
- super();
- }
-
-
- // ********** DeclarationAnnotationAdapter implementation **********
-
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration) {
- return null;
- }
-
- public void removeAnnotation(ModifiedDeclaration declaration) {
- // do nothing
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- return declaration.getDeclaration();
- }
-
-
- // ********** IndexedDeclarationAnnotationAdapter implementation **********
-
- public int getIndex() {
- return -1;
- }
-
- public void moveAnnotation(int newIndex, ModifiedDeclaration declaration) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index e0853b9faa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,58 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Behaviorless implementation.
- */
-public class NullDeclarationAnnotationElementAdapter<T>
- implements DeclarationAnnotationElementAdapter<T>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final DeclarationAnnotationElementAdapter INSTANCE
- = new NullDeclarationAnnotationElementAdapter();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <S> DeclarationAnnotationElementAdapter<S> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullDeclarationAnnotationElementAdapter() {
- super();
- }
-
- public T getValue(ModifiedDeclaration declaration) {
- return null;
- }
-
- public void setValue(T value, ModifiedDeclaration declaration) {
- // do nothing
- }
-
- public ASTNode astNode(ModifiedDeclaration declaration) {
- return declaration.getDeclaration();
- }
-
- public Expression expression(ModifiedDeclaration declaration) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.java
deleted file mode 100644
index be6180535e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NullExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * No conversion.
- */
-public final class NullExpressionConverter
- implements ExpressionConverter<Expression>
-{
-
- // singleton
- private static final ExpressionConverter<Expression> INSTANCE = new NullExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Expression> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullExpressionConverter() {
- super();
- }
-
- public Expression convert(Expression expression, AST ast) {
- return expression;
- }
-
- public Expression convert(Expression expression) {
- return expression;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberIntegerExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberIntegerExpressionConverter.java
deleted file mode 100644
index 3ff2bbde50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/NumberIntegerExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.NumberLiteral;
-
-/**
- * Convert a number literal to/from an Integer
- * (e.g. 5).
- */
-public final class NumberIntegerExpressionConverter
- extends AbstractExpressionConverter<Integer>
-{
- private static final ExpressionConverter<Integer> INSTANCE = new NumberIntegerExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<Integer> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NumberIntegerExpressionConverter() {
- super();
- }
-
- @Override
- protected NumberLiteral convertObject(Integer integer, AST ast) {
- return ast.newNumberLiteral(integer.toString());
- }
-
- @Override
- protected Integer convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof Integer) ? ((Integer) value) : null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.java
deleted file mode 100644
index e441b8619e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/PrimitiveTypeStringExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.PrimitiveType;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-
-/**
- * Convert a type literal to/from a string representation of a primitive type
- * (e.g. "int").
- */
-public final class PrimitiveTypeStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new PrimitiveTypeStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimitiveTypeStringExpressionConverter() {
- super();
- }
-
- @Override
- protected TypeLiteral convertObject(String string, AST ast) {
- org.eclipse.jdt.core.dom.Type type = ast.newPrimitiveType(PrimitiveType.toCode(string));
- TypeLiteral typeLiteral = ast.newTypeLiteral();
- typeLiteral.setType(type);
- return typeLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- org.eclipse.jdt.core.dom.Type type = ((TypeLiteral) expression).getType();
- if (type.getNodeType() == ASTNode.PRIMITIVE_TYPE) {
- return ((PrimitiveType) type).getPrimitiveTypeCode().toString();
- }
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.java
deleted file mode 100644
index 2ffcb36d71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap another annotation element adapter and short-circuit the
- * #setValue method if the value has not changed.
- */
-public class ShortCircuitAnnotationElementAdapter<T>
- implements AnnotationElementAdapter<T>
-{
- /** the wrapped adapter */
- private final AnnotationElementAdapter<T> adapter;
-
-
- // ********** constructor **********
-
- public ShortCircuitAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) {
- this(new MemberAnnotationElementAdapter<T>(member, daea));
- }
-
- public ShortCircuitAnnotationElementAdapter(AnnotationElementAdapter<T> adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- public T getValue() {
- return this.adapter.getValue();
- }
-
- public T getValue(CompilationUnit astRoot) {
- return this.adapter.getValue(astRoot);
- }
-
- public void setValue(T value) {
- this.setValue(this.adapter.getValue(), value);
- }
-
- public Expression expression() {
- return this.adapter.expression();
- }
-
- public Expression expression(CompilationUnit astRoot) {
- return this.adapter.expression(astRoot);
- }
-
- public ASTNode astNode() {
- return this.adapter.astNode();
- }
-
- public ASTNode astNode(CompilationUnit astRoot) {
- return this.adapter.astNode(astRoot);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.adapter);
- }
-
-
- // ********** internal methods **********
-
- /**
- * set the adapter's value to the specified new value if it
- * is different from the specified old value
- */
- protected void setValue(T oldValue, T newValue) {
- if (oldValue == null) {
- if (newValue == null) { // null => null
- // do nothing
- } else { // null => object
- this.adapter.setValue(newValue);
- }
- } else {
- if (newValue == null) { // object => null
- this.adapter.setValue(newValue);
- } else { // object => object
- if (this.valuesAreEqual(oldValue, newValue)) {
- // do nothing
- } else {
- this.adapter.setValue(newValue);
- }
- }
- }
- }
-
- /**
- * both values are non-null when this method is called
- */
- protected boolean valuesAreEqual(T oldValue, T newValue) {
- return newValue.equals(oldValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.java
deleted file mode 100644
index 9bead7a287..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/ShortCircuitArrayAnnotationElementAdapter.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.core.internal.jdtutility;
-
-import java.util.Arrays;
-
-/**
- * Wrap another annotation element adapter and short-circuit the
- * #setValue method if the value has not changed. Overrides #valuesAreEqual()
- * to check equality on arrays
- */
-public class ShortCircuitArrayAnnotationElementAdapter<T>
- extends ShortCircuitAnnotationElementAdapter<T[]>
-{
- // ********** constructor **********
-
- public ShortCircuitArrayAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T[]> daea) {
- super(member, daea);
- }
-
- public ShortCircuitArrayAnnotationElementAdapter(AnnotationElementAdapter<T[]> adapter) {
- super(adapter);
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- @Override
- protected boolean valuesAreEqual(T[] oldValue, T[] newValue) {
- return Arrays.equals(newValue, oldValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java
deleted file mode 100644
index 23311e47ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleBooleanAnnotationAdapter.java
+++ /dev/null
@@ -1,85 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Wrap an annotation adapter and return true if the annotation is simply
- * present; return false if it is missing. The annotation can be of any type
- * (marker, single member, or normal).
- */
-public class SimpleBooleanAnnotationAdapter implements BooleanAnnotationAdapter {
- private final AnnotationAdapter adapter;
-
- public SimpleBooleanAnnotationAdapter(AnnotationAdapter adapter) {
- super();
- this.adapter = adapter;
- }
-
-
- // ********** BooleanAnnotationAdapter implementation **********
-
- public ASTNode astNode() {
- return this.adapter.astNode();
- }
-
- public ASTNode astNode(CompilationUnit astRoot) {
- return this.adapter.astNode(astRoot);
- }
-
- public Annotation getAnnotation() {
- return this.adapter.getAnnotation();
- }
-
- public Annotation getAnnotation(CompilationUnit astRoot) {
- return this.adapter.getAnnotation(astRoot);
- }
-
- public boolean getValue() {
- return this.getValue(this.getAnnotation());
- }
-
- public boolean getValue(CompilationUnit astRoot) {
- return this.getValue(this.getAnnotation(astRoot));
- }
-
- public void setValue(boolean value) {
- this.setValue(this.getValue(), value);
- }
-
-
- // ********** internal methods **********
-
- protected boolean getValue(Annotation annotation) {
- return annotation != null;
- }
-
- /**
- * set the adapter's value to the specified new value if it
- * is different from the specified old value
- */
- protected void setValue(boolean oldValue, boolean newValue) {
- if (newValue != oldValue) {
- this.setNewValue(newValue);
- }
- }
-
- protected void setNewValue(boolean value) {
- if (value) {
- this.adapter.newMarkerAnnotation();
- } else {
- this.adapter.removeAnnotation();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.java
deleted file mode 100644
index 77d3352d06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleDeclarationAnnotationAdapter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-
-/**
- * Manipulate an annotation with a specific name, e.g.
- * <pre>
- * &#64;Foo
- * private int id;
- * </pre>
- *
- * NB:
- * If the declaration contains more than one annotation with the same
- * name, the adapter will correspond to the first annotation with the specified
- * name. (Also note that the compiler will not allow a declaration to be
- * modified by multiple annotations with the same name, i.e. of the same type;
- * so if there *are* multiple annotations of the same type, there are bigger
- * problems to worry about than which annotation the adapter manipulates.)
- */
-public class SimpleDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter {
-
-
- // ********** constructors **********
-
- public SimpleDeclarationAnnotationAdapter(String annotationName) {
- super(annotationName);
- }
-
-
- // ********** AbstractAnnotationAdapter implementation **********
-
- @Override
- public Annotation getAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(this.getAnnotationName());
- }
-
- @Override
- public void removeAnnotation(ModifiedDeclaration declaration) {
- declaration.removeAnnotationNamed(this.getAnnotationName());
- }
-
- @Override
- protected void addAnnotation(ModifiedDeclaration declaration, Annotation annotation) {
- declaration.replaceAnnotationNamed(this.getAnnotationName(), annotation);
- }
-
- @Override
- public ASTNode astNode(ModifiedDeclaration declaration) {
- // if the annotation is missing, return the declaration
- Annotation annotation = this.getAnnotation(declaration);
- return (annotation != null) ? annotation : declaration.getDeclaration();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java
deleted file mode 100644
index 76606f0e69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/SimpleTypeStringExpressionConverter.java
+++ /dev/null
@@ -1,62 +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.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.Name;
-import org.eclipse.jdt.core.dom.SimpleType;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-
-/**
- * Convert a type literal to/from a string representation of a simple type
- * (e.g. "java.lang.Object").
- */
-public final class SimpleTypeStringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new SimpleTypeStringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleTypeStringExpressionConverter() {
- super();
- }
-
- @Override
- protected TypeLiteral convertObject(String string, AST ast) {
- Name name = ast.newName(string);
- org.eclipse.jdt.core.dom.Type type = ast.newSimpleType(name);
- TypeLiteral typeLiteral = ast.newTypeLiteral();
- typeLiteral.setType(type);
- return typeLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- org.eclipse.jdt.core.dom.Type type = ((TypeLiteral) expression).getType();
- if (type.getNodeType() == ASTNode.SIMPLE_TYPE) {
- return ((SimpleType) type).getName().getFullyQualifiedName();
- }
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java
deleted file mode 100644
index eec33167dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringArrayExpressionConverter.java
+++ /dev/null
@@ -1,110 +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.internal.jdtutility;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.Expression;
-
-/**
- * Convert an array initializer to/from an array of strings (e.g. {"text0", "text1"}).
- *
- * Do NOT use this class for converting array initializers in annotation elements.
- * Java5 has a bit of syntactic sugar that allows a single-element array
- * initializer to not have curly braces. This converter will return null if it encounters
- * anything other than an array initializer.
- *
- * Invalid entries in the array initializer will result in null elements in the
- * resulting string array. This allows clients to manipulate elements at
- * the appropriate index.
- */
-public class StringArrayExpressionConverter
- extends AbstractExpressionConverter<String[]>
-{
- private final ExpressionConverter<String> elementConverter;
- private final boolean removeArrayInitializerWhenEmpty;
-
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public StringArrayExpressionConverter(ExpressionConverter<String> elementConverter) {
- this(elementConverter, true);
- }
-
- public StringArrayExpressionConverter(ExpressionConverter<String> elementConverter, boolean removeArrayInitializerWhenEmpty) {
- super();
- this.elementConverter = elementConverter;
- this.removeArrayInitializerWhenEmpty = removeArrayInitializerWhenEmpty;
- }
-
- @Override
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- public ArrayInitializer convertObject(String[] strings, AST ast) {
- if ((strings.length == 0) && this.removeArrayInitializerWhenEmpty) {
- return null;
- }
- ArrayInitializer arrayInitializer = ast.newArrayInitializer();
- List<Expression> expressions = this.expressions(arrayInitializer);
- for (String string : strings) {
- expressions.add(this.elementConverter.convert(string, ast));
- }
- return arrayInitializer;
- }
-
- @SuppressWarnings("unchecked")
- private List<Expression> expressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- @Override
- public String[] convertNull() {
- return EMPTY_STRING_ARRAY;
- }
-
- @Override
- protected String[] convertExpression(Expression expression) {
- return (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- this.convertArrayInitializer((ArrayInitializer) expression)
- :
- EMPTY_STRING_ARRAY;
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- public String[] convertArrayInitializer(ArrayInitializer arrayInitializer) {
- List<Expression> expressions = this.downcastExpressions(arrayInitializer);
- int len = expressions.size();
- String[] strings = new String[len];
- for (int i = len; i-- > 0; ) {
- strings[i] = this.elementConverter.convert(expressions.get(i));
- }
- return strings;
- }
-
- @SuppressWarnings("unchecked")
- private List<Expression> downcastExpressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.java
deleted file mode 100644
index 4ab813b487..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/StringExpressionConverter.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.core.internal.jdtutility;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.StringLiteral;
-
-/**
- * Convert a string literal to/from a string (e.g. "text").
- */
-public final class StringExpressionConverter
- extends AbstractExpressionConverter<String>
-{
- private static final ExpressionConverter<String> INSTANCE = new StringExpressionConverter();
-
- /**
- * Return the singleton.
- */
- public static ExpressionConverter<String> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private StringExpressionConverter() {
- super();
- }
-
- @Override
- protected StringLiteral convertObject(String string, AST ast) {
- StringLiteral stringLiteral = ast.newStringLiteral();
- stringLiteral.setLiteralValue(string);
- return stringLiteral;
- }
-
- @Override
- protected String convertExpression(Expression expression) {
- Object value = expression.resolveConstantExpressionValue();
- return (value instanceof String) ? (String) value : null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java
deleted file mode 100644
index a12c94311f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jdtutility/Type.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jdtutility;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-
-public class Type extends Member {
-
- public Type(IType type, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider) {
- super(type, modifySharedDocumentCommandExecutorProvider);
- }
-
- public Type(IType type, CommandExecutorProvider modifySharedDocumentCommandExecutorProvider, AnnotationEditFormatter annotationEditFormatter) {
- super(type, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- }
-
- @Override
- public IType getJdtMember() {
- return (IType) super.getJdtMember();
- }
-
- @Override
- public Type topLevelDeclaringType() {
- return (this.getDeclaringType() == null) ? this : super.topLevelDeclaringType();
- }
-
- public IType[] declaredTypes() {
- try {
- return getJdtMember().getTypes();
- }
- catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- public IField[] fields() {
- try {
- return getJdtMember().getFields();
- }
- catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- public IMethod[] methods() {
- try {
- return getJdtMember().getMethods();
- }
- catch(JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Member implementation **********
-
- @Override
- public AbstractTypeDeclaration bodyDeclaration(CompilationUnit astRoot) {
- Type declaringType = getDeclaringType();
- if (declaringType != null) {
- return typeDeclaration(declaringType.bodyDeclaration(astRoot));
- }
- return typeDeclaration(this.types(astRoot));
- }
-
- public AbstractTypeDeclaration typeDeclaration(AbstractTypeDeclaration declaringTypeDeclaration) {
- return typeDeclaration(this.types(declaringTypeDeclaration));
- }
-
- private AbstractTypeDeclaration typeDeclaration(List<AbstractTypeDeclaration> typeDeclarations) {
- String name = this.getName();
- for (AbstractTypeDeclaration typeDeclaration : typeDeclarations) {
- if (typeDeclaration.getName().getFullyQualifiedName().equals(name)) {
- return typeDeclaration;
- }
- }
- return null;
- }
-
- @Override
- public ITypeBinding binding(CompilationUnit astRoot) {
- return bodyDeclaration(astRoot).resolveBinding();
- }
-
- // ********** miscellaneous **********
-
- @SuppressWarnings("unchecked")
- protected List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
- protected List<AbstractTypeDeclaration> types(AbstractTypeDeclaration typeDeclaration) {
- List<AbstractTypeDeclaration> typeDeclarations = new ArrayList<AbstractTypeDeclaration>();
- for (BodyDeclaration bodyDeclaration : bodyDeclarations(typeDeclaration))
- if (bodyDeclaration.getNodeType() == ASTNode.TYPE_DECLARATION ||
- bodyDeclaration.getNodeType() == ASTNode.ANNOTATION_TYPE_DECLARATION ||
- bodyDeclaration.getNodeType() == ASTNode.ENUM_DECLARATION) {
- typeDeclarations.add((AbstractTypeDeclaration) bodyDeclaration);
- }
- return typeDeclarations;
- }
-
- @SuppressWarnings("unchecked")
- protected List<BodyDeclaration> bodyDeclarations(AbstractTypeDeclaration typeDeclaration) {
- return typeDeclaration.bodyDeclarations();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java
deleted file mode 100644
index cf87fd51b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaAnnotationProvider.java
+++ /dev/null
@@ -1,326 +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.internal.platform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverrideImpl.AssociationOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverridesImpl.AssociationOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverrideImpl.AttributeOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverridesImpl.AttributeOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.BasicImpl.BasicAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ColumnImpl.ColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorColumnImpl.DiscriminatorColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorValueImpl.DiscriminatorValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddableImpl.EmbeddableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedIdImpl.EmbeddedIdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedImpl.EmbeddedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EntityImpl.EntityAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EnumeratedImpl.EnumeratedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.GeneratedValueImpl.GeneratedValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdClassImpl.IdClassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdImpl.IdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.InheritanceImpl.InheritanceAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnImpl.JoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnsImpl.JoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinTableImpl.JoinTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.LobImpl.LobAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToManyImpl.ManyToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToOneImpl.ManyToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MapKeyImpl.MapKeyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MappedSuperclassImpl.MappedSuperclassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueriesImpl.NamedNativeQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueryImpl.NamedNativeQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueriesImpl.NamedQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueryImpl.NamedQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToManyImpl.OneToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToOneImpl.OneToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OrderByImpl.OrderByAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnImpl.PrimaryKeyJoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnsImpl.PrimaryKeyJoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTableImpl.SecondaryTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTablesImpl.SecondaryTablesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SequenceGeneratorImpl.SequenceGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableGeneratorImpl.TableGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableImpl.TableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TemporalImpl.TemporalAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TransientImpl.TransientAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.VersionImpl.VersionAnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-public class GenericJpaAnnotationProvider implements JpaAnnotationProvider
-{
- /**
- * Ordered list of possible type mapping annotations. Ordered because this
- * is used to determine the mapping in the case where 2 mapping annotations exist
- */
- private List<AnnotationDefinition> typeMappingAnnotationDefinitions;
-
- private Collection<AnnotationDefinition> typeAnnotationDefinitions;
-
- /**
- * Ordered list of possible attribute mapping annotations. Ordered because this
- * is used to determine the mapping in the case where 2 mapping annotations exist
- */
- private List<AnnotationDefinition> attributeMappingAnnotationDefinitions;
-
- private Collection<AnnotationDefinition> attributeAnnotationDefinitions;
-
-
- protected GenericJpaAnnotationProvider() {
- super();
- }
-
-
- protected ListIterator<AnnotationDefinition> typeMappingAnnotationDefinitions() {
- if (this.typeMappingAnnotationDefinitions == null) {
- this.typeMappingAnnotationDefinitions = new ArrayList<AnnotationDefinition>();
- this.addTypeMappingAnnotationDefinitionsTo(this.typeMappingAnnotationDefinitions);
- }
- return new CloneListIterator<AnnotationDefinition>(this.typeMappingAnnotationDefinitions);
- }
-
- /**
- * Override this to specify more or different type mapping definitions.
- * The default includes the JPA spec-defined type mappings of
- * Embeddable, Entity, MappedSuperclass
- */
- protected void addTypeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- }
-
- protected Iterator<AnnotationDefinition> typeAnnotationDefinitions() {
- if (this.typeAnnotationDefinitions == null) {
- this.typeAnnotationDefinitions = new ArrayList<AnnotationDefinition>();
- this.addTypeAnnotationDefinitionsTo(this.typeAnnotationDefinitions);
- }
- return new CloneIterator<AnnotationDefinition>(this.typeAnnotationDefinitions);
- }
-
- /**
- * Override this to specify more or different type annotation definitions.
- * The default includes the JPA spec-defined annotations.
- */
- protected void addTypeAnnotationDefinitionsTo(Collection<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(DiscriminatorColumnAnnotationDefinition.instance());
- definitions.add(DiscriminatorValueAnnotationDefinition.instance());
- definitions.add(IdClassAnnotationDefinition.instance());
- definitions.add(InheritanceAnnotationDefinition.instance());
- definitions.add(NamedQueryAnnotationDefinition.instance());
- definitions.add(NamedQueriesAnnotationDefinition.instance());
- definitions.add(NamedNativeQueryAnnotationDefinition.instance());
- definitions.add(NamedNativeQueriesAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SecondaryTableAnnotationDefinition.instance());
- definitions.add(SecondaryTablesAnnotationDefinition.instance());
- definitions.add(SequenceGeneratorAnnotationDefinition.instance());
- definitions.add(TableAnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- }
-
- protected ListIterator<AnnotationDefinition> attributeMappingAnnotationDefinitions() {
- if (this.attributeMappingAnnotationDefinitions == null) {
- this.attributeMappingAnnotationDefinitions = new ArrayList<AnnotationDefinition>();
- this.addAttributeMappingAnnotationDefinitionsTo(this.attributeMappingAnnotationDefinitions);
- }
- return new CloneListIterator<AnnotationDefinition>(this.attributeMappingAnnotationDefinitions);
- }
-
- /**
- * Override this to specify more or different attribute mapping definitions.
- * The default includes the JPA spec-defined attribute mappings of
- * Basic, Id, Transient OneToOne, OneToMany, ManyToOne, ManyToMany, Embedded, EmbeddedId, Version.
- */
- protected void addAttributeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(BasicAnnotationDefinition.instance());
- definitions.add(EmbeddedAnnotationDefinition.instance());
- definitions.add(EmbeddedIdAnnotationDefinition.instance());
- definitions.add(IdAnnotationDefinition.instance());
- definitions.add(ManyToManyAnnotationDefinition.instance());
- definitions.add(ManyToOneAnnotationDefinition.instance());
- definitions.add(OneToManyAnnotationDefinition.instance());
- definitions.add(OneToOneAnnotationDefinition.instance());
- definitions.add(TransientAnnotationDefinition.instance());
- definitions.add(VersionAnnotationDefinition.instance());
- }
-
- protected Iterator<AnnotationDefinition> attributeAnnotationDefinitions() {
- if (this.attributeAnnotationDefinitions == null) {
- this.attributeAnnotationDefinitions = new ArrayList<AnnotationDefinition>();
- this.addAttributeAnnotationDefinitionsTo(this.attributeAnnotationDefinitions);
- }
- return new CloneIterator<AnnotationDefinition>(this.attributeAnnotationDefinitions);
- }
-
- /**
- * Override this to specify more or different attribute annotation definitions.
- * The default includes the JPA spec-defined annotations.
- */
- protected void addAttributeAnnotationDefinitionsTo(Collection<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(ColumnAnnotationDefinition.instance());
- definitions.add(EnumeratedAnnotationDefinition.instance());
- definitions.add(GeneratedValueAnnotationDefinition.instance());
- definitions.add(JoinColumnAnnotationDefinition.instance());
- definitions.add(JoinColumnsAnnotationDefinition.instance());
- definitions.add(JoinTableAnnotationDefinition.instance());
- definitions.add(LobAnnotationDefinition.instance());
- definitions.add(MapKeyAnnotationDefinition.instance());
- definitions.add(OrderByAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SequenceGeneratorAnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- definitions.add(TemporalAnnotationDefinition.instance());
- }
-
- //********************* IJpaPlatform implementation *************************
-
- public Annotation buildTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String mappingAnnotationName) {
- AnnotationDefinition annotationDefinition = typeMappingAnnotationDefinition(mappingAnnotationName);
- return annotationDefinition.buildAnnotation(parent, type);
- }
-
- public Annotation buildNullTypeMappingAnnotation(JavaResourcePersistentType parent, Type type, String mappingAnnotationName) {
- AnnotationDefinition annotationDefinition = typeMappingAnnotationDefinition(mappingAnnotationName);
- return annotationDefinition.buildNullAnnotation(parent, type);
- }
-
- public Annotation buildTypeAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- AnnotationDefinition annotationDefinition = typeAnnotationDefinition(annotationName);
- return annotationDefinition.buildAnnotation(parent, type);
- }
-
- public Annotation buildNullTypeAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- AnnotationDefinition annotationDefinition = typeAnnotationDefinition(annotationName);
- return annotationDefinition.buildNullAnnotation(parent, type);
- }
-
- public ListIterator<String> typeMappingAnnotationNames() {
- return new TransformationListIterator<AnnotationDefinition, String>(typeMappingAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition next) {
- return next.getAnnotationName();
- }
- };
- }
-
- public Iterator<String> typeAnnotationNames() {
- return new TransformationIterator<AnnotationDefinition, String>(typeAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition next) {
- return next.getAnnotationName();
- }
- };
- }
-
- public Annotation buildAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String mappingAnnotationName) {
- AnnotationDefinition annotationDefinition = attributeMappingAnnotationDefinition(mappingAnnotationName);
- return annotationDefinition.buildAnnotation(parent, attribute);
- }
-
- public Annotation buildNullAttributeMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- AnnotationDefinition annotationDefinition = attributeMappingAnnotationDefinition(annotationName);
- return annotationDefinition.buildNullAnnotation(parent, attribute);
- }
-
- public Annotation buildAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- AnnotationDefinition annotationDefinition = attributeAnnotationDefinition(annotationName);
- return annotationDefinition.buildAnnotation(parent, attribute);
- }
-
- public Annotation buildNullAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- AnnotationDefinition annotationDefinition = attributeAnnotationDefinition(annotationName);
- return annotationDefinition.buildNullAnnotation(parent, attribute);
- }
-
- public ListIterator<String> attributeMappingAnnotationNames() {
- return new TransformationListIterator<AnnotationDefinition, String>(attributeMappingAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition next) {
- return next.getAnnotationName();
- }
- };
- }
-
- public Iterator<String> attributeAnnotationNames() {
- return new TransformationIterator<AnnotationDefinition, String>(attributeAnnotationDefinitions()) {
- @Override
- protected String transform(AnnotationDefinition next) {
- return next.getAnnotationName();
- }
- };
- }
-
- private AnnotationDefinition typeMappingAnnotationDefinition(String mappingAnnotationName) {
- for (ListIterator<AnnotationDefinition> i = typeMappingAnnotationDefinitions(); i.hasNext(); ) {
- AnnotationDefinition definition = i.next();
- if (definition.getAnnotationName().equals(mappingAnnotationName)) {
- return definition;
- }
- }
- throw new IllegalArgumentException(mappingAnnotationName + " is an unsupported type mapping annotation");
- }
-
- private AnnotationDefinition typeAnnotationDefinition(String annotationName) {
- for (Iterator<AnnotationDefinition> i = typeAnnotationDefinitions(); i.hasNext(); ) {
- AnnotationDefinition definition = i.next();
- if (definition.getAnnotationName().equals(annotationName)) {
- return definition;
- }
- }
- throw new IllegalArgumentException(annotationName + " is an unsupported type annotation");
- }
-
- private AnnotationDefinition attributeMappingAnnotationDefinition(String mappingAnnotationName) {
- for (ListIterator<AnnotationDefinition> i = attributeMappingAnnotationDefinitions(); i.hasNext(); ) {
- AnnotationDefinition definition = i.next();
- if (definition.getAnnotationName().equals(mappingAnnotationName)) {
- return definition;
- }
- }
- throw new IllegalArgumentException(mappingAnnotationName + " is an unsupported attribute mapping annotation");
- }
-
- private AnnotationDefinition attributeAnnotationDefinition(String annotationName) {
- for (Iterator<AnnotationDefinition> i = attributeAnnotationDefinitions(); i.hasNext(); ) {
- AnnotationDefinition definition = i.next();
- if (definition.getAnnotationName().equals(annotationName)) {
- return definition;
- }
- }
- throw new IllegalArgumentException(annotationName + " is an unsupported attribute annotation");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java
deleted file mode 100644
index 9daa4c4eca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java
+++ /dev/null
@@ -1,606 +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.internal.platform;
-
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.ContextModel;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaAbstractJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAbstractJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.context.persistence.Property;
-import org.eclipse.jpt.core.internal.GenericJpaDataSource;
-import org.eclipse.jpt.core.internal.GenericJpaFile;
-import org.eclipse.jpt.core.internal.GenericJpaProject;
-import org.eclipse.jpt.core.internal.context.GenericJpaContent;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaAssociationOverride;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaAttributeOverride;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaBasicMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEmbeddedMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaGeneratedValue;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaIdMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNamedQuery;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaQueryHint;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaSecondaryTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaSequenceGenerator;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTable;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTableGenerator;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaTransientMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaVersionMapping;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericEntityMappings;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmAssociationOverride;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmAttributeOverride;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmBasicMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEmbeddedMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmEntity;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmGeneratedValue;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToManyMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNamedQuery;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmQueryHint;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmSecondaryTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmSequenceGenerator;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTable;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTableGenerator;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmTransientMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmVersionMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericPersistenceUnitDefaults;
-import org.eclipse.jpt.core.internal.context.orm.GenericPersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.orm.OrmXmlImpl;
-import org.eclipse.jpt.core.internal.context.persistence.GenericClassRef;
-import org.eclipse.jpt.core.internal.context.persistence.GenericMappingFileRef;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistence;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXml;
-import org.eclipse.jpt.core.internal.context.persistence.GenericProperty;
-import org.eclipse.jpt.core.internal.jdtutility.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmResource;
-import org.eclipse.jpt.core.resource.orm.OrmResourceModel;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResourceModel;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-public class GenericJpaFactory implements JpaFactory
-{
- protected GenericJpaFactory() {
- super();
- }
-
-
- // **************** Core objects ******************************************
-
- public JpaProject buildJpaProject(JpaProject.Config config) throws CoreException {
- return new GenericJpaProject(config);
- }
-
- public JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
- return new GenericJpaDataSource(jpaProject, connectionProfileName);
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, ResourceModel resourceModel) {
- return new GenericJpaFile(jpaProject, file, resourceModel);
- }
-
-
- // **************** Resource objects **************************************
-
- public boolean hasRelevantContent(IFile file) {
- if (! JavaCore.create(file.getProject()).isOnClasspath(file)) {
- return false;
- }
- IContentType contentType = this.contentType(file);
- if (contentType == null) {
- return false;
- }
- String contentTypeId = contentType.getId();
- return supportsContentType(contentTypeId);
- }
-
- protected boolean supportsContentType(String contentTypeId) {
- return contentTypeId.equals(JavaCore.JAVA_SOURCE_CONTENT_TYPE)
- || contentTypeId.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)
- || contentTypeId.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE);
- }
-
- public ResourceModel buildResourceModel(JpaProject jpaProject, IFile file) {
- if (! JavaCore.create(jpaProject.project()).isOnClasspath(file)) {
- throw new IllegalArgumentException("The file" + file + " is not on the project classpath");
- }
- IContentType contentType = this.contentType(file);
- if (contentType == null) {
- throw new IllegalArgumentException("The file" + file + " does not have a supported content type");
- }
- String contentTypeId = contentType.getId();
- return buildResourceModel(jpaProject, file, contentTypeId);
- }
-
- protected ResourceModel buildResourceModel(JpaProject jpaProject, IFile file, String contentTypeId) {
- if (JavaCore.JAVA_SOURCE_CONTENT_TYPE.equals(contentTypeId)) {
- return buildJavaResourceModel(jpaProject, file);
- }
- else if (JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE.equals(contentTypeId)) {
- return buildPersistenceResourceModel(file);
- }
- else if (JptCorePlugin.ORM_XML_CONTENT_TYPE.equals(contentTypeId)) {
- return buildOrmResourceModel(file);
- }
-
- return null;
- }
-
- protected ResourceModel buildJavaResourceModel(JpaProject jpaProject, IFile file) {
- return new JavaResourceModel(
- file, jpaProject.jpaPlatform().annotationProvider(),
- jpaProject.modifySharedDocumentCommandExecutorProvider(),
- DefaultAnnotationEditFormatter.instance());
- }
-
- protected ResourceModel buildPersistenceResourceModel(IFile file) {
- return new PersistenceResourceModel(file);
- }
-
- protected ResourceModel buildOrmResourceModel(IFile file) {
- return new OrmResourceModel(file);
- }
-
- // attempting to get the contentType based on the file contents.
- // have to check the file contents instead of just the file name
- // because for xml we base it on the rootElement name
- private IContentType contentType(IFile file) {
- try {
- return Platform.getContentTypeManager().findContentTypeFor(file.getContents(), file.getName());
- }
- catch (IOException ex) {
- JptCorePlugin.log(ex);
- }
- catch (CoreException ex) {
- JptCorePlugin.log(ex);
- }
- return null;
- }
-
-
- // **************** Context objects ***************************************
-
- public ContextModel buildContextModel(JpaProject parent) {
- return new GenericJpaContent(parent);
- }
-
- public PersistenceXml buildPersistenceXml(BaseJpaContent parent, PersistenceResource persistenceResource) {
- return new GenericPersistenceXml(parent, persistenceResource);
- }
-
- public OrmXml buildOrmXml(MappingFileRef parent, OrmResource ormResource) {
- return new OrmXmlImpl(parent, ormResource);
- }
-
- public EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericEntityMappings(parent, xmlEntityMappings);
- }
-
- public PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericPersistenceUnitMetadata(parent, xmlEntityMappings);
- }
-
- public PersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericPersistenceUnitDefaults(parent, xmlEntityMappings);
- }
-
- public Persistence buildPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- return new GenericPersistence(parent, xmlPersistence);
- }
-
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit persistenceUnit) {
- return new GenericPersistenceUnit(parent, persistenceUnit);
- }
-
- public MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef) {
- return new GenericMappingFileRef(parent, xmlMappingFileRef);
- }
-
- public ClassRef buildClassRef(PersistenceUnit parent, XmlJavaClassRef classRef) {
- return new GenericClassRef(parent, classRef);
- }
-
- public ClassRef buildClassRef(PersistenceUnit parent, String className) {
- return new GenericClassRef(parent, className);
- }
-
- public Property buildProperty(PersistenceUnit parent, XmlProperty xmlProperty) {
- return new GenericProperty(parent, xmlProperty);
- }
-
- public JavaPersistentType buildJavaPersistentType(JpaContextNode parent, JavaResourcePersistentType resourcePersistentType) {
- return new GenericJavaPersistentType(parent, resourcePersistentType);
- }
-
- public JavaPersistentAttribute buildJavaPersistentAttribute(JavaPersistentType parent) {
- return new GenericJavaPersistentAttribute(parent);
- }
-
- public JavaTypeMapping buildJavaNullTypeMapping(JavaPersistentType parent) {
- return new JavaNullTypeMapping(parent);
- }
-
- public JavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new GenericJavaEntity(parent);
- }
-
- public JavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent) {
- return new GenericJavaMappedSuperclass(parent);
- }
-
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
- return new GenericJavaEmbeddable(parent);
- }
-
- public JavaTable buildJavaTable(JavaEntity parent) {
- return new GenericJavaTable(parent);
- }
-
- public JavaColumn buildJavaColumn(JavaJpaContextNode parent, JavaColumn.Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- public JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaNamedColumn.Owner owner) {
- return new GenericJavaDiscriminatorColumn(parent, owner);
- }
-
- public JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- return new GenericJavaJoinColumn(parent, owner);
- }
-
- public JavaJoinTable buildJavaJoinTable(JavaRelationshipMapping parent) {
- return new GenericJavaJoinTable(parent);
- }
-
- public JavaSecondaryTable buildJavaSecondaryTable(JavaEntity parent) {
- return new GenericJavaSecondaryTable(parent);
- }
-
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new GenericJavaBasicMapping(parent);
- }
-
- public JavaEmbeddedIdMapping buildJavaEmbeddedIdMapping(JavaPersistentAttribute parent) {
- return new GenericJavaEmbeddedIdMapping(parent);
- }
-
- public JavaEmbeddedMapping buildJavaEmbeddedMapping(JavaPersistentAttribute parent) {
- return new GenericJavaEmbeddedMapping(parent);
- }
-
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new GenericJavaIdMapping(parent);
- }
-
- public JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaManyToManyMapping(parent);
- }
-
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaManyToOneMapping(parent);
- }
-
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToManyMapping(parent);
- }
-
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToOneMapping(parent);
- }
-
- public JavaTransientMapping buildJavaTransientMapping(JavaPersistentAttribute parent) {
- return new GenericJavaTransientMapping(parent);
- }
-
- public JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent) {
- return new GenericJavaVersionMapping(parent);
- }
-
- public JavaAttributeMapping buildJavaNullAttributeMapping(JavaPersistentAttribute parent) {
- return new GenericJavaNullAttributeMapping(parent);
- }
-
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
- return new GenericJavaSequenceGenerator(parent);
- }
-
- public JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent) {
- return new GenericJavaTableGenerator(parent);
- }
-
- public JavaGeneratedValue buildJavaGeneratedValue(JavaAttributeMapping parent) {
- return new GenericJavaGeneratedValue(parent);
- }
-
- public JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaAbstractJoinColumn.Owner owner) {
- return new GenericJavaPrimaryKeyJoinColumn(parent, owner);
- }
-
- public JavaAttributeOverride buildJavaAttributeOverride(JavaJpaContextNode parent, AttributeOverride.Owner owner) {
- return new GenericJavaAttributeOverride(parent, owner);
- }
-
- public JavaAssociationOverride buildJavaAssociationOverride(JavaJpaContextNode parent, AssociationOverride.Owner owner) {
- return new GenericJavaAssociationOverride(parent, owner);
- }
-
- public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedQuery(parent);
- }
-
- public JavaNamedNativeQuery buildJavaNamedNativeQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedNativeQuery(parent);
- }
-
- public JavaQueryHint buildJavaQueryHint(JavaQuery parent) {
- return new GenericJavaQueryHint(parent);
- }
-
- public OrmPersistentType buildOrmPersistentType(EntityMappings parent, String mappingKey) {
- return new GenericOrmPersistentType(parent, mappingKey);
- }
-
- public OrmEntity buildOrmEntity(OrmPersistentType parent) {
- return new GenericOrmEntity(parent);
- }
-
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent) {
- return new GenericOrmMappedSuperclass(parent);
- }
-
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent) {
- return new GenericOrmEmbeddable(parent);
- }
-
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, String mappingKey) {
- return new GenericOrmPersistentAttribute(parent, mappingKey);
- }
-
- public OrmTable buildOrmTable(OrmEntity parent) {
- return new GenericOrmTable(parent);
- }
-
- public OrmSecondaryTable buildOrmSecondaryTable(OrmEntity parent) {
- return new GenericOrmSecondaryTable(parent);
- }
-
- public OrmPrimaryKeyJoinColumn buildOrmPrimaryKeyJoinColumn(OrmJpaContextNode parent, OrmAbstractJoinColumn.Owner owner) {
- return new GenericOrmPrimaryKeyJoinColumn(parent, owner);
- }
-
- public OrmJoinTable buildOrmJoinTable(OrmRelationshipMapping parent) {
- return new GenericOrmJoinTable(parent);
- }
-
- public OrmJoinColumn buildOrmJoinColumn(OrmJpaContextNode parent, OrmJoinColumn.Owner owner) {
- return new GenericOrmJoinColumn(parent, owner);
- }
-
- public OrmAttributeOverride buildOrmAttributeOverride(OrmJpaContextNode parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
- return new GenericOrmAttributeOverride(parent, owner, xmlAttributeOverride);
- }
-
- public OrmAssociationOverride buildOrmAssociationOverride(OrmJpaContextNode parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
- return new GenericOrmAssociationOverride(parent, owner, xmlAssociationOverride);
- }
-
- public OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmNamedColumn.Owner owner) {
- return new GenericOrmDiscriminatorColumn(parent, owner);
- }
-
- public OrmColumn buildOrmColumn(OrmJpaContextNode parent, OrmColumn.Owner owner) {
- return new GenericOrmColumn(parent, owner);
- }
-
- public OrmGeneratedValue buildOrmGeneratedValue(OrmJpaContextNode parent) {
- return new GenericOrmGeneratedValue(parent);
- }
-
- public OrmSequenceGenerator buildOrmSequenceGenerator(OrmJpaContextNode parent) {
- return new GenericOrmSequenceGenerator(parent);
- }
-
- public OrmTableGenerator buildOrmTableGenerator(OrmJpaContextNode parent) {
- return new GenericOrmTableGenerator(parent);
- }
-
- public OrmNamedNativeQuery buildOrmNamedNativeQuery(OrmJpaContextNode parent) {
- return new GenericOrmNamedNativeQuery(parent);
- }
-
- public OrmNamedQuery buildOrmNamedQuery(OrmJpaContextNode parent) {
- return new GenericOrmNamedQuery(parent);
- }
-
- public OrmQueryHint buildOrmQueryHint(OrmQuery parent) {
- return new GenericOrmQueryHint(parent);
- }
-
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent) {
- return new GenericOrmBasicMapping(parent);
- }
-
- public OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent) {
- return new GenericOrmEmbeddedMapping(parent);
- }
-
- public OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent) {
- return new GenericOrmEmbeddedIdMapping(parent);
- }
-
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent) {
- return new GenericOrmIdMapping(parent);
- }
-
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent) {
- return new GenericOrmManyToManyMapping(parent);
- }
-
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent) {
- return new GenericOrmManyToOneMapping(parent);
- }
-
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent) {
- return new GenericOrmOneToManyMapping(parent);
- }
-
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent) {
- return new GenericOrmOneToOneMapping(parent);
- }
-
- public OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent) {
- return new GenericOrmTransientMapping(parent);
- }
-
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent) {
- return new GenericOrmVersionMapping(parent);
- }
-
- public OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent) {
- return new GenericOrmNullAttributeMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java
deleted file mode 100644
index b147dd2f3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaPlatform.java
+++ /dev/null
@@ -1,278 +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.internal.platform;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.java.DefaultJavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaNullAttributeMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingProvider;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJpaPlatform implements JpaPlatform
-{
- public static String ID = "generic";
-
- private String id;
-
- protected JpaFactory jpaFactory;
-
- protected JpaAnnotationProvider annotationProvider;
-
- protected Collection<JavaTypeMappingProvider> javaTypeMappingProviders;
-
- protected Collection<JavaAttributeMappingProvider> javaAttributeMappingProviders;
-
- protected List<DefaultJavaAttributeMappingProvider> defaultJavaAttributeMappingProviders;
-
- public GenericJpaPlatform() {
- super();
- }
-
-
- public String getId() {
- return this.id;
- }
-
- /**
- * *************
- * * IMPORTANT * For INTERNAL use only !!
- * *************
- *
- * @see JpaPlatform#setId(String)
- */
- public void setId(String theId) {
- this.id = theId;
- }
-
-
- // **************** Model construction / updating **************************
-
- public JpaFactory jpaFactory() {
- if (this.jpaFactory == null) {
- this.jpaFactory = buildJpaFactory();
- }
- return this.jpaFactory;
- }
-
- protected JpaFactory buildJpaFactory() {
- return new GenericJpaFactory();
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file) {
- if (jpaFactory().hasRelevantContent(file)) {
- ResourceModel resourceModel = jpaFactory().buildResourceModel(jpaProject, file);
- return jpaFactory().buildJpaFile(jpaProject, file, resourceModel);
- }
-
- return null;
- }
-
-
- // **************** java annotation support ********************************
-
- public JpaAnnotationProvider annotationProvider() {
- if (this.annotationProvider == null) {
- this.annotationProvider = buildAnnotationProvider();
- }
- return this.annotationProvider;
- }
-
- protected JpaAnnotationProvider buildAnnotationProvider() {
- return new GenericJpaAnnotationProvider();
- }
-
-
- // **************** type mapping support ********************************
-
- public JavaTypeMapping buildJavaTypeMappingFromMappingKey(String typeMappingKey, JavaPersistentType parent) {
- return javaTypeMappingProviderFromMappingKey(typeMappingKey).buildMapping(parent, jpaFactory());
- }
-
- public JavaTypeMapping buildJavaTypeMappingFromAnnotation(String mappingAnnotationName, JavaPersistentType parent) {
- return javaTypeMappingProviderFromAnnotation(mappingAnnotationName).buildMapping(parent, jpaFactory());
- }
-
- public JavaAttributeMapping buildJavaAttributeMappingFromMappingKey(String attributeMappingKey, JavaPersistentAttribute parent) {
- return javaAttributeMappingProviderFromMappingKey(attributeMappingKey).buildMapping(parent, jpaFactory());
- }
-
- public JavaAttributeMapping buildJavaAttributeMappingFromAnnotation(String mappingAnnotationName, JavaPersistentAttribute parent) {
- return javaAttributeMappingProviderFromAnnotation(mappingAnnotationName).buildMapping(parent, jpaFactory());
- }
-
- public JavaAttributeMapping buildDefaultJavaAttributeMapping(JavaPersistentAttribute parent) {
- return defaultJavaAttributeMappingProvider(parent).buildMapping(parent, jpaFactory());
- }
-
- protected Iterator<JavaTypeMappingProvider> javaTypeMappingProviders() {
- if (this.javaTypeMappingProviders == null) {
- this.javaTypeMappingProviders = new ArrayList<JavaTypeMappingProvider>();
- this.addJavaTypeMappingProvidersTo(this.javaTypeMappingProviders);
- }
- return new CloneIterator<JavaTypeMappingProvider>(this.javaTypeMappingProviders);
- }
-
- /**
- * Override this to specify more or different type mapping providers.
- * The default includes the JPA spec-defined type mappings of
- * Entity, MappedSuperclass, and Embeddable
- */
- protected void addJavaTypeMappingProvidersTo(Collection<JavaTypeMappingProvider> providers) {
- providers.add(JavaEntityProvider.instance());
- providers.add(JavaMappedSuperclassProvider.instance());
- providers.add(JavaEmbeddableProvider.instance());
- providers.add(JavaNullTypeMappingProvider.instance());
- }
-
- protected JavaTypeMappingProvider javaTypeMappingProviderFromMappingKey(String typeMappingKey) {
- for (Iterator<JavaTypeMappingProvider> i = this.javaTypeMappingProviders(); i.hasNext(); ) {
- JavaTypeMappingProvider provider = i.next();
- if (provider.key() == typeMappingKey) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + typeMappingKey);
- }
-
- protected JavaTypeMappingProvider javaTypeMappingProviderFromAnnotation(String annotationName) {
- for (Iterator<JavaTypeMappingProvider> i = this.javaTypeMappingProviders(); i.hasNext(); ) {
- JavaTypeMappingProvider provider = i.next();
- if (provider.annotationName() == annotationName) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal annotation name: " + annotationName);
- }
-
- protected Iterator<JavaAttributeMappingProvider> javaAttributeMappingProviders() {
- if (this.javaAttributeMappingProviders == null) {
- this.javaAttributeMappingProviders = new ArrayList<JavaAttributeMappingProvider>();
- this.addJavaAttributeMappingProvidersTo(this.javaAttributeMappingProviders);
- }
- return new CloneIterator<JavaAttributeMappingProvider>(this.javaAttributeMappingProviders);
- }
-
- /**
- * Override this to specify more or different attribute mapping providers.
- * The default includes the JPA spec-defined attribute mappings of
- * Basic, Id, Transient OneToOne, OneToMany, ManyToOne, ManyToMany, Embeddable, EmbeddedId, Version.
- */
- protected void addJavaAttributeMappingProvidersTo(Collection<JavaAttributeMappingProvider> providers) {
- providers.add(JavaBasicMappingProvider.instance());
- providers.add(JavaEmbeddedMappingProvider.instance());
- providers.add(JavaEmbeddedIdMappingProvider.instance());
- providers.add(JavaIdMappingProvider.instance());
- providers.add(JavaManyToManyMappingProvider.instance());
- providers.add(JavaManyToOneMappingProvider.instance());
- providers.add(JavaOneToManyMappingProvider.instance());
- providers.add(JavaOneToOneMappingProvider.instance());
- providers.add(JavaTransientMappingProvider.instance());
- providers.add(JavaVersionMappingProvider.instance());
- }
-
- protected JavaAttributeMappingProvider javaAttributeMappingProviderFromMappingKey(String attributeMappingKey) {
- for (Iterator<JavaAttributeMappingProvider> i = this.javaAttributeMappingProviders(); i.hasNext(); ) {
- JavaAttributeMappingProvider provider = i.next();
- if (provider.key() == attributeMappingKey) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + attributeMappingKey);
- }
-
- protected JavaAttributeMappingProvider javaAttributeMappingProviderFromAnnotation(String annotationName) {
- for (Iterator<JavaAttributeMappingProvider> i = this.javaAttributeMappingProviders(); i.hasNext(); ) {
- JavaAttributeMappingProvider provider = i.next();
- if (provider.annotationName() == annotationName) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Illegal annotation name: " + annotationName);
- }
-
- protected ListIterator<DefaultJavaAttributeMappingProvider> defaultJavaAttributeMappingProviders() {
- if (this.defaultJavaAttributeMappingProviders == null) {
- this.defaultJavaAttributeMappingProviders = new ArrayList<DefaultJavaAttributeMappingProvider>();
- this.addDefaultJavaAttributeMappingProvidersTo(this.defaultJavaAttributeMappingProviders);
- }
- return new CloneListIterator<DefaultJavaAttributeMappingProvider>(this.defaultJavaAttributeMappingProviders);
- }
-
- /**
- * Override this to specify more or different default attribute mapping providers.
- * The default includes the JPA spec-defined attribute mappings of
- * Embedded and Basic.
- */
- protected void addDefaultJavaAttributeMappingProvidersTo(List<DefaultJavaAttributeMappingProvider> providers) {
- providers.add(JavaEmbeddedMappingProvider.instance()); //bug 190344 need to test default embedded before basic
- providers.add(JavaBasicMappingProvider.instance());
- }
-
- protected JavaAttributeMappingProvider defaultJavaAttributeMappingProvider(JavaPersistentAttribute persistentAttribute) {
- for (Iterator<DefaultJavaAttributeMappingProvider> i = this.defaultJavaAttributeMappingProviders(); i.hasNext(); ) {
- DefaultJavaAttributeMappingProvider provider = i.next();
- if (provider.defaultApplies(persistentAttribute)) {
- return provider;
- }
- }
-
- return nullAttributeMappingProvider();
- }
-
- public String defaultJavaAttributeMappingKey(JavaPersistentAttribute persistentAttribute) {
- return defaultJavaAttributeMappingProvider(persistentAttribute).key();
- }
-
- /**
- * the "null" attribute mapping is used when the attribute is neither
- * modified with a mapping annotation nor mapped by a "default" mapping
- */
- protected JavaAttributeMappingProvider nullAttributeMappingProvider() {
- return JavaNullAttributeMappingProvider.instance();
- }
-
- // **************** Validation *********************************************
-
- public void addToMessages(JpaProject project, List<IMessage> messages) {
- project.addToMessages(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
deleted file mode 100644
index e626742d9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JpaPlatformRegistry.java
+++ /dev/null
@@ -1,215 +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.internal.platform;
-
-import java.util.HashMap;
-import java.util.Iterator;
-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.Platform;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Singleton registry for storing all the registered JPA platform configuration
- * elements and instantiating JPA platforms from them.
- */
-public class JpaPlatformRegistry {
-
- private final HashMap<String, IConfigurationElement> jpaPlatformConfigurationElements;
-
-
- // singleton
- private static final JpaPlatformRegistry INSTANCE = new JpaPlatformRegistry();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformRegistry instance() {
- return INSTANCE;
- }
-
- 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_LABEL = "label"; //$NON-NLS-1$
- private static final String AT_CLASS = "class"; //$NON-NLS-1$
-
-
- // ********** constructor/initialization **********
-
- /**
- * ensure single instance
- */
- private JpaPlatformRegistry() {
- super();
- this.jpaPlatformConfigurationElements = this.buildJpaPlatformConfigurationElements();
- }
-
-
- private HashMap<String, IConfigurationElement> buildJpaPlatformConfigurationElements() {
- HashMap<String, IConfigurationElement> configElements = new HashMap<String, IConfigurationElement>();
- for (Iterator<IConfigurationElement> stream = this.configElements(); stream.hasNext(); ) {
- this.addConfigElementTo(stream.next(), configElements);
- }
- return configElements;
- }
-
- /**
- * Return the configuration elements from the Eclipse platform extension
- * registry.
- */
- private Iterator<IConfigurationElement> configElements() {
- return new CompositeIterator<IConfigurationElement>(
- new TransformationIterator<IExtension, Iterator<IConfigurationElement>>(this.extensions()) {
- @Override
- protected Iterator<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterator(extension.getConfigurationElements());
- }
- }
- );
- }
-
- private Iterator<IExtension> extensions() {
- return CollectionTools.iterator(this.extensionPoint().getExtensions());
- }
-
- private IExtensionPoint extensionPoint() {
- return Platform.getExtensionRegistry().getExtensionPoint(JptCorePlugin.PLUGIN_ID, EXTENSION_ID);
- }
-
- private void addConfigElementTo(IConfigurationElement configElement, HashMap<String, IConfigurationElement> configElements) {
- if ( ! configElement.getName().equals(EL_PLATFORM)) {
- return;
- }
- if ( ! this.configElementIsValid(configElement)) {
- return;
- }
-
- String id = configElement.getAttribute(AT_ID);
- IConfigurationElement prev = configElements.get(id);
- if (prev == null) {
- configElements.put(id, configElement);
- } else {
- this.logDuplicatePlatform(prev, configElement);
- }
- }
-
- /**
- * check *all* attributes before returning
- */
- private boolean configElementIsValid(IConfigurationElement configElement) {
- boolean valid = true;
- if (configElement.getAttribute(AT_ID) == null) {
- this.logMissingAttribute(configElement, AT_ID);
- valid = false;
- }
- if (configElement.getAttribute(AT_LABEL) == null) {
- logMissingAttribute(configElement, AT_LABEL);
- valid = false;
- }
- if (configElement.getAttribute(AT_CLASS) == null) {
- logMissingAttribute(configElement, AT_CLASS);
- valid = false;
- }
- return valid;
- }
-
-
- // ********** public methods **********
-
- /**
- * Return the IDs for the registered JPA platforms.
- * This does not activate any of the JPA platforms' plug-ins.
- */
- public Iterator<String> jpaPlatformIds() {
- return new ReadOnlyIterator<String>(this.jpaPlatformConfigurationElements.keySet());
- }
-
- /**
- * Return the label for the JPA platform with the specified ID.
- * This does not activate the JPA platform's plug-in.
- */
- public String jpaPlatformLabel(String id) {
- return this.jpaPlatformConfigurationElements.get(id).getAttribute(AT_LABEL);
- }
-
- /**
- * Return a new JPA platform for the specified ID.
- * NB: This should only be called when instantiating a JPA platform
- * when building a new JPA project.
- * Unlike other registry methods, invoking this method may activate
- * the plug-in.
- */
- public JpaPlatform jpaPlatform(String id) {
- IConfigurationElement configElement = this.jpaPlatformConfigurationElements.get(id);
- if (configElement == null) {
- throw new IllegalArgumentException(id);
- }
- JpaPlatform platform;
- try {
- platform = (JpaPlatform) configElement.createExecutableExtension(AT_CLASS);
- } catch (CoreException ex) {
- this.logFailedInstantiation(configElement, ex);
- throw new IllegalArgumentException(id);
- }
- platform.setId(id);
- return platform;
- }
-
-
- // ********** errors **********
-
- // TODO externalize strings
- private void logMissingAttribute(IConfigurationElement configElement, String attributeName) {
- String message =
- "An extension element \""
- + configElement.getName()
- + "\" in plugin \""
- + configElement.getContributor().getName()
- + "\" is missing a required attribute \""
- + attributeName
- + "\".";
- JptCorePlugin.log(message);
- }
-
- // TODO externalize strings
- private void logDuplicatePlatform(IConfigurationElement prevConfigElement, IConfigurationElement newConfigElement) {
- String message =
- "The plugins \""
- + prevConfigElement.getContributor().getName()
- + "\" and \""
- + newConfigElement.getContributor().getName()
- + "\" have registered a duplicate attribute \"id\" "
- + "for the extension element \"jpaPlatform\".";
- JptCorePlugin.log(message);
- }
-
- // TODO externalize strings
- private void logFailedInstantiation(IConfigurationElement configElement, CoreException ex) {
- String message =
- "Could not instantiate the class \""
- + configElement.getAttribute(AT_CLASS)
- + "\" for the extension element \""
- + configElement.getName()
- + "\" in the plugin \""
- + configElement.getContributor().getName()
- + "\".";
- JptCorePlugin.log(message);
- JptCorePlugin.log(ex);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java
deleted file mode 100644
index c601f4be5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceConstants.java
+++ /dev/null
@@ -1,18 +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.internal.prefs;
-
-/**
- * Constant definitions for plug-in preferences
- */
-public class JpaPreferenceConstants
-{
- public static final String PREF_DEFAULT_JPA_LIB = "defaultJpaLib";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java
deleted file mode 100644
index 792fdf0f9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java
+++ /dev/null
@@ -1,29 +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.internal.prefs;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * Class used to initialize default preference values.
- */
-public class JpaPreferenceInitializer extends AbstractPreferenceInitializer
-{
- @Override
- public void initializeDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(JptCorePlugin.instance().getBundle().getSymbolicName());
-
- // default JPA library
- node.put(JpaPreferenceConstants.PREF_DEFAULT_JPA_LIB, "");
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.java
deleted file mode 100644
index 8dcc16aaf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/common/translators/BooleanTranslator.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.core.internal.resource.common.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BooleanTranslator extends Translator
-{
- public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE);
- }
-
- public BooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) {
- super(domNameAndPath, aFeature, BOOLEAN_FEATURE | BOOLEAN_LOWERCASE | style);
- }
-
- @Override
- public Object convertStringToValue(String strValue, EObject owner) {
- return Boolean.valueOf(strValue);
- }
-
- @Override
- public String convertValueToString(Object value, EObject owner) {
- return ((Boolean) value).toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractAnnotationResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractAnnotationResource.java
deleted file mode 100644
index d4b6c1fdc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractAnnotationResource.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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-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.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-public abstract class AbstractAnnotationResource<E extends Member> extends AbstractMemberResource<E>
- implements Annotation
-{
- private final DeclarationAnnotationAdapter daa;
-
- private final AnnotationAdapter annotationAdapter;
-
- protected AbstractAnnotationResource(JavaResourceNode parent, E member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member);
- this.daa = daa;
- this.annotationAdapter = annotationAdapter;
- }
-
- protected AbstractAnnotationResource(JavaResourceNode parent, E member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
-
- public AnnotationAdapter getAnnotationAdapter() {
- return this.annotationAdapter;
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return getAnnotationAdapter().getAnnotation(astRoot);
- }
-
- public DeclarationAnnotationAdapter getDeclarationAnnotationAdapter() {
- return this.daa;
- }
-
- public void removeAnnotation() {
- getAnnotationAdapter().removeAnnotation();
- }
-
- public void newAnnotation() {
- getAnnotationAdapter().newMarkerAnnotation();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return getMember().annotationTextRange(this.daa, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractColumnImpl.java
deleted file mode 100644
index 95dd653eab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractColumnImpl.java
+++ /dev/null
@@ -1,218 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AbstractColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-public abstract class AbstractColumnImpl extends AbstractNamedColumn implements AbstractColumnAnnotation
-{
- // hold this so we can get the 'table' text range
- private final DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
-
- // hold this so we can get the 'unique' text range
- private final DeclarationAnnotationElementAdapter<Boolean> uniqueDeclarationAdapter;
-
- // hold this so we can get the 'nullable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> nullableDeclarationAdapter;
-
- // hold this so we can get the 'insertable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> insertableDeclarationAdapter;
-
- // hold this so we can get the 'updatable' text range
- private final DeclarationAnnotationElementAdapter<Boolean> updatableDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> tableAdapter;
-
- private final AnnotationElementAdapter<Boolean> uniqueAdapter;
-
- private final AnnotationElementAdapter<Boolean> nullableAdapter;
-
- private final AnnotationElementAdapter<Boolean> insertableAdapter;
-
- private final AnnotationElementAdapter<Boolean> updatableAdapter;
-
- private String table;
- private Boolean unique;
- private Boolean nullable;
- private Boolean insertable;
- private Boolean updatable;
-
-
- public AbstractColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public AbstractColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.tableDeclarationAdapter = this.buildStringElementAdapter(this.tableElementName());
- this.tableAdapter = this.buildShortCircuitElementAdapter(this.tableDeclarationAdapter);
- this.uniqueDeclarationAdapter = this.buildBooleanElementAdapter(this.uniqueElementName());
- this.uniqueAdapter = this.buildShortCircuitBooleanElementAdapter(this.uniqueDeclarationAdapter);
- this.nullableDeclarationAdapter = this.buildBooleanElementAdapter(this.nullableElementName());
- this.nullableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nullableDeclarationAdapter);
- this.insertableDeclarationAdapter = this.buildBooleanElementAdapter(this.insertableElementName());
- this.insertableAdapter = this.buildShortCircuitBooleanElementAdapter(this.insertableDeclarationAdapter);
- this.updatableDeclarationAdapter = this.buildBooleanElementAdapter(this.updatableElementName());
- this.updatableAdapter = this.buildShortCircuitBooleanElementAdapter(this.updatableDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.table(astRoot);
- this.unique = this.unique(astRoot);
- this.nullable = this.nullable(astRoot);
- this.insertable = this.insertable(astRoot);
- this.updatable = this.updatable(astRoot);
- }
-
- protected abstract String tableElementName();
-
- protected abstract String uniqueElementName();
-
- protected abstract String nullableElementName();
-
- protected abstract String insertableElementName();
-
- protected abstract String updatableElementName();
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AbstractColumnAnnotation oldColumn = (AbstractColumnAnnotation) oldAnnotation;
- setTable(oldColumn.getTable());
- setUnique(oldColumn.getUnique());
- setNullable(oldColumn.getNullable());
- setInsertable(oldColumn.getInsertable());
- setUpdatable(oldColumn.getUpdatable());
- }
-
- //************* AbstractColumn implementation *************
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String newTable) {
- String oldTable = this.table;
- this.table = newTable;
- this.tableAdapter.setValue(newTable);
- firePropertyChanged(TABLE_PROPERTY, oldTable, newTable);
- }
-
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean newUnique) {
- Boolean oldUnique = this.unique;
- this.unique = newUnique;
- this.uniqueAdapter.setValue(newUnique);
- firePropertyChanged(UNIQUE_PROPERTY, oldUnique, newUnique);
- }
-
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean newNullable) {
- Boolean oldNullable = this.nullable;
- this.nullable = newNullable;
- this.nullableAdapter.setValue(newNullable);
- firePropertyChanged(NULLABLE_PROPERTY, oldNullable, newNullable);
- }
-
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean newInsertable) {
- Boolean oldInsertable = this.insertable;
- this.insertable = newInsertable;
- this.insertableAdapter.setValue(newInsertable);
- firePropertyChanged(INSERTABLE_PROPERTY, oldInsertable, newInsertable);
- }
-
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean newUpdatable) {
- Boolean oldUpdatable = this.updatable;
- this.updatable = newUpdatable;
- this.updatableAdapter.setValue(newUpdatable);
- firePropertyChanged(UPDATABLE_PROPERTY, oldUpdatable, newUpdatable);
- }
-
- public TextRange nullableTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nullableDeclarationAdapter, astRoot);
- }
-
- public TextRange insertableTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.insertableDeclarationAdapter, astRoot);
- }
-
- public TextRange uniqueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.uniqueDeclarationAdapter, astRoot);
- }
-
- public TextRange updatableTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.updatableDeclarationAdapter, astRoot);
- }
-
- public TextRange tableTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.tableDeclarationAdapter, astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.tableDeclarationAdapter, pos, astRoot);
- }
-
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setTable(this.table(astRoot));
- this.setUnique(this.unique(astRoot));
- this.setNullable(this.nullable(astRoot));
- this.setInsertable(this.insertable(astRoot));
- this.setUpdatable(this.updatable(astRoot));
- }
-
- protected String table(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- protected Boolean unique(CompilationUnit astRoot) {
- return this.uniqueAdapter.getValue(astRoot);
- }
-
- protected Boolean nullable(CompilationUnit astRoot) {
- return this.nullableAdapter.getValue(astRoot);
- }
-
- protected Boolean insertable(CompilationUnit astRoot) {
- return this.insertableAdapter.getValue(astRoot);
- }
-
- protected Boolean updatable(CompilationUnit astRoot) {
- return this.updatableAdapter.getValue(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java
deleted file mode 100644
index 1d63c5ecd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourcePersistentMember.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-public abstract class AbstractJavaResourcePersistentMember<E extends Member> extends AbstractMemberResource<E>
- implements JavaResourcePersistentMember
-{
- /**
- * stores all annotations(non-mapping) except duplicates, java compiler has an error for duplicates
- */
- private final Collection<Annotation> annotations;
-
- /**
- * stores all mapping annotations except duplicates, java compiler has an error for duplicates
- */
- private final Collection<Annotation> mappingAnnotations;
-
- private boolean persistable;
-
- public AbstractJavaResourcePersistentMember(JavaResourceNode parent, E member){
- super(parent, member);
- this.annotations = new ArrayList<Annotation>();
- this.mappingAnnotations = new ArrayList<Annotation>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- getMember().bodyDeclaration(astRoot).accept(initializeAnnotationVisitor(astRoot));
- this.persistable = calculatePersistability(astRoot);
- }
-
- protected ASTVisitor initializeAnnotationVisitor(final CompilationUnit astRoot) {
- return new ASTVisitor() {
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- private boolean visit(org.eclipse.jdt.core.dom.Annotation node) {
- if (node.getParent() != getMember().bodyDeclaration(astRoot)) {
- //we don't want to look at annotations for child members, only this member
- return false;
- }
- addInitialAnnotation(node, astRoot);
- return false;
- }
- };
- }
-
- protected void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
- String qualifiedAnnotationName = JDTTools.resolveAnnotation(node);
- if (qualifiedAnnotationName == null) {
- return;
- }
- if (isPossibleAnnotation(qualifiedAnnotationName)) {
- if (annotation(qualifiedAnnotationName) == null) { //don't want duplicates
- Annotation annotation = buildAnnotation(qualifiedAnnotationName);
- annotation.initialize(astRoot);
- this.annotations.add(annotation);
- }
- }
- else if (isPossibleMappingAnnotation(qualifiedAnnotationName)) {
- if (mappingAnnotation(qualifiedAnnotationName) == null) { //don't want duplicates
- Annotation annotation = buildMappingAnnotation(qualifiedAnnotationName);
- annotation.initialize(astRoot);
- this.mappingAnnotations.add(annotation);
- }
- }
- }
-
- protected abstract Annotation buildAnnotation(String annotationName);
-
- protected abstract Annotation buildNullAnnotation(String annotationName);
-
- protected abstract Annotation buildMappingAnnotation(String mappingAnnotationName);
-
- protected abstract Annotation buildNullMappingAnnotation(String annotationName);
-
- protected abstract ListIterator<String> possibleMappingAnnotationNames();
-
- protected abstract boolean isPossibleAnnotation(String annotationName);
-
- protected abstract boolean isPossibleMappingAnnotation(String annotationName);
-
- protected abstract boolean calculatePersistability(CompilationUnit astRoot);
-
- public Annotation annotation(String annotationName) {
- for (Iterator<Annotation> i = annotations(); i.hasNext(); ) {
- Annotation annotation = i.next();
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- public JavaResourceNode nonNullAnnotation(String annotationName) {
- Annotation annotation = annotation(annotationName);
- if (annotation == null) {
- return buildNullAnnotation(annotationName);
- }
- return annotation;
- }
-
- public Annotation mappingAnnotation(String annotationName) {
- for (Iterator<Annotation> i = mappingAnnotations(); i.hasNext(); ) {
- Annotation mappingAnnotation = i.next();
- if (mappingAnnotation.getAnnotationName().equals(annotationName)) {
- return mappingAnnotation;
- }
- }
- return null;
- }
-
- public JavaResourceNode nonNullMappingAnnotation(String annotationName) {
- Annotation annotation = mappingAnnotation(annotationName);
- if (annotation == null) {
- return buildNullMappingAnnotation(annotationName);
- }
- return annotation;
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Annotation> annotations() {
- return new CloneIterator<Annotation>(this.annotations);
- }
-
- public int annotationsSize() {
- return this.annotations.size();
- }
-
- public Annotation addAnnotation(String annotationName) {
- Annotation annotation = buildAnnotation(annotationName);
- this.annotations.add(annotation);
- annotation.newAnnotation();
- this.fireItemAdded(ANNOTATIONS_COLLECTION, annotation);
- return annotation;
- }
-
- @SuppressWarnings("unchecked")
- protected ContainerAnnotation<NestableAnnotation> addContainerAnnotation(String containerAnnotationName) {
- return (ContainerAnnotation<NestableAnnotation>) addAnnotation(containerAnnotationName);
- }
-
- protected ContainerAnnotation<NestableAnnotation> addContainerAnnotationTwoNestableAnnotations(String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = buildContainerAnnotation(containerAnnotationName);
- this.annotations.add(containerAnnotation);
- containerAnnotation.newAnnotation();
- containerAnnotation.addInternal(0).newAnnotation();
- containerAnnotation.addInternal(1).newAnnotation();
- return containerAnnotation;
- }
-
- @SuppressWarnings("unchecked")
- protected ContainerAnnotation<NestableAnnotation> buildContainerAnnotation(String containerAnnotationName) {
- return (ContainerAnnotation<NestableAnnotation>) buildAnnotation(containerAnnotationName);
- }
-
- @SuppressWarnings("unchecked")
- protected ContainerAnnotation<NestableAnnotation> containerAnnotation(String containerAnnotationName) {
- return (ContainerAnnotation<NestableAnnotation>) annotation(containerAnnotationName);
- }
-
- protected NestableAnnotation nestableAnnotation(String nestableAnnotationName) {
- return (NestableAnnotation) annotation(nestableAnnotationName);
- }
-
- protected NestableAnnotation addNestableAnnotation(String nestableAnnotationName) {
- return (NestableAnnotation) addAnnotation(nestableAnnotationName);
- }
-
- //TODO it seems we should be firing one change notification here, that a new nestable annotation was added.
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- NestableAnnotation nestedAnnotation = (NestableAnnotation) annotation(nestableAnnotationName);
-
- ContainerAnnotation<NestableAnnotation> containerAnnotation = containerAnnotation(containerAnnotationName);
-
- if (containerAnnotation != null) {
- //ignore any nestableAnnotation and just add to the plural one
- NestableAnnotation newNestedAnnotation = ContainerAnnotationTools.addNestedAnnotation(index, containerAnnotation);
- //TODO any event notification being fired for the add???
- return newNestedAnnotation;
- }
- if (nestedAnnotation == null) {
- //add the nestable since neither nestable or container exists
- return addNestableAnnotation(nestableAnnotationName);
- }
- //move the nestable to a new container annotation and add to it
- ContainerAnnotation<NestableAnnotation> newContainerAnnotation = addContainerAnnotationTwoNestableAnnotations(containerAnnotationName);
- if (index == 0) {
- newContainerAnnotation.nestedAnnotationAt(1).initializeFrom(nestedAnnotation);
- }
- else {
- newContainerAnnotation.nestedAnnotationAt(0).initializeFrom(nestedAnnotation);
- }
- removeAnnotation(nestedAnnotation);
- return newContainerAnnotation.nestedAnnotationAt(index);
- }
-
- public void move(int targetIndex, int sourceIndex, String containerAnnotationName) {
- move(targetIndex, sourceIndex, containerAnnotation(containerAnnotationName));
- }
-
- protected void move(int targetIndex, int sourceIndex, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- containerAnnotation.move(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, containerAnnotation);
- }
-
- protected void addAnnotation(Annotation annotation) {
- addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
-
- protected void removeAnnotation(Annotation annotation) {
- removeAnnotation_(annotation);
- //TODO looks odd that we remove the annotation here, but in addAnnotation(Annotation) we don't do the same
- annotation.removeAnnotation();
- }
-
- protected void removeAnnotation_(Annotation annotation) {
- removeItemFromCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
-
- protected void addMappingAnnotation(String mappingAnnotationName) {
- if (mappingAnnotation(mappingAnnotationName) != null) {
- return;
- }
- Annotation mappingAnnotation = buildMappingAnnotation(mappingAnnotationName);
- addMappingAnnotation(mappingAnnotation);
- //TODO should this be done here or should creating the Annotation do this??
- mappingAnnotation.newAnnotation();
- }
-
- protected void addMappingAnnotation(Annotation annotation) {
- addItemToCollection(annotation, this.mappingAnnotations, MAPPING_ANNOTATIONS_COLLECTION);
- }
-
- protected void removeMappingAnnotation(Annotation annotation) {
- removeMappingAnnotation_(annotation);
- annotation.removeAnnotation();
- }
-
- protected void removeMappingAnnotation_(Annotation annotation) {
- removeItemFromCollection(annotation, this.mappingAnnotations, MAPPING_ANNOTATIONS_COLLECTION);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Annotation> mappingAnnotations() {
- return new CloneIterator<Annotation>(this.mappingAnnotations);
- }
-
- public int mappingAnnotationsSize() {
- return this.mappingAnnotations.size();
- }
-
- public void removeAnnotation(String annotationName) {
- Annotation annotation = annotation(annotationName);
- if (annotation != null) {
- removeAnnotation(annotation);
- }
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = containerAnnotation(containerAnnotationName);
- if (containerAnnotation == null) {
- Annotation annotation = annotation(nestableAnnotationName);
- removeAnnotation(annotation);
- }
- else {
- removeAnnotation(index, containerAnnotation);
- }
- }
-
- protected void removeAnnotation(int index, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- NestableAnnotation nestableAnnotation = containerAnnotation.nestedAnnotationAt(index);
- containerAnnotation.remove(index);
- //TODO move these 2 lines to the ContainerAnnotation implementation, i think
- nestableAnnotation.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, containerAnnotation);
-
- if (containerAnnotation.nestedAnnotationsSize() == 0) {
- removeAnnotation(containerAnnotation);
- }
- else if (containerAnnotation.nestedAnnotationsSize() == 1) {
- NestableAnnotation nestedAnnotation = containerAnnotation.nestedAnnotationAt(0);
- removeAnnotation(containerAnnotation);
- NestableAnnotation newAnnotation = (NestableAnnotation) addAnnotation(containerAnnotation.getNestableAnnotationName());
- newAnnotation.initializeFrom(nestedAnnotation);
- }
- }
- // removes all other *mapping* annotations that exist, not just the one returned by mappingAnnotation()
- // mappingAnnotation() returns the first mapping annotation found in the source. if there are multiple
- // mapping annotations (which is a validation error condition) then calling this api would not work
- // because the new mapping annotatio would be added to the end of the list of annotations.
- public void setMappingAnnotation(String annotationName) {
- if (mappingAnnotation(annotationName) != null) {
- throw new IllegalStateException("The mapping annotation named " + annotationName + " already exists.");
- }
- Annotation oldMapping = mappingAnnotation();
- Annotation newMapping = null;
- if (oldMapping != null) {
- removeUnnecessaryAnnotations(annotationName);
- }
- if (annotationName != null) {
- if (mappingAnnotation(annotationName) != null) {
- return;
- }
- newMapping = buildMappingAnnotation(annotationName);
- this.mappingAnnotations.add(newMapping);
- newMapping.newAnnotation();
- }
- //have to hold property change notification until the end so a project update does not occur
- //before we are finished removing the old mapping and adding the new mapping
- //just firing collectio changed since one or more removes and one add was completed.
- //if we ever listen for specific events instead of just doing a mass update, we might need to make this more specific
- fireCollectionChanged(MAPPING_ANNOTATIONS_COLLECTION);
- }
- /**
- * Remove all mapping annotations that already exist.
- * No change notification fired.
- */
- protected void removeUnnecessaryAnnotations(String newMappingAnnotationName) {
- for (ListIterator<String> i = possibleMappingAnnotationNames(); i.hasNext(); ) {
- String mappingAnnotationName = i.next();
- if (mappingAnnotationName != newMappingAnnotationName) {
- Annotation mappingAnnotation = mappingAnnotation(mappingAnnotationName);
- if (mappingAnnotation != null) {
- this.mappingAnnotations.remove(mappingAnnotation);
- mappingAnnotation.removeAnnotation();
- }
- }
- }
- }
-
- //TODO need property change notification on this mappingAnnotation changing
- //from the context model we don't really care if their are multiple mapping annotations,
- //just which one we need to use
- public Annotation mappingAnnotation() {
- for (ListIterator<String> i = possibleMappingAnnotationNames(); i.hasNext(); ) {
- String mappingAnnotationName = i.next();
- for (Iterator<Annotation> j = mappingAnnotations(); j.hasNext(); ) {
- Annotation mappingAnnotation = j.next();
- if (mappingAnnotationName == mappingAnnotation.getAnnotationName()) {
- return mappingAnnotation;
- }
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = containerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.nestedAnnotations();
- }
- NestableAnnotation nestableAnnotation = nestableAnnotation(nestableAnnotationName);
- if (nestableAnnotation != null) {
- return new SingleElementListIterator<NestableAnnotation>(nestableAnnotation);
- }
- return EmptyListIterator.instance();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- updateAnnotations(astRoot);
- setPersistable(calculatePersistability(astRoot));
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- setPersistable(calculatePersistability(astRoot));
- }
-
- protected void updateAnnotations(CompilationUnit astRoot) {
- getMember().bodyDeclaration(astRoot).accept(annotationVisitor(astRoot));
- removeMappingAnnotationsNotInSource(astRoot);
- removeAnnotationsNotInSource(astRoot);
- }
-
- protected void removeAnnotationsNotInSource(CompilationUnit astRoot) {
- for (Annotation annotation : CollectionTools.iterable(annotations())) {
- if (annotation.jdtAnnotation(astRoot) == null) {
- removeAnnotation_(annotation);
- }
- }
- }
-
- protected void removeMappingAnnotationsNotInSource(CompilationUnit astRoot) {
- for (Annotation mappingAnnotation : CollectionTools.iterable(mappingAnnotations())) {
- if (mappingAnnotation.jdtAnnotation(astRoot) == null) {
- removeMappingAnnotation_(mappingAnnotation);
- }
- }
- }
-
- protected ASTVisitor annotationVisitor(final CompilationUnit astRoot) {
- return new ASTVisitor() {
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- private boolean visit(org.eclipse.jdt.core.dom.Annotation node) {
- if (node.getParent() != getMember().bodyDeclaration(astRoot)) {
- //we don't want to look at annotations for child members, only this member
- return false;
- }
- addOrUpdateAnnotation(node, astRoot);
- return false;
- }
- };
- }
-
- protected void addOrUpdateAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
- String qualifiedAnnotationName = JDTTools.resolveAnnotation(node);
- if (qualifiedAnnotationName == null) {
- return;
- }
- if (isPossibleAnnotation(qualifiedAnnotationName)) {
- Annotation annotation = annotation(qualifiedAnnotationName);
- if (annotation != null) {
- annotation.updateFromJava(astRoot);
- }
- else {
- annotation = buildAnnotation(qualifiedAnnotationName);
- annotation.initialize(astRoot);
- addAnnotation(annotation);
- }
- }
- else if (isPossibleMappingAnnotation(qualifiedAnnotationName)) {
- Annotation annotation = mappingAnnotation(qualifiedAnnotationName);
- if (annotation != null) {
- annotation.updateFromJava(astRoot);
- }
- else {
- annotation = buildMappingAnnotation(qualifiedAnnotationName);
- annotation.initialize(astRoot);
- addMappingAnnotation(annotation);
- }
- }
- }
-
- public boolean isFor(IMember member) {
- return getMember().wraps(member);
- }
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- protected void setPersistable(boolean newPersistable) {
- boolean oldPersistable = this.persistable;
- this.persistable = newPersistable;
- firePropertyChanged(PERSISTABLE_PROPERTY, oldPersistable, newPersistable);
- //TODO change notification to parent so that the context model gets notification
- //that the list of persistable fields has been updated
- //
- }
-
- public boolean isPersisted() {
- return mappingAnnotation() != null;
- }
-
-
- public TextRange fullTextRange(CompilationUnit astRoot) {
- return this.getMember().textRange(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return this.fullTextRange(astRoot);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.getMember().nameTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractMemberResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractMemberResource.java
deleted file mode 100644
index dedc0e8430..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractMemberResource.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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-public abstract class AbstractMemberResource<E extends Member> extends AbstractResource
-{
- private final E member;
-
-
- protected AbstractMemberResource(JavaResourceNode parent, E member) {
- super(parent);
- this.member = member;
- }
-
-
- public E getMember() {
- return this.member;
- }
-
- protected TextRange elementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
- return this.elementTextRange(this.member.annotationElementTextRange(elementAdapter, astRoot), astRoot);
- }
-
- /**
- * Convenience method. If the specified element text range is null
- * return the Java object's text range instead (which is usually the
- * annotation's text range).
- */
- protected TextRange elementTextRange(TextRange elementTextRange, CompilationUnit astRoot) {
- return (elementTextRange != null) ? elementTextRange : this.textRange(astRoot);
- }
-
- /**
- * Convenience method. Return whether the specified position touches the element.
- * Returns false if the element does not exist
- */
- protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.member.annotationElementTextRange(elementAdapter, astRoot), pos);
- }
-
- /**
- * Convenience method. Return whether element's text range is not
- * null (meaning the element exists) and the specified position touches it.
- */
- protected boolean elementTouches(TextRange elementTextRange, int pos) {
- return (elementTextRange != null) && elementTextRange.touches(pos);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java
deleted file mode 100644
index aea450deb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedColumn.java
+++ /dev/null
@@ -1,140 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.BooleanExpressionConverter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-public abstract class AbstractNamedColumn extends AbstractAnnotationResource<Member> implements NamedColumnAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'columnDefinition' text range
- private final DeclarationAnnotationElementAdapter<String> columnDefinitionDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> columnDefinitionAdapter;
-
- private String name;
- private String columnDefinition;
-
- public AbstractNamedColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildStringElementAdapter(this.nameElementName());
- this.nameAdapter = this.buildShortCircuitElementAdapter(this.nameDeclarationAdapter);
- this.columnDefinitionDeclarationAdapter = this.buildStringElementAdapter(this.columnDefinitionElementName());
- this.columnDefinitionAdapter = this.buildShortCircuitElementAdapter(this.columnDefinitionDeclarationAdapter);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(getDeclarationAnnotationAdapter(), elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(getDeclarationAnnotationAdapter(), elementName, BooleanExpressionConverter.instance());
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildIntegerElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(getDeclarationAnnotationAdapter(), elementName, NumberIntegerExpressionConverter.instance());
- }
-
- protected AnnotationElementAdapter<String> buildShortCircuitElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new ShortCircuitAnnotationElementAdapter<Boolean>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildShortCircuitIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new ShortCircuitAnnotationElementAdapter<Integer>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<String> buildShortCircuitStringElementAdapter(String elementName) {
- return this.buildShortCircuitElementAdapter(this.buildStringElementAdapter(elementName));
- }
- protected abstract String nameElementName();
-
- protected abstract String columnDefinitionElementName();
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.columnDefinition = this.columnDefinition(astRoot);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- NamedColumnAnnotation oldColumn = (NamedColumnAnnotation) oldAnnotation;
- setName(oldColumn.getName());
- setColumnDefinition(oldColumn.getColumnDefinition());
- }
-
- //************* NamedColumn implementation **************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- this.columnDefinitionAdapter.setValue(newColumnDefinition);
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange columnDefinitionTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.columnDefinitionDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setColumnDefinition(this.columnDefinition(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String columnDefinition(CompilationUnit astRoot) {
- return this.columnDefinitionAdapter.getValue(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java
deleted file mode 100644
index 783e8fa66f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractNamedQuery.java
+++ /dev/null
@@ -1,303 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-import org.eclipse.jpt.core.resource.java.QueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public abstract class AbstractNamedQuery extends AbstractAnnotationResource<Type>
- implements QueryAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'query' text range
- private final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> queryAdapter;
-
- private String name;
-
- private String query;
-
- private final List<NestableQueryHint> hints;
- private final HintsContainerAnnotation hintsContainerAnnotation;
-
- protected AbstractNamedQuery(JavaResourceNode parent, Type type,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.nameDeclarationAdapter = nameAdapter(daa);
- this.queryDeclarationAdapter = queryAdapter(daa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
- this.hints = new ArrayList<NestableQueryHint>();
- this.hintsContainerAnnotation = new HintsContainerAnnotation();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.query = this.query(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.hintsContainerAnnotation);
- }
-
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, nameElementName());
- }
-
- protected DeclarationAnnotationElementAdapter<String> queryAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, queryElementName());
- }
-
- protected abstract String nameElementName();
-
- protected abstract String queryElementName();
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- this.queryAdapter.setValue(newQuery);
- firePropertyChanged(QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public NestableQueryHint hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation queryHint) {
- return this.hints.indexOf(queryHint);
- }
-
- public NestableQueryHint addHint(int index) {
- NestableQueryHint queryHint = (NestableQueryHint) ContainerAnnotationTools.addNestedAnnotation(index, this.hintsContainerAnnotation);
- fireItemAdded(QueryAnnotation.HINTS_LIST, index, queryHint);
- return queryHint;
- }
-
- private void addHint(int index, NestableQueryHint queryHint) {
- addItemToList(index, queryHint, this.hints, HINTS_LIST);
- }
-
- public void removeHint(int index) {
- NestableQueryHint queryHint = hintAt(index);
- removeHint(queryHint);
- queryHint.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.hintsContainerAnnotation);
- }
-
- private void removeHint(NestableQueryHint queryHint) {
- removeItemFromList(queryHint, this.hints, HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- moveHintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.hintsContainerAnnotation);
- fireItemMoved(QueryAnnotation.HINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveHintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.hints, targetIndex, sourceIndex);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange queryTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.queryDeclarationAdapter, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setQuery(this.query(astRoot));
- this.updateQueryHintsFromJava(astRoot);
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String query(CompilationUnit astRoot) {
- return this.queryAdapter.getValue(astRoot);
- }
-
- private void updateQueryHintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.hintsContainerAnnotation);
- }
-
- protected abstract NestableQueryHint createQueryHint(int index);
-
- // ********** persistence model -> java annotations **********
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- AbstractNamedQuery oldNamedQuery = (AbstractNamedQuery) oldAnnotation;
- setName(oldNamedQuery.getName());
- setQuery(oldNamedQuery.getQuery());
- for (QueryHintAnnotation queryHint : CollectionTools.iterable(oldNamedQuery.hints())) {
- NestableQueryHint newQueryHint = addHint(oldNamedQuery.indexOfHint(queryHint));
- newQueryHint.initializeFrom((NestableQueryHint) queryHint);
- }
- }
-
-
- private class HintsContainerAnnotation extends AbstractResource implements ContainerAnnotation<NestableQueryHint> {
-
- public HintsContainerAnnotation() {
- super(AbstractNamedQuery.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public NestableQueryHint add(int index) {
- NestableQueryHint queryHint = AbstractNamedQuery.this.createQueryHint(index);
- AbstractNamedQuery.this.addHint(index, queryHint);
- return queryHint;
- }
-
- public NestableQueryHint addInternal(int index) {
- NestableQueryHint queryHint = AbstractNamedQuery.this.createQueryHint(index);
- AbstractNamedQuery.this.hints.add(index, queryHint);
- return queryHint;
- }
-
- public String getAnnotationName() {
- return AbstractNamedQuery.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.QUERY_HINT;
- }
-
- public int indexOf(NestableQueryHint hint) {
- return AbstractNamedQuery.this.indexOfHint(hint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AbstractNamedQuery.this.moveHint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AbstractNamedQuery.this.moveHintInternal(targetIndex, sourceIndex);
- }
-
- public NestableQueryHint nestedAnnotationAt(int index) {
- return AbstractNamedQuery.this.hintAt(index);
- }
-
- public NestableQueryHint nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableQueryHint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableQueryHint> nestedAnnotations() {
- return new CloneListIterator<NestableQueryHint>(AbstractNamedQuery.this.hints);
- }
-
- public int nestedAnnotationsSize() {
- return AbstractNamedQuery.this.hintsSize();
- }
-
- public void remove(NestableQueryHint queryHint) {
- AbstractNamedQuery.this.removeHint(queryHint);
- }
-
- public void remove(int index) {
- AbstractNamedQuery.this.removeHint(nestedAnnotationAt(index));
- }
-
- public Annotation jdtAnnotation(CompilationUnit astRoot) {
- return AbstractNamedQuery.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AbstractNamedQuery.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AbstractNamedQuery.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- AbstractNamedQuery.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return AbstractNamedQuery.this.textRange(astRoot);
- }
-
- public String getElementName() {
- return "hints";
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java
deleted file mode 100644
index 72e72099ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,283 +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.internal.resource.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-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.ExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitArrayAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.CascadeType;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-
-public abstract class AbstractRelationshipMappingAnnotation extends AbstractAnnotationResource<Attribute> implements RelationshipMappingAnnotation
-{
- // hold this so we can get the 'targetEntity' text range
- private final DeclarationAnnotationElementAdapter<String> targetEntityDeclarationAdapter;
-
- // hold this so we can get the 'fetch' text range
- private final DeclarationAnnotationElementAdapter<String> fetchDeclarationAdapter;
-
- // hold this so we can get the 'cascade' text range
- private final DeclarationAnnotationElementAdapter<String[]> cascadeDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> targetEntityAdapter;
-
- private final AnnotationElementAdapter<String> fetchAdapter;
-
- private final AnnotationElementAdapter<String[]> cascadeAdapter;
-
- private String targetEntity;
-
- private String fullyQualifiedTargetEntity;
-
- private FetchType fetch;
-
- private CascadeType[] cascadeTypes;
-
- public AbstractRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.targetEntityDeclarationAdapter = targetEntityAdapter();
- this.targetEntityAdapter = buildAnnotationElementAdapter(this.targetEntityDeclarationAdapter);
- this.fetchDeclarationAdapter = fetchAdapter();
- this.fetchAdapter = buildAnnotationElementAdapter(this.fetchDeclarationAdapter);
- this.cascadeDeclarationAdapter = cascadeAdapter();
- this.cascadeAdapter = new ShortCircuitArrayAnnotationElementAdapter<String>(attribute, this.cascadeDeclarationAdapter);
- this.cascadeTypes = new CascadeType[0];
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(this.getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new ShortCircuitAnnotationElementAdapter<Boolean>(this.getMember(), daea);
- }
-
- /**
- * return the Java adapter's 'targetEntity' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String> targetEntityAdapter();
-
- /**
- * return the Java adapter's 'cascade' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String[]> cascadeAdapter();
-
- /**
- * return the Java adapter's 'fetch' element adapter config
- */
- protected abstract DeclarationAnnotationElementAdapter<String> fetchAdapter();
-
- public void initialize(CompilationUnit astRoot) {
- this.targetEntity = this.targetEntity(astRoot);
- this.fullyQualifiedTargetEntity = this.fullyQualifiedTargetEntity(astRoot);
- this.fetch = this.fetch(astRoot);
- this.initializeCascadeTypes(astRoot);
- }
-
- protected void initializeCascadeTypes(CompilationUnit astRoot) {
- String[] javaValue = this.cascadeAdapter.getValue(astRoot);
- this.cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
- }
-
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String newTargetEntity) {
- String oldTargetEntity = this.targetEntity;
- this.targetEntity = newTargetEntity;
- this.targetEntityAdapter.setValue(newTargetEntity);
- firePropertyChanged(TARGET_ENTITY_PROPERTY, oldTargetEntity, newTargetEntity);
- }
-
- public String getFullyQualifiedTargetEntity() {
- return this.fullyQualifiedTargetEntity;
- }
-
- protected void setFullyQualifiedTargetEntity(String newTargetEntity) {
- String oldTargetEntity = this.fullyQualifiedTargetEntity;
- this.fullyQualifiedTargetEntity = newTargetEntity;
- firePropertyChanged(FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY, oldTargetEntity, newTargetEntity);
- }
-
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType newFetch) {
- FetchType oldFetch = this.fetch;
- this.fetch = newFetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(newFetch));
- firePropertyChanged(FETCH_PROPERTY, oldFetch, newFetch);
- }
-
- public boolean isCascadeAll() {
- return CollectionTools.contains(this.cascadeTypes, CascadeType.ALL);
- }
-
- public void setCascadeAll(boolean newCascadeAll) {
- boolean oldCascadeAll = isCascadeAll();
- setCascade(newCascadeAll, CascadeType.ALL);
- firePropertyChanged(CASCADE_ALL_PROPERTY, oldCascadeAll, newCascadeAll);
- }
-
- public boolean isCascadePersist() {
- return CollectionTools.contains(this.cascadeTypes, CascadeType.PERSIST);
- }
-
- public void setCascadePersist(boolean newCascadePersist) {
- boolean oldCascadePersist = isCascadePersist();
- setCascade(newCascadePersist, CascadeType.PERSIST);
- firePropertyChanged(CASCADE_PERSIST_PROPERTY, oldCascadePersist, newCascadePersist);
- }
-
- public boolean isCascadeMerge() {
- return CollectionTools.contains(this.cascadeTypes, CascadeType.MERGE);
- }
-
- public void setCascadeMerge(boolean newCascadeMerge) {
- boolean oldCascadeMerge = isCascadeMerge();
- setCascade(newCascadeMerge, CascadeType.MERGE);
- firePropertyChanged(CASCADE_MERGE_PROPERTY, oldCascadeMerge, newCascadeMerge);
- }
-
- public boolean isCascadeRemove() {
- return CollectionTools.contains(this.cascadeTypes, CascadeType.REMOVE);
- }
-
- public void setCascadeRemove(boolean newCascadeRemove) {
- boolean oldCascadeRemove = isCascadeRemove();
- setCascade(newCascadeRemove, CascadeType.REMOVE);
- firePropertyChanged(CASCADE_REMOVE_PROPERTY, oldCascadeRemove, newCascadeRemove);
- }
-
- public boolean isCascadeRefresh() {
- return CollectionTools.contains(this.cascadeTypes, CascadeType.REFRESH);
- }
-
- public void setCascadeRefresh(boolean newCascadeRefresh) {
- boolean oldCascadeRefresh = isCascadeRefresh();
- setCascade(newCascadeRefresh, CascadeType.REFRESH);
- firePropertyChanged(CASCADE_REFRESH_PROPERTY, oldCascadeRefresh, newCascadeRefresh);
- }
-
- private void addCascadeType(CascadeType cascadeType) {
- List<CascadeType> cascadeCollection = CollectionTools.list(this.cascadeTypes);
- cascadeCollection.add(cascadeType);
- setCascadeTypes(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
- }
-
- private void removeCascadeType(CascadeType cascadeType) {
- List<CascadeType> cascadeCollection = CollectionTools.list(this.cascadeTypes);
- cascadeCollection.remove(cascadeType);
- setCascadeTypes(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
- }
-
- private void setCascadeTypes(CascadeType[] cascadeTypes) {
- this.cascadeTypes = cascadeTypes;
- String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeTypes);
- this.cascadeAdapter.setValue(newJavaValue);
- }
-
- private void setCascade(boolean isSet, CascadeType cascadeType) {
- List<CascadeType> cascadeCollection = CollectionTools.list(this.cascadeTypes);
- if (cascadeCollection.contains(cascadeType)) {
- if (!isSet) {
- removeCascadeType(cascadeType);
- }
- }
- else {
- if (isSet) {
- addCascadeType(cascadeType);
- }
- }
- }
-
- public TextRange targetEntityTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.targetEntityDeclarationAdapter, astRoot);
- }
-
- public TextRange fetchTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.fetchDeclarationAdapter, astRoot);
- }
-
- public TextRange cascadeTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.cascadeDeclarationAdapter, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setFetch(this.fetch(astRoot));
- this.setTargetEntity(this.targetEntity(astRoot));
- this.setFullyQualifiedTargetEntity(this.fullyQualifiedTargetEntity(astRoot));
- this.updateCascadeFromJava(astRoot);
- }
-
- protected FetchType fetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- protected String targetEntity(CompilationUnit astRoot) {
- return this.targetEntityAdapter.getValue(astRoot);
- }
-
- private void updateCascadeFromJava(CompilationUnit astRoot) {
- String[] javaValue = this.cascadeAdapter.getValue(astRoot);
- CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
- //TODO need to test this, i think it might result in incorrect java
- setCascadeAll(CollectionTools.contains(cascadeTypes, CascadeType.ALL));
- setCascadeMerge(CollectionTools.contains(cascadeTypes, CascadeType.MERGE));
- setCascadePersist(CollectionTools.contains(cascadeTypes, CascadeType.PERSIST));
- setCascadeRefresh(CollectionTools.contains(cascadeTypes, CascadeType.REFRESH));
- setCascadeRemove(CollectionTools.contains(cascadeTypes, CascadeType.REMOVE));
- }
-
- private String fullyQualifiedTargetEntity(CompilationUnit astRoot) {
- if (getTargetEntity() == null) {
- return null;
- }
- return JDTTools.resolveFullyQualifiedName(this.targetEntityAdapter.expression(astRoot));
- }
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- // TODO what about QualifiedType?
- return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance());
- }
-
- protected static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, false, converter);
- }
-
- protected static DeclarationAnnotationElementAdapter<String> buildFetchAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
- }
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildEnumArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumArrayDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResource.java
deleted file mode 100644
index d2add18d6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractResource.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationEditFormatter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-
-public abstract class AbstractResource extends AbstractNode
- implements JavaResourceNode
-{
- protected AbstractResource(JavaResourceNode parent) {
- super(parent);
- }
-
-
- // **************** overrides **********************************************
-
- @Override
- public JavaResourceNode parent() {
- return (JavaResourceNode) super.parent();
- }
-
- @Override
- public JpaCompilationUnitResource root() {
- return (JpaCompilationUnitResource) super.root();
- }
-
-
- // **************** JavaResource implementation ****************************
-
- public JpaAnnotationProvider annotationProvider() {
- return root().annotationProvider();
- }
-
- public CommandExecutorProvider modifySharedDocumentCommandExecutorProvider() {
- return root().modifySharedDocumentCommandExecutorProvider();
- }
-
- public AnnotationEditFormatter annotationEditFormatter() {
- return root().annotationEditFormatter();
- }
-
- public JavaResourceModel resourceModel() {
- return root().resourceModel();
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- }
-
- public String displayString() {
- return toString();
- }
-
- @Override
- protected void aspectChanged(String aspectName) {
- super.aspectChanged(aspectName);
- root().resourceChanged();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractTableResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractTableResource.java
deleted file mode 100644
index 97abb42c05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractTableResource.java
+++ /dev/null
@@ -1,330 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public abstract class AbstractTableResource extends AbstractAnnotationResource<Member> implements TableAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'schema' text range
- private final DeclarationAnnotationElementAdapter<String> schemaDeclarationAdapter;
-
- // hold this so we can get the 'catalog' text range
- private final DeclarationAnnotationElementAdapter<String> catalogDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> schemaAdapter;
-
- private final AnnotationElementAdapter<String> catalogAdapter;
-
- private String name;
-
- private String catalog;
-
- private String schema;
-
- private final List<NestableUniqueConstraint> uniqueConstraints;
-
- private final UniqueConstraintsContainerAnnotation uniqueConstraintsContainerAnnotation;
-
- protected AbstractTableResource(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.nameAdapter(daa);
- this.schemaDeclarationAdapter = this.schemaAdapter(daa);
- this.catalogDeclarationAdapter = this.catalogAdapter(daa);
- this.nameAdapter = buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.schemaAdapter = buildAnnotationElementAdapter(this.schemaDeclarationAdapter);
- this.catalogAdapter = buildAnnotationElementAdapter(this.catalogDeclarationAdapter);
- this.uniqueConstraints = new ArrayList<NestableUniqueConstraint>();
- this.uniqueConstraintsContainerAnnotation = new UniqueConstraintsContainerAnnotation();
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.catalog = this.catalog(astRoot);
- this.schema = this.schema(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(this.getMember(), daea);
- }
-
- /**
- * Build and return a declaration element adapter for the table's 'name' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> nameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- /**
- * Build and return a declaration element adapter for the table's 'schema' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> schemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- /**
- * Build and return a declaration element adapter for the table's 'catalog' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> catalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String newCatalog) {
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- this.catalogAdapter.setValue(newCatalog);
- firePropertyChanged(CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String newSchema) {
- String oldSchema = this.schema;
- this.schema = newSchema;
- this.schemaAdapter.setValue(newSchema);
- firePropertyChanged(SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- public ListIterator<UniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraint uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraint uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraint addUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = (NestableUniqueConstraint) ContainerAnnotationTools.addNestedAnnotation(index, this.uniqueConstraintsContainerAnnotation);
- fireItemAdded(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- private void addUniqueConstraint(int index, NestableUniqueConstraint uniqueConstraint) {
- addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void removeUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = this.uniqueConstraintAt(index);
- removeUniqueConstraint(uniqueConstraint);
- uniqueConstraint.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.uniqueConstraintsContainerAnnotation);
- }
-
- private void removeUniqueConstraint(NestableUniqueConstraint uniqueConstraint) {
- removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- moveUniqueConstraintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.uniqueConstraintsContainerAnnotation);
- fireItemMoved(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveUniqueConstraintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- }
-
- protected abstract NestableUniqueConstraint createUniqueConstraint(int index);
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange schemaTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.schemaDeclarationAdapter, astRoot);
- }
-
- public TextRange catalogTextRange(CompilationUnit astRoot) {
- return elementTextRange(this.catalogDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.catalogDeclarationAdapter, pos, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.schemaDeclarationAdapter, pos, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setSchema(this.schema(astRoot));
- this.setCatalog(this.catalog(astRoot));
- this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String schema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- protected String catalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- /**
- * here we just worry about getting the unique constraints lists the same size;
- * then we delegate to the unique constraints to synch themselves up
- */
- private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
-
- private class UniqueConstraintsContainerAnnotation extends AbstractResource
- implements ContainerAnnotation<NestableUniqueConstraint>
- {
- public UniqueConstraintsContainerAnnotation() {
- super(AbstractTableResource.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableUniqueConstraint addInternal(int index) {
- NestableUniqueConstraint uniqueConstraint = AbstractTableResource.this.createUniqueConstraint(index);
- AbstractTableResource.this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public NestableUniqueConstraint add(int index) {
- NestableUniqueConstraint uniqueConstraint = AbstractTableResource.this.createUniqueConstraint(index);
- AbstractTableResource.this.addUniqueConstraint(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public String getAnnotationName() {
- return AbstractTableResource.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.UNIQUE_CONSTRAINT;
- }
-
- public int indexOf(NestableUniqueConstraint uniqueConstraint) {
- return AbstractTableResource.this.indexOfUniqueConstraint(uniqueConstraint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AbstractTableResource.this.moveUniqueConstraint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AbstractTableResource.this.moveUniqueConstraintInternal(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraint nestedAnnotationAt(int index) {
- return AbstractTableResource.this.uniqueConstraintAt(index);
- }
-
- public NestableUniqueConstraint nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableUniqueConstraint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableUniqueConstraint> nestedAnnotations() {
- return new CloneListIterator<NestableUniqueConstraint>(AbstractTableResource.this.uniqueConstraints);
- }
-
- public int nestedAnnotationsSize() {
- return AbstractTableResource.this.uniqueConstraintsSize();
- }
-
- public void remove(NestableUniqueConstraint uniqueConstraint) {
- AbstractTableResource.this.removeUniqueConstraint(uniqueConstraint);
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public Annotation jdtAnnotation(CompilationUnit astRoot) {
- return AbstractTableResource.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AbstractTableResource.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AbstractTableResource.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- AbstractTableResource.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return AbstractTableResource.this.textRange(astRoot);
- }
-
- public String getElementName() {
- return "uniqueConstraints";
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java
deleted file mode 100644
index 9411902e44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideImpl.java
+++ /dev/null
@@ -1,285 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverride;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class AssociationOverrideImpl
- extends OverrideImpl
- implements NestableAssociationOverride
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final List<NestableJoinColumn> joinColumns;
-
- private final JoinColumnsContainerAnnotation joinColumnsContainerAnnotation;
-
- protected AssociationOverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- this.joinColumnsContainerAnnotation = new JoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.joinColumnsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AssociationOverrideAnnotation oldAssociationOverride = (AssociationOverrideAnnotation) oldAnnotation;
- for (JoinColumnAnnotation joinColumn : CollectionTools.iterable(oldAssociationOverride.joinColumns())) {
- NestableJoinColumn newJoinColumn = addJoinColumn(oldAssociationOverride.indexOfJoinColumn(joinColumn));
- newJoinColumn.initializeFrom((NestableAnnotation) joinColumn);
- }
- }
-
-
- // ************* Association implementation *******************
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumn addJoinColumn(int index) {
- NestableJoinColumn joinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.joinColumnsContainerAnnotation);
- fireItemAdded(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- private void addJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void removeJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.joinColumns.get(index);
- removeJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.joinColumnsContainerAnnotation);
- }
-
- private void removeJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, AssociationOverrideAnnotation.JOIN_COLUMNS_LIST);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- moveJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.joinColumnsContainerAnnotation);
- fireItemMoved(AssociationOverrideAnnotation.JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- protected NestableJoinColumn createJoinColumn(int index) {
- return JoinColumnImpl.createAssociationOverrideJoinColumn(getDeclarationAnnotationAdapter(), this, getMember(), index);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.updateJoinColumnsFromJava(astRoot);
- }
-
- private void updateJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.joinColumnsContainerAnnotation);
- }
-
-
- // ********** static methods **********
- static AssociationOverrideImpl createAssociationOverride(JavaResourceNode parent, Member member) {
- return new AssociationOverrideImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static AssociationOverrideImpl createNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new AssociationOverrideImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- private class JoinColumnsContainerAnnotation extends AbstractResource
- implements ContainerAnnotation<NestableJoinColumn>
- {
- public JoinColumnsContainerAnnotation() {
- super(AssociationOverrideImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = AssociationOverrideImpl.this.createJoinColumn(index);
- AssociationOverrideImpl.this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = AssociationOverrideImpl.this.createJoinColumn(index);
- AssociationOverrideImpl.this.addJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn pkJoinColumn) {
- return AssociationOverrideImpl.this.indexOfJoinColumn(pkJoinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- AssociationOverrideImpl.this.moveJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- AssociationOverrideImpl.this.moveJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return AssociationOverrideImpl.this.joinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(AssociationOverrideImpl.this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return joinColumnsSize();
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public void remove(NestableJoinColumn joinColumn) {
- AssociationOverrideImpl.this.removeJoinColumn(joinColumn);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.JOIN_COLUMN;
- }
-
- public NestableJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableJoinColumn pkJoinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == pkJoinColumn.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return AssociationOverrideImpl.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- AssociationOverrideImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- AssociationOverrideImpl.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- AssociationOverrideImpl.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return AssociationOverrideImpl.this.textRange(astRoot);
- }
-
- public String getElementName() {
- return "joinColumns";
- }
-
- }
-
- public static class AssociationOverrideAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AssociationOverrideAnnotationDefinition INSTANCE = new AssociationOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private AssociationOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return AssociationOverrideImpl.createAssociationOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java
deleted file mode 100644
index 88d471280c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesImpl.java
+++ /dev/null
@@ -1,152 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrides;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverride;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class AssociationOverridesImpl extends AbstractAnnotationResource<Member> implements AssociationOverrides
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected final List<NestableAssociationOverride> associationOverrides;
-
- protected AssociationOverridesImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.associationOverrides = new ArrayList<NestableAssociationOverride>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableAssociationOverride> nestedAnnotations() {
- return new CloneListIterator<NestableAssociationOverride>(this.associationOverrides);
- }
-
- public int nestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- public NestableAssociationOverride addInternal(int index) {
- NestableAssociationOverride associationOverride = createAssociationOverride(index);
- this.associationOverrides.add(index, associationOverride);
- return associationOverride;
- }
-
- public NestableAssociationOverride add(int index) {
- NestableAssociationOverride associationOverride = createAssociationOverride(index);
- add(index, associationOverride);
- return associationOverride;
- }
-
- private void add(int index, NestableAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void remove(NestableAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public int indexOf(NestableAssociationOverride associationOverride) {
- return this.associationOverrides.indexOf(associationOverride);
- }
-
- public NestableAssociationOverride nestedAnnotationAt(int index) {
- return this.associationOverrides.get(index);
- }
-
- public NestableAssociationOverride nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableAssociationOverride associationOverride : this.associationOverrides) {
- if (jdtAnnotation == associationOverride.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return associationOverride;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.associationOverrides, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return "value";
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private AssociationOverrideImpl createAssociationOverride(int index) {
- return AssociationOverrideImpl.createNestedAssociationOverride(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class AssociationOverridesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AssociationOverridesAnnotationDefinition INSTANCE = new AssociationOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private AssociationOverridesAnnotationDefinition() {
- super();
- }
-
- public AssociationOverrides buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new AssociationOverridesImpl(parent, member);
- }
-
- public AssociationOverrides buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java
deleted file mode 100644
index ffd3e481fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideImpl.java
+++ /dev/null
@@ -1,163 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverride;
-
-public class AttributeOverrideImpl
- extends OverrideImpl
- implements NestableAttributeOverride
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final MemberAnnotationAdapter columnAdapter;
-
- private ColumnImpl column;
-
-
- protected AttributeOverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.columnAdapter = new MemberAnnotationAdapter(getMember(), ColumnImpl.buildAttributeOverrideAnnotationAdapter(getDeclarationAnnotationAdapter()));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- this.column.initialize(astRoot);
- }
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AttributeOverrideAnnotation oldAttributeOverride = (AttributeOverrideAnnotation) oldAnnotation;
- if (oldAttributeOverride.getColumn() != null) {
- ColumnAnnotation column = addColumn();
- ((NestableAnnotation) column).initializeFrom((NestableAnnotation) oldAttributeOverride.getColumn());
- }
- }
-
- //************ AttriubteOverride implementation ****************
-
- public ColumnAnnotation getNonNullColumn() {
- return (getColumn() != null) ? getColumn() : new NullAttributeOverrideColumn(this);
- }
-
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation addColumn() {
- ColumnImpl column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.newAnnotation();
- setColumn(column);
- return column;
- }
-
- public void removeColumn() {
- this.column.removeAnnotation();
- setColumn(null);
- }
-
- protected void setColumn(ColumnImpl newColumn) {
- ColumnImpl oldColumn = this.column;
- this.column = newColumn;
- firePropertyChanged(AttributeOverrideAnnotation.COLUMN_PROPERTY, oldColumn, newColumn);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.setColumn(null);
- }
- else {
- if (getColumn() != null) {
- getColumn().updateFromJava(astRoot);
- }
- else {
- ColumnImpl column = ColumnImpl.createAttributeOverrideColumn(this, getMember(), getDeclarationAnnotationAdapter());
- column.initialize(astRoot);
- this.setColumn(column);
- }
- }
- }
-
- // ********** static methods **********
- static AttributeOverrideImpl createAttributeOverride(JavaResourceNode parent, Member member) {
- return new AttributeOverrideImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static AttributeOverrideImpl createNestedAttributeOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new AttributeOverrideImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public static class AttributeOverrideAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AttributeOverrideAnnotationDefinition INSTANCE = new AttributeOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private AttributeOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return AttributeOverrideImpl.createAttributeOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java
deleted file mode 100644
index 795ecfe652..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesImpl.java
+++ /dev/null
@@ -1,153 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrides;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverride;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class AttributeOverridesImpl extends AbstractAnnotationResource<Member> implements AttributeOverrides
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final List<NestableAttributeOverride> attributesOverrides;
-
- protected AttributeOverridesImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.attributesOverrides = new ArrayList<NestableAttributeOverride>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableAttributeOverride> nestedAnnotations() {
- return new CloneListIterator<NestableAttributeOverride>(this.attributesOverrides);
- }
-
- public int nestedAnnotationsSize() {
- return this.attributesOverrides.size();
- }
-
- public NestableAttributeOverride addInternal(int index) {
- NestableAttributeOverride attributeOverride = createAttributeOverride(index);
- this.attributesOverrides.add(index, attributeOverride);
- return attributeOverride;
- }
-
- public NestableAttributeOverride add(int index) {
- NestableAttributeOverride attributeOverride = createAttributeOverride(index);
- add(index, attributeOverride);
- return attributeOverride;
- }
-
- private void add(int index, NestableAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void remove(NestableAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public int indexOf(NestableAttributeOverride attributeOverride) {
- return this.attributesOverrides.indexOf(attributeOverride);
- }
-
- public NestableAttributeOverride nestedAnnotationAt(int index) {
- return this.attributesOverrides.get(index);
- }
-
- public NestableAttributeOverride nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableAttributeOverride attributeOverride : this.attributesOverrides) {
- if (jdtAnnotation == attributeOverride.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return attributeOverride;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.attributesOverrides, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return "value";
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private AttributeOverrideImpl createAttributeOverride(int index) {
- return AttributeOverrideImpl.createNestedAttributeOverride(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class AttributeOverridesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final AttributeOverridesAnnotationDefinition INSTANCE = new AttributeOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private AttributeOverridesAnnotationDefinition() {
- super();
- }
-
- public AttributeOverrides buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new AttributeOverridesImpl(parent, member);
- }
-
- public AttributeOverrides buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java
deleted file mode 100644
index a52582de67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicImpl.java
+++ /dev/null
@@ -1,149 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.BooleanExpressionConverter;
-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.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.Basic;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class BasicImpl extends AbstractAnnotationResource<Attribute> implements Basic
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private final AnnotationElementAdapter<String> fetchAdapter;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private Boolean optional;
-
- private FetchType fetch;
-
- protected BasicImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = new ShortCircuitAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- this.fetchAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.optional(astRoot);
- this.fetch = this.fetch(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //*************** Basic implementation ****************
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType newFetch) {
- FetchType oldFetch = this.fetch;
- this.fetch = newFetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(newFetch));
- firePropertyChanged(FETCH_PROPERTY, oldFetch, newFetch);
- }
-
- public TextRange fetchTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(FETCH_ADAPTER, astRoot);
- }
-
- public TextRange optionalTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setOptional(this.optional(astRoot));
- this.setFetch(this.fetch(astRoot));
- }
-
- protected FetchType fetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__OPTIONAL, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__FETCH, false);
- }
-
- public static class BasicAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final BasicAnnotationDefinition INSTANCE = new BasicAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static BasicAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private BasicAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new BasicImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullBasic(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java
deleted file mode 100644
index e2ce52772d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnImpl.java
+++ /dev/null
@@ -1,233 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-public class ColumnImpl extends AbstractColumnImpl implements ColumnAnnotation, NestableAnnotation
-{
- // this adapter is only used by a Column annotation associated with a mapping annotation (e.g. Basic)
- public static final DeclarationAnnotationAdapter MAPPING_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'length' text range
- private final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
-
- // hold this so we can get the 'precision' text range
- private final DeclarationAnnotationElementAdapter<Integer> precisionDeclarationAdapter;
-
- // hold this so we can get the 'scale' text range
- private final DeclarationAnnotationElementAdapter<Integer> scaleDeclarationAdapter;
-
- private final AnnotationElementAdapter<Integer> lengthAdapter;
-
- private final AnnotationElementAdapter<Integer> precisionAdapter;
-
- private final AnnotationElementAdapter<Integer> scaleAdapter;
-
- private Integer length;
-
- private Integer precision;
-
- private Integer scale;
-
- protected ColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__LENGTH);
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- this.precisionDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__PRECISION);
- this.precisionAdapter = this.buildShortCircuitIntegerElementAdapter(this.precisionDeclarationAdapter);
- this.scaleDeclarationAdapter = this.buildIntegerElementAdapter(JPA.COLUMN__SCALE);
- this.scaleAdapter = this.buildShortCircuitIntegerElementAdapter(this.scaleDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.length = this.length(astRoot);
- this.precision = this.precision(astRoot);
- this.scale = this.scale(astRoot);
- }
-
- @Override
- protected String nameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String columnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
- @Override
- protected String tableElementName() {
- return JPA.COLUMN__TABLE;
- }
-
- @Override
- protected String uniqueElementName() {
- return JPA.COLUMN__UNIQUE;
- }
-
- @Override
- protected String nullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- @Override
- protected String insertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- @Override
- protected String updatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- //TODO move makes no sense for Column. maybe NestableAnnotation
- //needs to be split up and we could have IndexableAnnotation
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- ColumnAnnotation oldColumn = (ColumnAnnotation) oldAnnotation;
- setLength(oldColumn.getLength());
- setPrecision(oldColumn.getPrecision());
- setScale(oldColumn.getScale());
- }
-
- //************** Column implementation **************
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer newLength) {
- Integer oldLength = this.length;
- this.length = newLength;
- this.lengthAdapter.setValue(newLength);
- firePropertyChanged(LENGTH_PROPERTY, oldLength, newLength);
- }
-
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer newPrecision) {
- Integer oldPrecision = this.precision;
- this.precision = newPrecision;
- this.precisionAdapter.setValue(newPrecision);
- firePropertyChanged(PRECISION_PROPERTY, oldPrecision, newPrecision);
- }
-
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer newScale) {
- Integer oldScale = this.scale;
- this.scale = newScale;
- this.scaleAdapter.setValue(newScale);
- firePropertyChanged(SCALE_PROPERTY, oldScale, newScale);
- }
-
- public TextRange lengthTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.lengthDeclarationAdapter, astRoot);
- }
-
- public TextRange precisionTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.precisionDeclarationAdapter, astRoot);
- }
-
- public TextRange scaleTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.scaleDeclarationAdapter, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setLength(this.length(astRoot));
- this.setPrecision(this.precision(astRoot));
- this.setScale(this.scale(astRoot));
- }
-
- protected Integer length(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- protected Integer precision(CompilationUnit astRoot) {
- return this.precisionAdapter.getValue(astRoot);
- }
-
- protected Integer scale(CompilationUnit astRoot) {
- return this.scaleAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- static ColumnImpl createAttributeOverrideColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new ColumnImpl(parent, member, buildAttributeOverrideAnnotationAdapter(attributeOverrideAnnotationAdapter));
- }
-
- static DeclarationAnnotationAdapter buildAttributeOverrideAnnotationAdapter(DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(attributeOverrideAnnotationAdapter, JPA.ATTRIBUTE_OVERRIDE__COLUMN, JPA.COLUMN);
- }
-
- public static class ColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ColumnAnnotationDefinition INSTANCE = new ColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ColumnImpl(parent, member, ColumnImpl.MAPPING_DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullColumn(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java
deleted file mode 100644
index 5085ef8dcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ContainerAnnotationTools.java
+++ /dev/null
@@ -1,198 +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.internal.resource.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.ASTVisitor;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class ContainerAnnotationTools
-{
-
- public static NestableAnnotation addNestedAnnotation(int index, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- int size = containerAnnotation.nestedAnnotationsSize();
- NestableAnnotation nestedAnnotation = containerAnnotation.addInternal(size);
- nestedAnnotation.newAnnotation();
- containerAnnotation.moveInternal(index, size);
- synchAnnotationsAfterMove(index, size, containerAnnotation);
- return nestedAnnotation;
- }
-
- /**
- * synchronize the source annotations with the model nestableAnnotations,
- * starting at the end of the list to prevent overlap
- */
- public static void synchAnnotationsAfterAdd(int index, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(containerAnnotation.nestedAnnotations());
- for (int i = nestableAnnotations.size(); i-- > index;) {
- synch(nestableAnnotations.get(i), i);
- }
- }
-
- /**
- * synchronize the source annotations with the model nestableAnnotations,
- * starting at the specified index to prevent overlap
- */
- public static void synchAnnotationsAfterRemove(int index, ContainerAnnotation<? extends NestableAnnotation> pluralAnnotation) {
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(pluralAnnotation.nestedAnnotations());
- for (int i = index; i < nestableAnnotations.size(); i++) {
- synch(nestableAnnotations.get(i), i);
- }
- }
-
- private static void synch(NestableAnnotation nestableAnnotation, int index) {
- nestableAnnotation.moveAnnotation(index);
- }
-
- /**
- * synchronize the annotations with the model nestableAnnotations
- */
- public static void synchAnnotationsAfterMove(int targetIndex, int sourceIndex, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- NestableAnnotation nestableAnnotation = containerAnnotation.nestedAnnotationAt(targetIndex);
-
- synch(nestableAnnotation, containerAnnotation.nestedAnnotationsSize());
-
- List<NestableAnnotation> nestableAnnotations = CollectionTools.list(containerAnnotation.nestedAnnotations());
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- synch(nestableAnnotations.get(i), i);
- }
- }
- else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- synch(nestableAnnotations.get(i), i);
- }
- }
- synch(nestableAnnotation, targetIndex);
- }
-
-
- public static void initializeNestedAnnotations(CompilationUnit astRoot, ContainerAnnotation<?> containerAnnotation) {
- addAnnotationsFromSource(astRoot, containerAnnotation);
- }
-
- private static void addAnnotationsFromSource(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- containerAnnotation.jdtAnnotation(astRoot).accept(initialJavaMemberAnnotationAstVisitor(astRoot, containerAnnotation));
- }
-
- /**
- * Only visit the member value pair with the given element name.
- * If there is no element name (like in the case of value elements)
- * then we will visit all annotations with the annotation name inside
- * the given container annotation
- */
- private static ASTVisitor initialJavaMemberAnnotationAstVisitor(final CompilationUnit astRoot, final ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- return new ASTVisitor() {
- @Override
- public boolean visit(MemberValuePair node) {
- return node.getName().getFullyQualifiedName().equals(containerAnnotation.getElementName());
- }
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- private boolean visit(org.eclipse.jdt.core.dom.Annotation node) {
- if (containerAnnotation.getAnnotationName().equals(JDTTools.resolveAnnotation(node))) {
- return true;
- }
- if (containerAnnotation.getNestableAnnotationName().equals(JDTTools.resolveAnnotation(node))) {
- Annotation nestedAnnotation = containerAnnotation.addInternal(containerAnnotation.nestedAnnotationsSize());
- nestedAnnotation.initialize(astRoot);
- }
- return false;
- }
- };
- }
-
- public static void updateNestedAnnotationsFromJava(CompilationUnit astRoot, ContainerAnnotation<?> containerAnnotation) {
- addOrUpdateAnnotationInSource(astRoot, containerAnnotation);
- //TODO not sure how to handle generics here and get rid of this warning
- removeAnnotationsNotInSource(astRoot, (ContainerAnnotation<NestableAnnotation>) containerAnnotation);
- }
-
- private static void addOrUpdateAnnotationInSource(CompilationUnit astRoot, ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- containerAnnotation.jdtAnnotation(astRoot).accept(javaMemberAnnotationAstVisitor(astRoot, containerAnnotation));
- }
-
- private static void removeAnnotationsNotInSource(CompilationUnit astRoot, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- for (NestableAnnotation annotation : CollectionTools.iterable(containerAnnotation.nestedAnnotations())) {
- if (annotation.jdtAnnotation(astRoot) == null) {
- containerAnnotation.remove(annotation);
- }
- }
- }
-
- /**
- * Only visit the member value pair with the given element name.
- * If there is no element name (like in the case of value elements)
- * then we will visit all annotations with the annotation name inside
- * the given container annotation
- */
- private static ASTVisitor javaMemberAnnotationAstVisitor(final CompilationUnit astRoot, final ContainerAnnotation<? extends NestableAnnotation> containerAnnotation) {
- return new ASTVisitor() {
- @Override
- public boolean visit(MemberValuePair node) {
- return node.getName().getFullyQualifiedName().equals(containerAnnotation.getElementName());
- }
-
- @Override
- public boolean visit(SingleMemberAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(NormalAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- @Override
- public boolean visit(MarkerAnnotation node) {
- return visit((org.eclipse.jdt.core.dom.Annotation) node);
- }
-
- private boolean visit(org.eclipse.jdt.core.dom.Annotation node) {
- if (containerAnnotation.getAnnotationName().equals(JDTTools.resolveAnnotation(node))) {
- return true;
- }
- if (containerAnnotation.getNestableAnnotationName().equals(JDTTools.resolveAnnotation(node))) {
- NestableAnnotation nestedAnnotation = containerAnnotation.nestedAnnotationFor(node);
- if (nestedAnnotation != null) {
- nestedAnnotation.updateFromJava(astRoot);
- }
- else {
- nestedAnnotation = containerAnnotation.add(containerAnnotation.nestedAnnotationsSize());
- nestedAnnotation.initialize(astRoot);
- }
- }
- return false;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java
deleted file mode 100644
index 9faf07bacf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnImpl.java
+++ /dev/null
@@ -1,162 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-public class DiscriminatorColumnImpl extends AbstractNamedColumn implements DiscriminatorColumnAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> DISCRIMINATOR_TYPE_ADAPTER = buildDiscriminatorTypeAdapter();
-
- // hold this so we can get the 'length' text range
- private final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> discriminatorTypeAdapter;
-
- private final AnnotationElementAdapter<Integer> lengthAdapter;
-
- private DiscriminatorType discriminatorType;
-
- private Integer length;
-
- protected DiscriminatorColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- this.discriminatorTypeAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, DISCRIMINATOR_TYPE_ADAPTER);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.discriminatorType = this.discriminatorType(astRoot);
- this.length = this.length(astRoot);
- }
-
- @Override
- protected String nameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String columnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- //TODO move makes no sense for DiscriminatorColumn. maybe NestableAnnotation
- //needs to be split up and we could have IndexableAnnotation
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- DiscriminatorColumnAnnotation oldColumn = (DiscriminatorColumnAnnotation) oldAnnotation;
- setLength(oldColumn.getLength());
- setDiscriminatorType(oldColumn.getDiscriminatorType());
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return this.discriminatorType;
- }
-
- public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.discriminatorType;
- this.discriminatorType = newDiscriminatorType;
- this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(newDiscriminatorType));
- firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newDiscriminatorType);
- }
-
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer newLength) {
- Integer oldLength = this.length;
- this.length = newLength;
- this.lengthAdapter.setValue(newLength);
- firePropertyChanged(LENGTH_PROPERTY, oldLength, newLength);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setLength(this.length(astRoot));
- this.setDiscriminatorType(this.discriminatorType(astRoot));
- }
-
- protected Integer length(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- protected DiscriminatorType discriminatorType(CompilationUnit astRoot) {
- return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- }
-
- public static class DiscriminatorColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final DiscriminatorColumnAnnotationDefinition INSTANCE = new DiscriminatorColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DiscriminatorColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new DiscriminatorColumnImpl(parent, member, DiscriminatorColumnImpl.DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullDiscriminatorColumn(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java
deleted file mode 100644
index 7632eaf630..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueImpl.java
+++ /dev/null
@@ -1,112 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValue;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class DiscriminatorValueImpl extends AbstractAnnotationResource<Type> implements DiscriminatorValue
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private String value;
-
- protected DiscriminatorValueImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
-
- public static class DiscriminatorValueAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final DiscriminatorValueAnnotationDefinition INSTANCE = new DiscriminatorValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DiscriminatorValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new DiscriminatorValueImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullDiscriminatorValue(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java
deleted file mode 100644
index 730d9555b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableImpl.java
+++ /dev/null
@@ -1,76 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-
-public class EmbeddableImpl extends AbstractAnnotationResource<Type> implements EmbeddableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddableImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
-
- public static class EmbeddableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddableAnnotationDefinition INSTANCE = new EmbeddableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddableImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java
deleted file mode 100644
index 91e618ca67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddedId;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class EmbeddedIdImpl extends AbstractAnnotationResource<Attribute> implements EmbeddedId
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddedIdImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
-
- public static class EmbeddedIdAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddedIdAnnotationDefinition INSTANCE = new EmbeddedIdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddedIdAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedIdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddedIdImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java
deleted file mode 100644
index 8806a0d883..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.Embedded;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class EmbeddedImpl extends AbstractAnnotationResource<Attribute> implements Embedded
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected EmbeddedImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class EmbeddedAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EmbeddedAnnotationDefinition INSTANCE = new EmbeddedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EmbeddedAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EmbeddedImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullEmbedded(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java
deleted file mode 100644
index 1f7d5725b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityImpl.java
+++ /dev/null
@@ -1,117 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-
-public class EntityImpl extends AbstractAnnotationResource<Type> implements EntityAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
-
- private String name;
-
- protected EntityImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(getMember(), NAME_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- }
-
- //*********** Annotation implementation ****************
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- //*********** Entity implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(EntityAnnotation.NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(NAME_ADAPTER, astRoot);
- }
-
- //*********** JavaResource implementation ****************
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- //*********** static methods ****************
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ENTITY__NAME, false); // false = do not remove annotation when empty
- }
-
-
- public static class EntityAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EntityAnnotationDefinition INSTANCE = new EntityAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static EntityAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EntityAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EntityImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java
deleted file mode 100644
index 6fcc933b03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedImpl.java
+++ /dev/null
@@ -1,113 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.Enumerated;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class EnumeratedImpl extends AbstractAnnotationResource<Attribute> implements Enumerated
-{
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private EnumType value;
-
- protected EnumeratedImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType newValue) {
- EnumType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(EnumType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected EnumType value(CompilationUnit astRoot) {
- return EnumType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ENUMERATED__VALUE);
- }
-
- public static class EnumeratedAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final EnumeratedAnnotationDefinition INSTANCE = new EnumeratedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EnumeratedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new EnumeratedImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullEnumerated(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java
deleted file mode 100644
index 988080f382..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueImpl.java
+++ /dev/null
@@ -1,146 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.GenerationType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class GeneratedValueImpl extends AbstractAnnotationResource<Member> implements GeneratedValueAnnotation
-{
- private final AnnotationElementAdapter<String> strategyAdapter;
-
- private final AnnotationElementAdapter<String> generatorAdapter;
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> GENERATOR_ADAPTER = buildGeneratorAdapter();
-
- private GenerationType strategy;
-
- private String generator;
-
-
- protected GeneratedValueImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, STRATEGY_ADAPTER);
- this.generatorAdapter = new ShortCircuitAnnotationElementAdapter<String>(member, GENERATOR_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.strategy(astRoot);
- this.generator = this.generator(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType newStrategy) {
- GenerationType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.strategyAdapter.setValue(GenerationType.toJavaAnnotationValue(newStrategy));
- firePropertyChanged(STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String newGenerator) {
- String oldGenerator = this.generator;
- this.generator = newGenerator;
- this.generatorAdapter.setValue(newGenerator);
- firePropertyChanged(GENERATOR_PROPERTY, oldGenerator, newGenerator);
- }
-
- public TextRange strategyTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- public TextRange generatorTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(GENERATOR_ADAPTER, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- public void updateFromJava(CompilationUnit astRoot) {
- this.setStrategy(this.strategy(astRoot));
- this.setGenerator(this.generator(astRoot));
- }
-
- protected GenerationType strategy(CompilationUnit astRoot) {
- return GenerationType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- protected String generator(CompilationUnit astRoot) {
- return this.generatorAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__STRATEGY, false);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildGeneratorAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__GENERATOR, false);
- }
-
- public static class GeneratedValueAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final GeneratedValueAnnotationDefinition INSTANCE = new GeneratedValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private GeneratedValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new GeneratedValueImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java
deleted file mode 100644
index d6fbf5c6af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratorImpl.java
+++ /dev/null
@@ -1,154 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-public abstract class GeneratorImpl extends AbstractAnnotationResource<Member> implements GeneratorAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'initialValue' text range
- private final DeclarationAnnotationElementAdapter<Integer> initialValueDeclarationAdapter;
-
- // hold this so we can get the 'allocationSize' text range
- private final DeclarationAnnotationElementAdapter<Integer> allocationSizeDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<Integer> initialValueAdapter;
-
- private final AnnotationElementAdapter<Integer> allocationSizeAdapter;
-
- private String name;
-
- private Integer initialValue;
-
- private Integer allocationSize;
-
- public GeneratorImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.nameDeclarationAdapter = this.nameAdapter();
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.initialValueDeclarationAdapter = this.initialValueAdapter();
- this.initialValueAdapter = this.buildIntegerAdapter(this.initialValueDeclarationAdapter);
- this.allocationSizeDeclarationAdapter = this.allocationSizeAdapter();
- this.allocationSizeAdapter = this.buildIntegerAdapter(this.allocationSizeDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.initialValue = this.initialValue(astRoot);
- this.allocationSize = this.allocationSize(astRoot);
- }
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new ShortCircuitAnnotationElementAdapter<Integer>(getMember(), daea);
- }
-
- protected abstract DeclarationAnnotationAdapter annotationAdapter();
-
- protected abstract DeclarationAnnotationElementAdapter<String> nameAdapter();
-
- protected abstract DeclarationAnnotationElementAdapter<Integer> initialValueAdapter();
-
- protected abstract DeclarationAnnotationElementAdapter<Integer> allocationSizeAdapter();
-
-
-
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer newAllocationSize) {
- Integer oldAllocationSize = this.allocationSize;
- this.allocationSize = newAllocationSize;
- this.allocationSizeAdapter.setValue(newAllocationSize);
- firePropertyChanged(ALLOCATION_SIZE_PROPERTY, oldAllocationSize, newAllocationSize);
- }
-
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer newInitialValue) {
- Integer oldInitialValue = this.initialValue;
- this.initialValue = newInitialValue;
- this.initialValueAdapter.setValue(newInitialValue);
- firePropertyChanged(INITIAL_VALUE_PROPERTY, oldInitialValue, newInitialValue);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange initialValueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.initialValueDeclarationAdapter, astRoot);
- }
-
- public TextRange allocationSizeTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.allocationSizeDeclarationAdapter, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setAllocationSize(this.allocationSize(astRoot));
- this.setInitialValue(this.initialValue(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected Integer allocationSize(CompilationUnit astRoot) {
- return this.allocationSizeAdapter.getValue(astRoot);
- }
-
- protected Integer initialValue(CompilationUnit astRoot) {
- return this.initialValueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- protected static DeclarationAnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName);
- }
-
- protected static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, NumberIntegerExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java
deleted file mode 100644
index 7e0562a366..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.JDTTools;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.IdClass;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class IdClassImpl extends AbstractAnnotationResource<Type> implements IdClass
-{
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
- private String value;
-
- private String fullyQualifiedValue;
-
- public IdClassImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- this.fullyQualifiedValue = fullyQualifiedClass(astRoot);
- }
-
- public String getAnnotationName() {
- return IdClass.ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(IdClass.VALUE_PROPERTY, oldValue, newValue);
- }
-
- public String getFullyQualifiedClass() {
- return this.fullyQualifiedValue;
- }
-
- private void setFullyQualifiedClass(String newQualifiedClass) {
- String oldQualifiedClass = this.fullyQualifiedValue;
- this.fullyQualifiedValue = newQualifiedClass;
- firePropertyChanged(IdClass.FULLY_QUALIFIED_CLASS_PROPERTY, oldQualifiedClass, newQualifiedClass);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- this.setFullyQualifiedClass(this.fullyQualifiedClass(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- private String fullyQualifiedClass(CompilationUnit astRoot) {
- if (getValue() == null) {
- return null;
- }
- return JDTTools.resolveFullyQualifiedName(this.valueAdapter.expression(astRoot));
- }
-
- // ********** static methods **********
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, JPA.ID_CLASS__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-
- public static class IdClassAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final IdClassAnnotationDefinition INSTANCE = new IdClassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private IdClassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new IdClassImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java
deleted file mode 100644
index 3ee833ae4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdImpl.java
+++ /dev/null
@@ -1,77 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.Id;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class IdImpl extends AbstractAnnotationResource<Attribute> implements Id
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected IdImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class IdAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final IdAnnotationDefinition INSTANCE = new IdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static IdAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private IdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new IdImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java
deleted file mode 100644
index 5429dded87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceImpl.java
+++ /dev/null
@@ -1,112 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.Inheritance;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-public class InheritanceImpl extends AbstractAnnotationResource<Type> implements Inheritance
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
-
- private final AnnotationElementAdapter<String> strategyAdapter;
-
- private InheritanceType strategy;
-
- protected InheritanceImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new ShortCircuitAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.strategy(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType newStrategy) {
- InheritanceType oldStrategy = this.strategy;
- this.strategy = newStrategy;
- this.strategyAdapter.setValue(InheritanceType.toJavaAnnotationValue(newStrategy));
- firePropertyChanged(STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
- public TextRange strategyTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setStrategy(this.strategy(astRoot));
- }
-
- protected InheritanceType strategy(CompilationUnit astRoot) {
- return InheritanceType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.INHERITANCE__STRATEGY);
- }
-
- public static class InheritanceAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final InheritanceAnnotationDefinition INSTANCE = new InheritanceAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private InheritanceAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new InheritanceImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullInheritance(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourceModel.java
deleted file mode 100644
index 2d9d0c701f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourceModel.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.core.internal.AbstractResourceModel;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationEditFormatter;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.BitTools;
-
-public class JavaResourceModel
- extends AbstractResourceModel
-{
- private final Collection<ResourceModelListener> resourceModelListeners;
-
- private final JpaCompilationUnitResource compilationUnitResource;
-
-
- public JavaResourceModel(
- IFile file, JpaAnnotationProvider annotationProvider,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter) {
- super();
- this.resourceModelListeners = new ArrayList<ResourceModelListener>();
- this.compilationUnitResource =
- new JpaCompilationUnitResource(file, annotationProvider, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter, this);
- }
-
- public String getResourceType() {
- return JAVA_RESOURCE_TYPE;
- }
-
- @Override
- public JpaCompilationUnitResource resource() {
- return this.compilationUnitResource;
- }
-
- public void addResourceModelChangeListener(ResourceModelListener listener) {
- if (listener == null) {
- throw new IllegalArgumentException("Listener cannot be null");
- }
- if (this.resourceModelListeners.contains(listener)) {
- throw new IllegalArgumentException("Listener " + listener + " already added");
- }
- this.resourceModelListeners.add(listener);
- }
-
- public void removeResourceModelChangeListener(ResourceModelListener listener) {
- if (!this.resourceModelListeners.contains(listener)) {
- throw new IllegalArgumentException("Listener " + listener + " was never added");
- }
- this.resourceModelListeners.add(listener);
- }
-
- public void resourceChanged() {
- if (resource() == null) {
- throw new IllegalStateException("Change events should not be fired during construction");
- }
- for (ResourceModelListener listener : this.resourceModelListeners) {
- listener.resourceModelChanged();
- }
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- synchWithJavaDelta(event.getDelta());
- }
-
- private void synchWithJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- case IJavaElement.JAVA_PROJECT :
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- case IJavaElement.PACKAGE_FRAGMENT :
- this.synchChildrenWithJavaDelta(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.synchCompilationUnitWithJavaDelta(delta);
- break;
- default :
- break; // the event is somehow lower than a compilation unit
- }
- }
-
- private void synchChildrenWithJavaDelta(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.synchWithJavaDelta(child); // recurse
- }
- }
-
- private void synchCompilationUnitWithJavaDelta(IJavaElementDelta delta) {
- // ignore changes to/from primary working copy - no content has changed;
- // and make sure there are no other flags set that indicate both a change to/from
- // primary working copy AND content has changed
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return;
- }
- if (delta.getElement().equals(this.compilationUnitResource.getCompilationUnit())) {
- //TODO possibly hop on the UI thread here so that we know only 1 thread is changing our model
- this.compilationUnitResource.updateFromJava(JDTTools.buildASTRoot(this.compilationUnitResource.getCompilationUnit()));
- }
- }
-
- public void resolveTypes() {
- this.compilationUnitResource.resolveTypes(JDTTools.buildASTRoot(this.compilationUnitResource.getCompilationUnit()));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java
deleted file mode 100644
index 518ec04f0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentAttributeImpl.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jdt.core.dom.IMethodBinding;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.JPTTools;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class JavaResourcePersistentAttributeImpl
- extends AbstractJavaResourcePersistentMember<Attribute>
- implements JavaResourcePersistentAttribute
-{
-
- private boolean typeIsBasic;
-
- private String qualifiedTypeName;
-
- private boolean typeIsContainer;
-
- private String qualifiedReferenceEntityTypeName;
-
- private String qualifiedReferenceEntityElementTypeName;
-
- public JavaResourcePersistentAttributeImpl(JavaResourcePersistentType parent, Attribute attribute){
- super(parent, attribute);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.typeIsBasic = this.typeIsBasic(astRoot);
- this.qualifiedTypeName = this.qualifiedTypeName(astRoot);
- this.qualifiedReferenceEntityTypeName = this.qualifiedReferenceEntityTypeName(astRoot);
- this.qualifiedReferenceEntityElementTypeName = this.qualifiedReferenceEntityElementTypeName(astRoot);
- this.typeIsContainer = this.typeIsContainer(astRoot);
- }
-
- public String getName() {
- return getMember().attributeName();
- }
-
- // ******** AbstractJavaPersistentResource implementation ********
-
- @Override
- protected Annotation buildMappingAnnotation(String mappingAnnotationName) {
- return annotationProvider().buildAttributeMappingAnnotation(this, getMember(), mappingAnnotationName);
- }
-
- @Override
- protected Annotation buildAnnotation(String annotationName) {
- return annotationProvider().buildAttributeAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullAnnotation(String annotationName) {
- return annotationProvider().buildNullAttributeAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullMappingAnnotation(String annotationName) {
- return annotationProvider().buildNullAttributeMappingAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected ListIterator<String> possibleMappingAnnotationNames() {
- return annotationProvider().attributeMappingAnnotationNames();
- }
-
- @Override
- protected boolean isPossibleAnnotation(String annotationName) {
- return CollectionTools.contains(annotationProvider().attributeAnnotationNames(), annotationName);
- }
-
- @Override
- protected boolean isPossibleMappingAnnotation(String annotationName) {
- return CollectionTools.contains(annotationProvider().attributeMappingAnnotationNames(), annotationName);
- }
-
- @Override
- protected boolean calculatePersistability(CompilationUnit astRoot) {
- IBinding binding = getMember().binding(astRoot);
- if (binding == null) {
- return false;
- }
- if (isForField()) {
- return JPTTools.fieldIsPersistable((IVariableBinding) binding);
- }
- return JPTTools.methodIsPersistablePropertyGetter((IMethodBinding) binding);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- return super.annotations(nestableAnnotationName, containerAnnotationName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public Iterator<Annotation> mappingAnnotations() {
- return super.mappingAnnotations();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public Iterator<Annotation> annotations() {
- return super.annotations();
- }
-
- // ******** JavaPersistentAttributeResource implementation ********
-
- public boolean isForField() {
- return getMember().isField();
- }
-
- public boolean isForProperty() {
- return !isForField();
- }
-
- public boolean hasAnyAnnotation() {
- if (mappingAnnotationsSize() > 0) {
- return true;
- }
- if (annotationsSize() > 0) {
- return true;
- }
- return false;
- }
-
- public boolean typeIsBasic() {
- return this.typeIsBasic;
- }
-
- protected void setTypeIsBasic(boolean newTypeIsBasic) {
- boolean oldTypeIsBasic = this.typeIsBasic;
- this.typeIsBasic = newTypeIsBasic;
- firePropertyChanged(TYPE_IS_BASIC_PROPERTY, oldTypeIsBasic, newTypeIsBasic);
- }
-
- public String getQualifiedTypeName() {
- return this.qualifiedTypeName;
- }
-
- protected void setQualifiedTypeName(String newQualifiedTypeName) {
- String oldQualifiedTypeName = this.qualifiedTypeName;
- this.qualifiedTypeName = newQualifiedTypeName;
- firePropertyChanged(QUALIFIED_TYPE_NAME_PROPERTY, oldQualifiedTypeName, newQualifiedTypeName);
- }
-
- public String getQualifiedReferenceEntityTypeName() {
- return this.qualifiedReferenceEntityTypeName;
- }
-
- protected void setQualifiedReferenceEntityTypeName(String newQualifiedReferenceEntityTypeName) {
- String oldQualifiedReferenceEntityTypeName = this.qualifiedReferenceEntityTypeName;
- this.qualifiedReferenceEntityTypeName = newQualifiedReferenceEntityTypeName;
- firePropertyChanged(QUALIFIED_REFERENCE_ENTITY_TYPE_NAME_PROPERTY, oldQualifiedReferenceEntityTypeName, newQualifiedReferenceEntityTypeName);
- }
-
- public String getQualifiedReferenceEntityElementTypeName() {
- return this.qualifiedReferenceEntityElementTypeName;
- }
-
- protected void setQualifiedReferenceEntityElementTypeName(String newQualifiedReferenceEntityElementTypeName) {
- String oldQualifiedReferenceEntityElementTypeName = this.qualifiedReferenceEntityElementTypeName;
- this.qualifiedReferenceEntityElementTypeName = newQualifiedReferenceEntityElementTypeName;
- firePropertyChanged(QUALIFIED_REFERENCE_ENTITY_ELEMENT_TYPE_NAME_PROPERTY, oldQualifiedReferenceEntityElementTypeName, newQualifiedReferenceEntityElementTypeName);
- }
-
- public boolean typeIsContainer() {
- return this.typeIsContainer;
- }
-
- protected void setTypeIsContainer(boolean newTypeIsContainer) {
- boolean oldTypeIsContainer = this.typeIsContainer;
- this.typeIsContainer = newTypeIsContainer;
- firePropertyChanged(TYPE_IS_CONTAINER_PROPERTY, oldTypeIsContainer, newTypeIsContainer);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setTypeIsBasic(this.typeIsBasic(astRoot));
- this.setQualifiedTypeName(this.qualifiedTypeName(astRoot));
- this.setQualifiedReferenceEntityTypeName(this.qualifiedReferenceEntityTypeName(astRoot));
- this.setQualifiedReferenceEntityElementTypeName(this.qualifiedReferenceEntityElementTypeName(astRoot));
- this.setTypeIsContainer(this.typeIsContainer(astRoot));
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- this.setTypeIsBasic(this.typeIsBasic(astRoot));
- this.setQualifiedTypeName(this.qualifiedTypeName(astRoot));
- this.setQualifiedReferenceEntityTypeName(this.qualifiedReferenceEntityTypeName(astRoot));
- this.setQualifiedReferenceEntityElementTypeName(this.qualifiedReferenceEntityElementTypeName(astRoot));
- this.setTypeIsContainer(this.typeIsContainer(astRoot));
- }
-
- protected boolean typeIsBasic(CompilationUnit astRoot) {
- return typeIsBasic(getMember().typeBinding(astRoot), astRoot.getAST());
- }
-
- protected String qualifiedReferenceEntityTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = getMember().typeBinding(astRoot);
- if (typeBinding == null) {
- return null;
- }
- return buildReferenceEntityTypeName(typeBinding);
- }
-
- public static String buildReferenceEntityTypeName(ITypeBinding typeBinding) {
- if (typeBinding != null && !typeBinding.isArray()) { // arrays cannot be entities
- return typeBinding.getTypeDeclaration().getQualifiedName();
- }
- return null;
- }
-
- protected String qualifiedReferenceEntityElementTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = getMember().typeBinding(astRoot);
- if (typeBinding == null) {
- return null;
- }
-
- ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
- if (typeArguments.length != 1) {
- return null;
- }
- ITypeBinding elementTypeBinding = typeArguments[0];
- String elementTypeName = buildReferenceEntityTypeName(elementTypeBinding);
- return typeNamedIsContainer(elementTypeName) ? null : elementTypeName;
- }
-
-
- protected boolean typeIsContainer(CompilationUnit astRoot) {
- String typeName = buildReferenceEntityTypeName(getMember().typeBinding(astRoot));
- return typeName == null ? false : typeNamedIsContainer(typeName);
- }
-
- /**
- * return whether the specified non-array type is one of the container
- * types allowed by the JPA spec
- */
- public static boolean typeNamedIsContainer(String typeName) {
- return CollectionTools.contains(CONTAINER_TYPE_NAMES, typeName);
- }
-
- private static final String[] CONTAINER_TYPE_NAMES = {
- java.util.Collection.class.getName(),
- java.util.Set.class.getName(),
- java.util.List.class.getName(),
- java.util.Map.class.getName()
- };
-
- protected String qualifiedTypeName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = getMember().typeBinding(astRoot);
- if (typeBinding == null) {
- return null;
- }
- return typeBinding.getQualifiedName();
- }
-
-
- /**
- * From the JPA spec, when the basic mapping applies:
- * If the type of the attribute (field or property) is one of the following
- * it must be mapped as @Basic:
- * primitive types
- * byte[]
- * Byte[]
- * char[]
- * Character[]
- * primitive wrappers
- * java.lang.String
- * java.math.BigInteger
- * java.math.BigDecimal
- * java.util.Date
- * java.util.Calendar
- * java.sql.Date
- * java.sql.Time
- * java.sql.Timestamp
- * enums
- * any other type that implements java.io.Serializable
- */
- public static boolean typeIsBasic(ITypeBinding typeBinding, AST ast) {
- if (typeBinding == null) {
- return false; // type not found
- }
- if (typeBinding.isPrimitive()) {
- return true;
- }
- if (typeBinding.isArray()) {
- if (typeBinding.getDimensions() > 1) {
- return false; // multi-dimensional arrays are not supported
- }
- ITypeBinding elementTypeBinding = typeBinding.getElementType();
- if (elementTypeBinding == null) {
- return false;// unable to resolve the type
- }
- return elementTypeIsValid(elementTypeBinding.getQualifiedName());
- }
- String typeName = typeBinding.getQualifiedName();
- if (typeIsPrimitiveWrapper(typeName)) {
- return true;
- }
- if (typeIsOtherSupportedType(typeName)) {
- return true;
- }
- if (typeBinding.isEnum()) {
- return true;
- }
- if (typeImplementsSerializable(typeBinding, ast)) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the specified type is a valid element type for
- * a one-dimensional array:
- * byte
- * char
- * java.lang.Byte
- * java.lang.Character
- */
- private static boolean elementTypeIsValid(String elementTypeName) {
- return CollectionTools.contains(VALID_ELEMENT_TYPE_NAMES, elementTypeName);
- }
-
- private static final String[] VALID_ELEMENT_TYPE_NAMES = {
- byte.class.getName(),
- char.class.getName(),
- java.lang.Byte.class.getName(),
- java.lang.Character.class.getName()
- };
-
- /**
- * Return whether the specified type is a primitive wrapper.
- */
- private static boolean typeIsPrimitiveWrapper(String typeName) {
- return CollectionTools.contains(PRIMITIVE_WRAPPER_TYPE_NAMES, typeName);
- }
-
- private static final String[] PRIMITIVE_WRAPPER_TYPE_NAMES = {
- java.lang.Byte.class.getName(),
- java.lang.Character.class.getName(),
- java.lang.Double.class.getName(),
- java.lang.Float.class.getName(),
- java.lang.Integer.class.getName(),
- java.lang.Long.class.getName(),
- java.lang.Short.class.getName(),
- java.lang.Boolean.class.getName(),
- };
-
- /**
- * Return whether the specified type is among the various other types
- * that default to a Basic mapping.
- */
- private static boolean typeIsOtherSupportedType(String typeName) {
- return CollectionTools.contains(OTHER_SUPPORTED_TYPE_NAMES, typeName);
- }
-
- private static final String[] OTHER_SUPPORTED_TYPE_NAMES = {
- java.lang.String.class.getName(),
- java.math.BigInteger.class.getName(),
- java.math.BigDecimal.class.getName(),
- java.util.Date.class.getName(),
- java.util.Calendar.class.getName(),
- java.sql.Date.class.getName(),
- java.sql.Time.class.getName(),
- java.sql.Timestamp.class.getName(),
- };
-
- /**
- * Return whether the specified type implements java.io.Serializable.
- */
- private static boolean typeImplementsSerializable(ITypeBinding typeBinding, AST ast) {
- ITypeBinding serializableTypeBinding = ast.resolveWellKnownType(SERIALIZABLE_TYPE_NAME);
- return typeBinding.isAssignmentCompatible(serializableTypeBinding);
- }
-
- private static final String SERIALIZABLE_TYPE_NAME = java.io.Serializable.class.getName();
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java
deleted file mode 100644
index 4bb983659c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JavaResourcePersistentTypeImpl.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.ITypeBinding;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationEditFormatter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.FieldAttribute;
-import org.eclipse.jpt.core.internal.jdtutility.JPTTools;
-import org.eclipse.jpt.core.internal.jdtutility.MethodAttribute;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public class JavaResourcePersistentTypeImpl extends AbstractJavaResourcePersistentMember<Type> implements JavaResourcePersistentType
-{
- /**
- * store all member types including those that aren't persistable so we can include validation errors.
- */
- private final Collection<JavaResourcePersistentType> nestedTypes;
-
- private final Collection<JavaResourcePersistentAttribute> attributes;
-
- private AccessType accessType;
-
- private String superClassQualifiedName;
-
- private String qualifiedName;
-
- private String name;
-
- private boolean isAbstract;
-
- public JavaResourcePersistentTypeImpl(JavaResourceNode parent, Type type){
- super(parent, type);
- this.nestedTypes = new ArrayList<JavaResourcePersistentType>();
- this.attributes = new ArrayList<JavaResourcePersistentAttribute>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.qualifiedName = this.qualifiedName(astRoot);
- this.name = this.name(astRoot);
- this.initializeNestedTypes(astRoot);
- this.initializeAttributes(astRoot);
- this.accessType = this.calculateAccessType();
- this.superClassQualifiedName = this.superClassQualifiedName(astRoot);
- this.isAbstract = this.isAbstract(astRoot);
- }
-
- protected void initializeNestedTypes(CompilationUnit astRoot) {
- for (IType declaredType : getMember().declaredTypes()) {
- this.nestedTypes.add(buildJavaResourcePersistentType(declaredType, astRoot));
- }
- }
-
- protected void initializeAttributes(CompilationUnit astRoot) {
- for (IField field : getMember().fields()) {
- this.attributes.add(createJavaPersistentAttribute(field, astRoot));
- }
- for (IMethod method : getMember().methods()) {
- this.attributes.add(createJavaPersistentAttribute(method, astRoot));
- }
- }
-
- // ******** AbstractJavaPersistentResource implementation ********
-
- @Override
- protected Annotation buildMappingAnnotation(String mappingAnnotationName) {
- return annotationProvider().buildTypeMappingAnnotation(this, getMember(), mappingAnnotationName);
- }
-
- @Override
- protected Annotation buildNullMappingAnnotation(String annotationName) {
- return annotationProvider().buildNullTypeMappingAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildAnnotation(String annotationName) {
- return annotationProvider().buildTypeAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected Annotation buildNullAnnotation(String annotationName) {
- return annotationProvider().buildNullTypeAnnotation(this, getMember(), annotationName);
- }
-
- @Override
- protected ListIterator<String> possibleMappingAnnotationNames() {
- return annotationProvider().typeMappingAnnotationNames();
- }
-
- @Override
- protected boolean isPossibleAnnotation(String annotationName) {
- return CollectionTools.contains(annotationProvider().typeAnnotationNames(), annotationName);
- }
-
- @Override
- protected boolean isPossibleMappingAnnotation(String annotationName) {
- return CollectionTools.contains(annotationProvider().typeMappingAnnotationNames(), annotationName);
- }
-
- @Override
- protected boolean calculatePersistability(CompilationUnit astRoot) {
- return JPTTools.typeIsPersistable(getMember().binding(astRoot));
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public ListIterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- return super.annotations(nestableAnnotationName, containerAnnotationName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public Iterator<Annotation> mappingAnnotations() {
- return super.mappingAnnotations();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- //overriding purely to suppress the warning you get at the class level
- public Iterator<Annotation> annotations() {
- return super.annotations();
- }
-
-
- // ******** JavaPersistentTypeResource implementation ********
- public JavaResourcePersistentType javaPersistentTypeResource(String fullyQualifiedTypeName) {
- if (getQualifiedName().equals(fullyQualifiedTypeName)) {
- return this;
- }
- for (JavaResourcePersistentType jptr : CollectionTools.iterable(nestedTypes())) {
- if (jptr.getQualifiedName().equals(fullyQualifiedTypeName)) {
- return jptr;
- }
- }
- return null;
- }
-
- public Iterator<JavaResourcePersistentType> nestedTypes() {
- //TODO since we are filtering how do we handle the case where a type becomes persistable?
- //what kind of change notificiation for that case?
- return new FilteringIterator<JavaResourcePersistentType, JavaResourcePersistentType>(new CloneIterator<JavaResourcePersistentType>(this.nestedTypes)) {
- @Override
- protected boolean accept(JavaResourcePersistentType o) {
- return o.isPersistable();
- }
- };
- }
-
- protected JavaResourcePersistentType nestedTypeFor(IType type) {
- for (JavaResourcePersistentType nestedType : this.nestedTypes) {
- if (nestedType.isFor(type)) {
- return nestedType;
- }
- }
- return null;
- }
-
- protected JavaResourcePersistentType addNestedType(IType nestedType, CompilationUnit astRoot) {
- JavaResourcePersistentType persistentType = buildJavaResourcePersistentType(nestedType, astRoot);
- addNestedType(persistentType);
- return persistentType;
- }
-
- protected void addNestedType(JavaResourcePersistentType nestedType) {
- addItemToCollection(nestedType, this.nestedTypes, NESTED_TYPES_COLLECTION);
- }
-
- protected void removeNestedType(JavaResourcePersistentType nestedType) {
- removeItemFromCollection(nestedType, this.nestedTypes, NESTED_TYPES_COLLECTION);
- }
-
- protected JavaResourcePersistentType buildJavaResourcePersistentType(IType nestedType, CompilationUnit astRoot) {
- return buildJavaResourcePersistentType(this, nestedType, modifySharedDocumentCommandExecutorProvider(), annotationEditFormatter(), astRoot);
- }
-
- public static JavaResourcePersistentType buildJavaResourcePersistentType(
- JavaResourceNode parent,
- IType nestedType,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter,
- CompilationUnit astRoot) {
-
- Type type = new Type(nestedType, modifySharedDocumentCommandExecutorProvider, annotationEditFormatter);
- JavaResourcePersistentTypeImpl javaPersistentType = new JavaResourcePersistentTypeImpl(parent, type);
- javaPersistentType.initialize(astRoot);
- return javaPersistentType;
- }
-
- public Iterator<JavaResourcePersistentAttribute> attributes() {
- //TODO since we are filtering how do we handle the case where an attribute becomes persistable?
- //what kind of change notificiation for that case?
- return new FilteringIterator<JavaResourcePersistentAttribute, JavaResourcePersistentAttribute>(new CloneIterator<JavaResourcePersistentAttribute>(this.attributes)) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute o) {
- return o.isPersistable();
- }
- };
- }
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return new FilteringIterator<JavaResourcePersistentAttribute, JavaResourcePersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute o) {
- return o.isForField();
- }
- };
- }
-
- public Iterator<JavaResourcePersistentAttribute> properties() {
- return new FilteringIterator<JavaResourcePersistentAttribute, JavaResourcePersistentAttribute>(attributes()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute o) {
- return o.isForProperty();
- }
- };
- }
-
- protected JavaResourcePersistentAttribute addAttribute(IMember jdtMember, CompilationUnit astRoot) {
- JavaResourcePersistentAttribute persistentAttribute = createJavaPersistentAttribute(jdtMember, astRoot);
- addAttribute(persistentAttribute);
- return persistentAttribute;
- }
-
- protected void addAttribute(JavaResourcePersistentAttribute attribute) {
- addItemToCollection(attribute, this.attributes, ATTRIBUTES_COLLECTION);
- }
-
- protected JavaResourcePersistentAttribute createJavaPersistentAttribute(IMember member, CompilationUnit astRoot) {
- Attribute attribute = null;
- if (member instanceof IField) {
- attribute = new FieldAttribute((IField) member, this.modifySharedDocumentCommandExecutorProvider(), this.annotationEditFormatter());
- }
- else if (member instanceof IMethod) {
- attribute = new MethodAttribute((IMethod) member, this.modifySharedDocumentCommandExecutorProvider(), this.annotationEditFormatter());
- }
- else {
- throw new IllegalArgumentException();
- }
- JavaResourcePersistentAttribute javaPersistentAttribute = new JavaResourcePersistentAttributeImpl(this, attribute);
- javaPersistentAttribute.initialize(astRoot);
- return javaPersistentAttribute;
- }
-
- protected void removeAttribute(JavaResourcePersistentAttribute attribute) {
- removeItemFromCollection(attribute, this.attributes, ATTRIBUTES_COLLECTION);
- }
-
- protected JavaResourcePersistentAttribute attributeFor(IMember member) {
- for (JavaResourcePersistentAttribute persistentAttribute : this.attributes) {
- if (persistentAttribute.isFor(member)) {
- return persistentAttribute;
- }
- }
- return null;
- }
-
- public AccessType getAccess() {
- return this.accessType;
- }
-
- //seems we could have a public changeAccess() api which would
- //move all annotations from fields to their corresponding methods or vice versa
- //though of course it's more complicated than that since what if the
- //corresponding field/method does not exist?
- //making this internal since it should only be set based on changes in the source, the
- //context model should not need to set this
- protected void setAccess(AccessType newAccess) {
- AccessType oldAccess = this.accessType;
- this.accessType = newAccess;
- firePropertyChanged(ACCESS_PROPERTY, oldAccess, newAccess);
- }
-
- public String getSuperClassQualifiedName() {
- return this.superClassQualifiedName;
- }
-
- private void setSuperClassQualifiedName(String newSuperClassQualifiedName) {
- String oldSuperClassQualifiedName = this.superClassQualifiedName;
- this.superClassQualifiedName = newSuperClassQualifiedName;
- firePropertyChanged(SUPER_CLASS_QUALIFIED_NAME_PROPERTY, oldSuperClassQualifiedName, newSuperClassQualifiedName);
- }
-
- public String getQualifiedName() {
- return this.qualifiedName;
- }
-
- protected void setQualifiedName(String newQualifiedName) {
- String oldQualifiedName = this.qualifiedName;
- this.qualifiedName = newQualifiedName;
- firePropertyChanged(QUALIFIED_NAME_PROPERTY, oldQualifiedName, newQualifiedName);
- }
-
- public String getName() {
- return this.name;
- }
-
- protected void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public boolean isAbstract() {
- return this.isAbstract;
- }
-
- protected void setAbstract(boolean newAbstract) {
- boolean oldAbstract = this.isAbstract;
- this.isAbstract = newAbstract;
- firePropertyChanged(ABSTRACT_PROPERTY, oldAbstract, newAbstract);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setQualifiedName(this.qualifiedName(astRoot));
- this.setName(this.name(astRoot));
- this.updateNestedTypes(astRoot);
- this.updatePersistentAttributes(astRoot);
- this.setAccess(this.calculateAccessType());
- this.setSuperClassQualifiedName(this.superClassQualifiedName(astRoot));
- this.setAbstract(isAbstract(astRoot));
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
- this.setSuperClassQualifiedName(this.superClassQualifiedName(astRoot));
-
- for (JavaResourcePersistentAttribute attribute : this.attributes) {
- attribute.resolveTypes(astRoot);
- }
- for (JavaResourcePersistentType persistentType : this.nestedTypes) {
- persistentType.resolveTypes(astRoot);
- }
- }
-
- protected boolean isAbstract(CompilationUnit astRoot) {
- return JPTTools.typeIsAbstract(getMember().binding(astRoot));
- }
-
- protected String qualifiedName(CompilationUnit astRoot) {
- return getMember().binding(astRoot).getQualifiedName();
- }
-
- protected String name(CompilationUnit astRoot) {
- return getMember().binding(astRoot).getName();
- }
-
- protected void updateNestedTypes(CompilationUnit astRoot) {
- IType[] declaredTypes = getMember().declaredTypes();
-
- List<JavaResourcePersistentType> nestedTypesToRemove = new ArrayList<JavaResourcePersistentType>(this.nestedTypes);
- for (IType declaredType : declaredTypes) {
- JavaResourcePersistentType nestedType = nestedTypeFor(declaredType);
- if (nestedType == null) {
- nestedType = addNestedType(declaredType, astRoot);
- }
- else {
- nestedTypesToRemove.remove(nestedType);
- }
- nestedType.updateFromJava(astRoot);
- }
- for (JavaResourcePersistentType nestedType : nestedTypesToRemove) {
- removeNestedType(nestedType);
- }
- }
-
- protected void updatePersistentAttributes(CompilationUnit astRoot) {
- List<JavaResourcePersistentAttribute> persistentAttributesToRemove = new ArrayList<JavaResourcePersistentAttribute>(this.attributes);
- updatePersistentFields(astRoot, persistentAttributesToRemove);
- updatePersistentProperties(astRoot, persistentAttributesToRemove);
- for (JavaResourcePersistentAttribute persistentAttribute : persistentAttributesToRemove) {
- removeAttribute(persistentAttribute);
- }
- }
-
- protected void updatePersistentFields(CompilationUnit astRoot, List<JavaResourcePersistentAttribute> persistentAttributesToRemove) {
- updatePersistentAttributes(astRoot, persistentAttributesToRemove, getMember().fields());
- }
-
- protected void updatePersistentProperties(CompilationUnit astRoot, List<JavaResourcePersistentAttribute> persistentAttributesToRemove) {
- updatePersistentAttributes(astRoot, persistentAttributesToRemove, getMember().methods());
- }
-
- protected void updatePersistentAttributes(CompilationUnit astRoot, List<JavaResourcePersistentAttribute> persistentAttributesToRemove, IMember[] members) {
- for (IMember member : members) {
- JavaResourcePersistentAttribute persistentAttribute = attributeFor(member);
- if (persistentAttribute == null) {
- persistentAttribute = addAttribute(member, astRoot);
- }
- else {
- persistentAttributesToRemove.remove(persistentAttribute);
- }
- persistentAttribute.updateFromJava(astRoot);
- }
- }
-
- public boolean hasAnyAttributeAnnotations() {
- for (JavaResourcePersistentAttribute attribute : CollectionTools.iterable(attributes())) {
- if (attribute.hasAnyAnnotation()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the AccessType currently implied by the Java source code:
- * - if only Fields are annotated => FIELD
- * - if only Properties are annotated => PROPERTY
- * - if both Fields and Properties are annotated => FIELD
- * - if nothing is annotated
- * - and fields exist => FIELD
- * - and properties exist, but no fields exist => PROPERTY
- * - and neither fields nor properties exist => null at this level (FIELD in the context model)
- */
- private AccessType calculateAccessType() {
- boolean hasPersistableFields = false;
- boolean hasPersistableProperties = false;
- for (JavaResourcePersistentAttribute field : CollectionTools.iterable(fields())) {
- hasPersistableFields = true;
- if (field.hasAnyAnnotation()) {
- // any field is annotated => FIELD
- return AccessType.FIELD;
- }
- }
- for (JavaResourcePersistentAttribute property : CollectionTools.iterable(properties())) {
- hasPersistableProperties = true;
- if (property.hasAnyAnnotation()) {
- // none of the fields are annotated and a getter is annotated => PROPERTY
- return AccessType.PROPERTY;
- }
- }
-
- if (hasPersistableProperties && !hasPersistableFields) {
- return AccessType.PROPERTY;
- }
- //no annotations exist, access is null at the resource model level
- return null;
- }
-
- private String superClassQualifiedName(CompilationUnit astRoot) {
- ITypeBinding typeBinding = getMember().binding(astRoot);
- if (typeBinding == null) {
- return null;
- }
- ITypeBinding superClassTypeBinding = typeBinding.getSuperclass();
- if (superClassTypeBinding == null) {
- return null;
- }
- return superClassTypeBinding.getQualifiedName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java
deleted file mode 100644
index bbec816c6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnImpl.java
+++ /dev/null
@@ -1,222 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-
-public class JoinColumnImpl extends AbstractColumnImpl implements NestableJoinColumn
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'referenced column name' text range
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
-
- private String referencedColumnName;
-
- public JoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- public JoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public JoinColumnImpl(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.referencedColumnName(astRoot);
- }
-
- @Override
- protected String nameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String columnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
- @Override
- protected String tableElementName() {
- return JPA.JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String uniqueElementName() {
- return JPA.JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String nullableElementName() {
- return JPA.JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String insertableElementName() {
- return JPA.JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String updatableElementName() {
- return JPA.JOIN_COLUMN__UPDATABLE;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- JoinColumnAnnotation oldColumn = (JoinColumnAnnotation) oldAnnotation;
- setReferencedColumnName(oldColumn.getReferencedColumnName());
- }
-
- //************ JoinColumn implementation ***************
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String newReferencedColumnName) {
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = newReferencedColumnName;
- this.referencedColumnNameAdapter.setValue(newReferencedColumnName);
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, newReferencedColumnName);
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setReferencedColumnName(this.referencedColumnName(astRoot));
- }
-
- protected String referencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- static JoinColumnImpl createJoinColumn(JavaResourceNode parent, Member member) {
- return new JoinColumnImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static JoinColumnImpl createNestedJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new JoinColumnImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(joinColumnsAdapter, index, JPA.JOIN_COLUMN);
- }
- static NestableJoinColumn createJoinTableJoinColumn(JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(parent, member, buildJoinTableAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- static NestableJoinColumn createJoinTableInverseJoinColumn(JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(parent, member, buildJoinTableInverseAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableInverseAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
-
- static NestableJoinColumn createAssociationOverrideJoinColumn(DeclarationAnnotationAdapter associationOverrideAdapter, JavaResourceNode parent, Member member, int index) {
- return new JoinColumnImpl(parent, member, buildAssociationOverrideAnnotationAdapter(associationOverrideAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildAssociationOverrideAnnotationAdapter(DeclarationAnnotationAdapter associationOverrideAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(associationOverrideAdapter, JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
-
- public static class JoinColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinColumnAnnotationDefinition INSTANCE = new JoinColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return JoinColumnImpl.createJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java
deleted file mode 100644
index b6fafa068b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsImpl.java
+++ /dev/null
@@ -1,156 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumns;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class JoinColumnsImpl extends AbstractAnnotationResource<Member> implements JoinColumns
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestableJoinColumn> joinColumns;
-
- protected JoinColumnsImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn addInternal(int index) {
- JoinColumnImpl joinColumn = createJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- JoinColumnImpl joinColumn = createJoinColumn(index);
- add(index, joinColumn);
- return joinColumn;
- }
-
- protected void add(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void remove(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public NestableJoinColumn nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestableJoinColumn joinColumn : this.joinColumns) {
- if (jdtAnnotation == joinColumn.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return joinColumn;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- public String getElementName() {
- return "value";
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private JoinColumnImpl createJoinColumn(int index) {
- return JoinColumnImpl.createNestedJoinColumn(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class JoinColumnsAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinColumnsAnnotationDefinition INSTANCE = new JoinColumnsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JoinColumnsAnnotationDefinition() {
- super();
- }
-
- public JoinColumns buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new JoinColumnsImpl(parent, member);
- }
-
- public JoinColumns buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java
deleted file mode 100644
index 26e9dfb3b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableImpl.java
+++ /dev/null
@@ -1,389 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumn;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class JoinTableImpl extends AbstractTableResource implements JoinTableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JoinTableAnnotation.ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__CATALOG);
-
- private final List<NestableJoinColumn> joinColumns;
-
- private final List<NestableJoinColumn> inverseJoinColumns;
-
- private final JoinColumnsContainerAnnotation joinColumnsContainerAnnotation;
-
- private final InverseJoinColumnsContainerAnnotation inverseJoinColumnsContainerAnnotation;
-
- protected JoinTableImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- this.joinColumns = new ArrayList<NestableJoinColumn>();
- this.inverseJoinColumns = new ArrayList<NestableJoinColumn>();
- this.joinColumnsContainerAnnotation = new JoinColumnsContainerAnnotation();
- this.inverseJoinColumnsContainerAnnotation = new InverseJoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.joinColumnsContainerAnnotation);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.inverseJoinColumnsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> schemaAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> catalogAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @JoinTable is never nested
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createJoinTableUniqueConstraint(this, this.getMember(), index);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.updateJoinColumnsFromJava(astRoot);
- this.updateInverseJoinColumnsFromJava(astRoot);
- }
-
- private void updateJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.joinColumnsContainerAnnotation);
- }
-
- private void updateInverseJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.inverseJoinColumnsContainerAnnotation);
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumn joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- NestableJoinColumn joinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.joinColumnsContainerAnnotation);
- fireItemAdded(JoinTableAnnotation.JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void removeJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.joinColumns.get(index);
- removeJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.joinColumnsContainerAnnotation);
- }
-
- protected void removeJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- moveJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.joinColumnsContainerAnnotation);
- fireItemMoved(JoinTableAnnotation.JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.joinColumns, targetIndex, sourceIndex);
- }
-
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public NestableJoinColumn inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- NestableJoinColumn inverseJoinColumn = (NestableJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.inverseJoinColumnsContainerAnnotation);
- fireItemAdded(JoinTableAnnotation.INVERSE_JOIN_COLUMNS_LIST, index, inverseJoinColumn);
- return inverseJoinColumn;
- }
-
- private void addInverseJoinColumn(int index, NestableJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void removeInverseJoinColumn(int index) {
- NestableJoinColumn joinColumn = this.inverseJoinColumns.get(index);
- this.removeInverseJoinColumn(joinColumn);
- joinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.inverseJoinColumnsContainerAnnotation);
- }
-
- protected void removeInverseJoinColumn(NestableJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- moveInverseJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.inverseJoinColumnsContainerAnnotation);
- fireItemMoved(JoinTableAnnotation.INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveInverseJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.inverseJoinColumns, targetIndex, sourceIndex);
- }
-
- protected NestableJoinColumn createJoinColumn(int index) {
- return JoinColumnImpl.createJoinTableJoinColumn(this, getMember(), index);
- }
-
- protected NestableJoinColumn createInverseJoinColumn(int index) {
- return JoinColumnImpl.createJoinTableInverseJoinColumn(this, getMember(), index);
- }
-
- private class JoinColumnsContainerAnnotation extends AbstractContainerAnnotation {
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createJoinColumn(index);
- JoinTableImpl.this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createJoinColumn(index);
- JoinTableImpl.this.addJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return JoinTableImpl.this.indexOfJoinColumn(joinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return JoinTableImpl.this.joinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(JoinTableImpl.this.joinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return joinColumnsSize();
- }
-
- public void remove(NestableJoinColumn nestedAnnotation) {
- JoinTableImpl.this.removeJoinColumn(nestedAnnotation);
- }
- public String getElementName() {
- return "joinColumns";
- }
- }
-
- private class InverseJoinColumnsContainerAnnotation extends AbstractContainerAnnotation {
-
- public NestableJoinColumn addInternal(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createInverseJoinColumn(index);
- JoinTableImpl.this.inverseJoinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- public NestableJoinColumn add(int index) {
- NestableJoinColumn joinColumn = JoinTableImpl.this.createInverseJoinColumn(index);
- JoinTableImpl.this.addInverseJoinColumn(index, joinColumn);
- return joinColumn;
- }
-
- public int indexOf(NestableJoinColumn joinColumn) {
- return JoinTableImpl.this.indexOfInverseJoinColumn(joinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveInverseJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- JoinTableImpl.this.moveInverseJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumn nestedAnnotationAt(int index) {
- return JoinTableImpl.this.inverseJoinColumnAt(index);
- }
-
- public ListIterator<NestableJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestableJoinColumn>(JoinTableImpl.this.inverseJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return inverseJoinColumnsSize();
- }
-
- public void remove(NestableJoinColumn nestedAnnotation) {
- JoinTableImpl.this.removeInverseJoinColumn(nestedAnnotation);
- }
-
- public String getElementName() {
- return "inverseJoinColumns";
- }
- }
-
- private abstract class AbstractContainerAnnotation extends AbstractResource implements ContainerAnnotation<NestableJoinColumn> {
-
- public AbstractContainerAnnotation() {
- super(JoinTableImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return JoinTableImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.JOIN_COLUMN;
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public NestableJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableJoinColumn joinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == joinColumn.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return joinColumn;
- }
- }
- return null;
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return JoinTableImpl.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- JoinTableImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- JoinTableImpl.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- JoinTableImpl.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return JoinTableImpl.this.textRange(astRoot);
- }
- }
- public static class JoinTableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final JoinTableAnnotationDefinition INSTANCE = new JoinTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JoinTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new JoinTableImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullJoinTable(parent);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitResource.java
deleted file mode 100644
index 5a99990a56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitResource.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationEditFormatter;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.node.Node;
-
-public class JpaCompilationUnitResource extends AbstractResource implements JavaResourceNode
-{
- protected final JpaAnnotationProvider annotationProvider;
-
- protected final CommandExecutorProvider modifySharedDocumentCommandExecutorProvider;
-
- protected final AnnotationEditFormatter annotationEditFormatter;
-
- protected final ICompilationUnit compilationUnit;
-
- /**
- * The primary type of the CompilationUnit. Not going to handle
- * multiple Types defined in a compilation unit. Entities must have
- * a public/protected no-arg constructor and there is no way to access
- * it in a non-public/protected class.
- */
- protected JavaResourcePersistentType persistentType;
- public static final String PERSISTENT_TYPE_PROPERTY = "persistentTypeProperty";
-
- protected final JavaResourceModel javaResourceModel;
-
- public JpaCompilationUnitResource(
- IFile file,
- JpaAnnotationProvider annotationProvider,
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider,
- AnnotationEditFormatter annotationEditFormatter,
- JavaResourceModel javaResourceModel) {
- // The jpa compilation unit is the root of its sub-tree
- super(null);
- this.annotationProvider = annotationProvider;
- this.modifySharedDocumentCommandExecutorProvider = modifySharedDocumentCommandExecutorProvider;
- this.annotationEditFormatter = annotationEditFormatter;
- this.javaResourceModel = javaResourceModel;
- this.compilationUnit = compilationUnitFrom(file);
- this.initialize(JDTTools.buildASTRoot(this.compilationUnit));
- }
-
- protected ICompilationUnit compilationUnitFrom(IFile file) {
- ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom(file);
- try {
- compilationUnit.open(null);
- }
- catch (JavaModelException jme) {
- // do nothing - we just won't have a primary type in this case
- }
- return compilationUnit;
- }
-
- public void initialize(CompilationUnit astRoot) {
- IType iType = this.compilationUnit.findPrimaryType();
- if (iType != null) {
- this.persistentType = buildJavaResourcePersistentType(iType, astRoot);
- }
- }
-
- // **************** overrides **********************************************
-
-
- @Override
- public Validator validator() {
- return Node.NULL_VALIDATOR;
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- if (parentNode != null) {
- throw new IllegalArgumentException("The parent node must be null");
- }
- }
-
- @Override
- public JpaAnnotationProvider annotationProvider() {
- return this.annotationProvider;
- }
-
- @Override
- public CommandExecutorProvider modifySharedDocumentCommandExecutorProvider() {
- return this.modifySharedDocumentCommandExecutorProvider;
- }
-
- @Override
- public AnnotationEditFormatter annotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- @Override
- public JavaResourceModel resourceModel() {
- return javaResourceModel;
- }
-
-
- // *************************************************************************
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public JavaResourcePersistentType javaPersistentTypeResource(String fullyQualifiedTypeName) {
- if (getPersistentType() != null) {
- return getPersistentType().javaPersistentTypeResource(fullyQualifiedTypeName);
- }
- return null;
- }
-
- /**
- * The persistentType resource for the compilation unit's primary type.
- * Will be null if the primary type is null.
- */
- public JavaResourcePersistentType getPersistentType() {
- return this.persistentType;
- //TODO should i only be returning this if it returns true to isPersistable?
- //that's how we handle nestedTypes on JavaPersistentTypeResource
-
-// if (this.persistentType.isPersistable()) {
-// return this.persistentType;
-// }
-// return null;
- }
-
- protected void setPersistentType(JavaResourcePersistentType newPersistentType) {
- JavaResourcePersistentType oldPersistentType = this.persistentType;
- this.persistentType = newPersistentType;
- firePropertyChanged(PERSISTENT_TYPE_PROPERTY, oldPersistentType, newPersistentType);
- }
-
- private JavaResourcePersistentType buildJavaResourcePersistentType(IType iType, CompilationUnit astRoot) {
- //TODO put this hook in to avoid the NPE that we get trying to initialize a persistentTypeResource
- //from an annotation type. Entered bug # to handle the bigger issue of when we need to
- //not build a persistent type(annotation types) and when we need to have validation instead(final types)
- try {
- if (iType.isAnnotation() || iType.isEnum()) {
- return null;
- }
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
-
- return
- JavaResourcePersistentTypeImpl.buildJavaResourcePersistentType(this,
- iType,
- modifySharedDocumentCommandExecutorProvider(),
- annotationEditFormatter(),
- astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- IType iType = this.compilationUnit.findPrimaryType();
- if (iType == null) {
- setPersistentType(null);
- }
- else {
- if (getPersistentType() == null) {
- setPersistentType(buildJavaResourcePersistentType(iType, astRoot));
- }
- else {
- getPersistentType().updateFromJava(astRoot);
- }
- }
- }
-
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;//this.selectionTextRange();
- }
-
-// /**
-// * Return null for selection textRange. Entire java file will appear selected when
-// * switching files otherwise
-// */
-// public ITextRange selectionTextRange() {
-// return null;
-// }
-
- public void resourceChanged() {
- this.javaResourceModel.resourceChanged();
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- if (getPersistentType() != null) {
- getPersistentType().resolveTypes(astRoot);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java
deleted file mode 100644
index 59b07cb0ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.Lob;
-
-public class LobImpl extends AbstractAnnotationResource<Attribute> implements Lob
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected LobImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //nothing to update
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public static class LobAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final LobAnnotationDefinition INSTANCE = new LobAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private LobAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new LobImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java
deleted file mode 100644
index 3f2ad484bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyImpl.java
+++ /dev/null
@@ -1,162 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.ManyToMany;
-
-
-public class ManyToManyImpl extends AbstractRelationshipMappingAnnotation implements ManyToMany
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
- private String mappedBy;
-
- protected ManyToManyImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> targetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> fetchAdapter() {
- return FETCH_ADAPTER;
- }
-
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setMappedBy(this.mappedBy(astRoot));
- }
-
- protected String mappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return elementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH);
- }
-
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
-
- public static class ManyToManyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ManyToManyAnnotationDefinition INSTANCE = new ManyToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ManyToManyAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ManyToManyImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java
deleted file mode 100644
index 06aa6b1a50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneImpl.java
+++ /dev/null
@@ -1,161 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.BooleanExpressionConverter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.ManyToOne;
-
-
-public class ManyToOneImpl extends AbstractRelationshipMappingAnnotation implements ManyToOne
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private Boolean optional;
-
- protected ManyToOneImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.optional = this.optional(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> targetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> fetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public TextRange optionalTextRange(CompilationUnit astRoot) {
- return elementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setOptional(this.optional(astRoot));
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
-
- public static class ManyToOneAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final ManyToOneAnnotationDefinition INSTANCE = new ManyToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static ManyToOneAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new ManyToOneImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java
deleted file mode 100644
index cb258b6e68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyImpl.java
+++ /dev/null
@@ -1,117 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.MapKey;
-
-public class MapKeyImpl extends AbstractAnnotationResource<Attribute> implements MapKey
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
-
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private String name;
-
- protected MapKeyImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, NAME_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = name(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MAP_KEY__NAME, false);
- }
-
-
- public static class MapKeyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final MapKeyAnnotationDefinition INSTANCE = new MapKeyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private MapKeyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new MapKeyImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java
deleted file mode 100644
index 94a2943663..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-
-
-public class MappedSuperclassImpl extends AbstractAnnotationResource<Type> implements MappedSuperclassAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected MappedSuperclassImpl(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class MappedSuperclassAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final MappedSuperclassAnnotationDefinition INSTANCE = new MappedSuperclassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static MappedSuperclassAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private MappedSuperclassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new MappedSuperclassImpl((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java
deleted file mode 100644
index f2266c089b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesImpl.java
+++ /dev/null
@@ -1,156 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueries;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQuery;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class NamedNativeQueriesImpl extends AbstractAnnotationResource<Type> implements NamedNativeQueries
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestableNamedNativeQuery> namedNativeQueries;
-
- protected NamedNativeQueriesImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.namedNativeQueries = new ArrayList<NestableNamedNativeQuery>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueries.ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return "value";
- }
-
- public ListIterator<NestableNamedNativeQuery> nestedAnnotations() {
- return new CloneListIterator<NestableNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int nestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- public NestableNamedNativeQuery addInternal(int index) {
- NestableNamedNativeQuery namedNativeQuery = createNamedNativeQuery(index);
- this.namedNativeQueries.add(index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- public NestableNamedNativeQuery add(int index) {
- NestableNamedNativeQuery namedNativeQuery = createNamedNativeQuery(index);
- add(index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void add(int index, NestableNamedNativeQuery query) {
- addItemToList(index, query, this.namedNativeQueries, NamedNativeQueries.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void remove(NestableNamedNativeQuery query) {
- removeItemFromList(query, this.namedNativeQueries, NamedNativeQueries.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.namedNativeQueries, NamedNativeQueries.NAMED_NATIVE_QUERIES_LIST);
- }
-
- public int indexOf(NestableNamedNativeQuery query) {
- return this.namedNativeQueries.indexOf(query);
- }
-
- public NestableNamedNativeQuery nestedAnnotationAt(int index) {
- return this.namedNativeQueries.get(index);
- }
-
- public NestableNamedNativeQuery nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableNamedNativeQuery namedQuery : this.namedNativeQueries) {
- if (jdtAnnotation == namedQuery.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return namedQuery;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private NamedNativeQueryImpl createNamedNativeQuery(int index) {
- return NamedNativeQueryImpl.createNestedNamedNativeQuery(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class NamedNativeQueriesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedNativeQueriesAnnotationDefinition INSTANCE = new NamedNativeQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NamedNativeQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NamedNativeQueriesImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java
deleted file mode 100644
index 51c17b8d3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryImpl.java
+++ /dev/null
@@ -1,227 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQuery;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-
-public class NamedNativeQueryImpl extends AbstractNamedQuery
- implements NestableNamedNativeQuery
-{
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'resultClass' text range
- private final DeclarationAnnotationElementAdapter<String> resultClassDeclarationAdapter;
-
- // hold this so we can get the 'resultSetMapping' text range
- private final DeclarationAnnotationElementAdapter<String> resultSetMappingDeclarationAdapter;
-
-
- private final AnnotationElementAdapter<String> resultClassAdapter;
-
- private final AnnotationElementAdapter<String> resultSetMappingAdapter;
-
- private String resultClass;
-
- private String fullyQualifiedResultClass;
-
- private String resultSetMapping;
-
- protected NamedNativeQueryImpl(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.resultClassDeclarationAdapter = resultClassAdapter(daa);
- this.resultClassAdapter = this.buildAdapter(this.resultClassDeclarationAdapter);
- this.resultSetMappingDeclarationAdapter = resultSetMappingAdapter(daa);
- this.resultSetMappingAdapter = this.buildAdapter(this.resultSetMappingDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.resultClass = this.resultClass(astRoot);
- this.fullyQualifiedResultClass = this.fullyQualifiedResultClass(astRoot);
- this.resultSetMapping = this.resultSetMapping(astRoot);
- }
-
-
- // ********** initialization **********
- protected DeclarationAnnotationElementAdapter<String> resultClassAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(daa, JPA.NAMED_NATIVE_QUERY__RESULT_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- protected DeclarationAnnotationElementAdapter<String> resultSetMappingAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************* AbstractNamedQuery implementation *************
-
- @Override
- protected String nameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- protected String queryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- NamedNativeQueryAnnotation oldNamedQuery = (NamedNativeQueryAnnotation) oldAnnotation;
- setResultClass(oldNamedQuery.getResultClass());
- setResultSetMapping(oldNamedQuery.getResultSetMapping());
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- this.resultClassAdapter.setValue(newResultClass);
- firePropertyChanged(RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getFullyQualifiedResultClass() {
- return this.fullyQualifiedResultClass;
- }
-
- protected void setFullyQualifiedResultClass(String newQualifiedResultClass) {
- String oldFullyQualifiedResultClass = this.fullyQualifiedResultClass;
- this.fullyQualifiedResultClass = newQualifiedResultClass;
- firePropertyChanged(FULLY_QUALIFIED_RESULT_CLASS_PROPERTY, oldFullyQualifiedResultClass, newQualifiedResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- this.resultSetMappingAdapter.setValue(newResultSetMapping);
- firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
- public TextRange resultClassTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.resultClassDeclarationAdapter, astRoot);
- }
-
- public TextRange resultSetMappingTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.resultSetMappingDeclarationAdapter, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setResultClass(this.resultClass(astRoot));
- this.setFullyQualifiedResultClass(this.fullyQualifiedResultClass(astRoot));
- this.setResultSetMapping(this.resultSetMapping(astRoot));
- }
-
- protected String resultClass(CompilationUnit astRoot) {
- return this.resultClassAdapter.getValue(astRoot);
- }
-
- protected String resultSetMapping(CompilationUnit astRoot) {
- return this.resultSetMappingAdapter.getValue(astRoot);
- }
-
- protected String fullyQualifiedResultClass(CompilationUnit astRoot) {
- if (getResultClass() == null) {
- return null;
- }
- return JDTTools.resolveFullyQualifiedName(this.resultClassAdapter.expression(astRoot));
- }
-
- @Override
- protected NestableQueryHint createQueryHint(int index) {
- return QueryHintImpl.createNamedNativeQueryQueryHint(this, this.getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ********** static methods **********
- static NamedNativeQueryImpl createNamedNativeQuery(JavaResourceNode parent, Type type) {
- return new NamedNativeQueryImpl(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static NamedNativeQueryImpl createNestedNamedNativeQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
- return new NamedNativeQueryImpl(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_NATIVE_QUERY);
- }
-
- public static class NamedNativeQueryAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedNativeQueryAnnotationDefinition INSTANCE = new NamedNativeQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NamedNativeQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return NamedNativeQueryImpl.createNamedNativeQuery(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java
deleted file mode 100644
index 52b43d7c7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesImpl.java
+++ /dev/null
@@ -1,155 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueries;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedQuery;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class NamedQueriesImpl extends AbstractAnnotationResource<Type> implements NamedQueries
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(NamedQueries.ANNOTATION_NAME);
-
- private List<NestableNamedQuery> namedQueries;
-
- protected NamedQueriesImpl(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.namedQueries = new ArrayList<NestableNamedQuery>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return NamedQueries.ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return "value";
- }
-
- public ListIterator<NestableNamedQuery> nestedAnnotations() {
- return new CloneListIterator<NestableNamedQuery>(this.namedQueries);
- }
-
- public int nestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- public NestableNamedQuery addInternal(int index) {
- NestableNamedQuery namedQuery = createNamedQuery(index);
- this.namedQueries.add(index, namedQuery);
- return namedQuery;
- }
-
- public NestableNamedQuery add(int index) {
- NestableNamedQuery namedQuery = createNamedQuery(index);
- add(index, namedQuery);
- return namedQuery;
- }
-
- protected void add(int index, NestableNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, NamedQueries.NAMED_QUERIES_LIST);
- }
-
- public void remove(NestableNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, NamedQueries.NAMED_QUERIES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.namedQueries, NamedQueries.NAMED_QUERIES_LIST);
- }
-
- public int indexOf(NestableNamedQuery attributeOverride) {
- return this.namedQueries.indexOf(attributeOverride);
- }
-
- public NestableNamedQuery nestedAnnotationAt(int index) {
- return this.namedQueries.get(index);
- }
-
- public NestableNamedQuery nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableNamedQuery namedQuery : this.namedQueries) {
- if (jdtAnnotation == namedQuery.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return namedQuery;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.namedQueries, NamedQueries.NAMED_QUERIES_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private NamedQueryImpl createNamedQuery(int index) {
- return NamedQueryImpl.createNestedNamedQuery(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class NamedQueriesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedQueriesAnnotationDefinition INSTANCE = new NamedQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NamedQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NamedQueriesImpl(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java
deleted file mode 100644
index 7e1130b86f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryImpl.java
+++ /dev/null
@@ -1,107 +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.internal.resource.java;
-
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableNamedQuery;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-
-public class NamedQueryImpl extends AbstractNamedQuery
- implements NestableNamedQuery
-{
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected NamedQueryImpl(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************* AbstractNamedQuery implementation *************
- @Override
- protected String nameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- protected String queryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- protected NestableQueryHint createQueryHint(int index) {
- return QueryHintImpl.createNamedQueryQueryHint(this, getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ********** static methods **********
- static NamedQueryImpl createNamedQuery(JavaResourceNode parent, Type type) {
- return new NamedQueryImpl(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static NamedQueryImpl createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
- return new NamedQueryImpl(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_QUERY);
- }
-
- public static class NamedQueryAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final NamedQueryAnnotationDefinition INSTANCE = new NamedQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NamedQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return NamedQueryImpl.createNamedQuery(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractColumn.java
deleted file mode 100644
index 6aca12636b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractColumn.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.AbstractColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-
-public abstract class NullAbstractColumn extends NullNamedColumn implements AbstractColumnAnnotation, Annotation
-{
- protected NullAbstractColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- @Override
- protected abstract AbstractColumnAnnotation createColumnResource();
-
- public String getTable() {
- return null;
- }
-
- public void setTable(String table) {
- if (table != null) {
- createColumnResource().setTable(table);
- }
- }
-
- public Boolean getUnique() {
- return null;
- }
-
- public void setUnique(Boolean unique) {
- if (unique != null) {
- createColumnResource().setUnique(unique);
- }
- }
-
- public Boolean getUpdatable() {
- return null;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (updatable != null) {
- createColumnResource().setUpdatable(updatable);
- }
- }
-
- public Boolean getInsertable() {
- return null;
- }
-
- public void setInsertable(Boolean insertable) {
- if (insertable != null) {
- createColumnResource().setInsertable(insertable);
- }
- }
-
- public Boolean getNullable() {
- return null;
- }
-
- public void setNullable(Boolean nullable) {
- if (nullable != null) {
- createColumnResource().setNullable(nullable);
- }
- }
-
- public TextRange tableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange uniqueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange updatableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange insertableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange nullableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractTable.java
deleted file mode 100644
index dd58083a43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAbstractTable.java
+++ /dev/null
@@ -1,141 +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.internal.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraint;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public abstract class NullAbstractTable extends AbstractResource implements TableAnnotation, Annotation
-{
- protected NullAbstractTable(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected TableAnnotation createTableResource() {
- return (TableAnnotation) parent().addAnnotation(getAnnotationName());
- }
-
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- createTableResource().setName(name);
- }
- }
-
- public String getCatalog() {
- return null;
- }
-
- public void setCatalog(String catalog) {
- if (catalog != null) {
- createTableResource().setCatalog(catalog);
- }
- }
-
- public String getSchema() {
- return null;
- }
-
- public void setSchema(String schema) {
- if (schema != null) {
- createTableResource().setSchema(schema);
- }
- }
-
- public UniqueConstraint addUniqueConstraint(int index) {
- return createTableResource().addUniqueConstraint(index);
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfUniqueConstraint(UniqueConstraint uniqueConstraint) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
- public UniqueConstraint uniqueConstraintAt(int index) {
- throw new UnsupportedOperationException();
- }
-
- public ListIterator<UniqueConstraint> uniqueConstraints() {
- return EmptyListIterator.instance();
- }
-
- public int uniqueConstraintsSize() {
- return 0;
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange catalogTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange schemaTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java
deleted file mode 100644
index fd5a4f4d9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAssociationOverride.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-
-public class NullAssociationOverride extends AbstractResource implements AssociationOverrideAnnotation, Annotation
-{
- private String name;
-
- public NullAssociationOverride(JavaResourceNode parent, String name) {
- super(parent);
- this.name = name;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (name != null) {
- createAssociationOverrideResource().setName(name);
- }
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- protected AssociationOverrideAnnotation createAssociationOverrideResource() {
- return (AssociationOverrideAnnotation) parent().addAnnotation(getAnnotationName());
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverride.java
deleted file mode 100644
index 736ad2b2a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverride.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullAttributeOverride extends AbstractResource implements AttributeOverrideAnnotation, Annotation
-{
- //TODO should I hold on to the IColumnMapping that this attribute override is built from?
- //this would make it more similar to the Virtual mappings concept in xml
-
-
- private final NullAttributeOverrideColumn column;
-
- private String name;
-
- public NullAttributeOverride(JavaResourceNode parent, String name) {
- super(parent);
- this.name = name;
- this.column = new NullAttributeOverrideColumn(this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (name != null) {
- createAttributeOverrideResource().setName(name);
- }
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return getColumn();
- }
-
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- protected AttributeOverrideAnnotation createAttributeOverrideResource() {
- return (AttributeOverrideAnnotation) parent().addAnnotation(getAnnotationName());
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java
deleted file mode 100644
index fda89806cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumn.java
+++ /dev/null
@@ -1,80 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-
-public class NullAttributeOverrideColumn extends NullAbstractColumn implements ColumnAnnotation, Annotation
-{
- public NullAttributeOverrideColumn(AttributeOverrideAnnotation parent) {
- super(parent);
- }
-
- @Override
- public AttributeOverrideAnnotation parent() {
- return (AttributeOverrideAnnotation) super.parent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createColumnResource() {
- return parent().addColumn();
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createColumnResource().setLength(length);
- }
- }
-
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createColumnResource().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createColumnResource().setPrecision(precision);
- }
- }
-
- public TextRange scaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange lengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange precisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.java
deleted file mode 100644
index ab22d3c691..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasic.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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.Basic;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullBasic extends AbstractResource implements Basic, Annotation
-{
- protected NullBasic(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return Basic.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- protected Basic createBasicResource() {
- parent().setMappingAnnotation(getAnnotationName());
- return (Basic) parent().mappingAnnotation();
- }
-
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- createBasicResource().setFetch(fetch);
- }
- }
-
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- createBasicResource().setOptional(optional);
- }
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange fetchTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange optionalTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java
deleted file mode 100644
index 420df097b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumn.java
+++ /dev/null
@@ -1,80 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullColumn extends NullAbstractColumn implements ColumnAnnotation, Annotation
-{
- public NullColumn(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation createColumnResource() {
- return (ColumnAnnotation) parent().addAnnotation(getAnnotationName());
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createColumnResource().setLength(length);
- }
- }
-
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- createColumnResource().setScale(scale);
- }
- }
-
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- createColumnResource().setPrecision(precision);
- }
- }
-
- public TextRange scaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange lengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange precisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java
deleted file mode 100644
index 6bfa0ab74f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumn.java
+++ /dev/null
@@ -1,58 +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.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-
-public class NullDiscriminatorColumn extends NullNamedColumn implements DiscriminatorColumnAnnotation, Annotation
-{
- public NullDiscriminatorColumn(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public String getAnnotationName() {
- return DiscriminatorColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected DiscriminatorColumnAnnotation createColumnResource() {
- return (DiscriminatorColumnAnnotation) parent().addAnnotation(getAnnotationName());
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (discriminatorType != null) {
- createColumnResource().setDiscriminatorType(discriminatorType);
- }
- }
-
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- createColumnResource().setLength(length);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java
deleted file mode 100644
index 394461f841..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValue.java
+++ /dev/null
@@ -1,77 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValue;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullDiscriminatorValue extends AbstractResource implements DiscriminatorValue, Annotation
-{
- protected NullDiscriminatorValue(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return DiscriminatorValue.ANNOTATION_NAME;
- }
-
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- createDiscriminatorValueResource().setValue(value);
- }
- }
-
- protected DiscriminatorValue createDiscriminatorValueResource() {
- return (DiscriminatorValue) parent().addAnnotation(getAnnotationName());
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java
deleted file mode 100644
index 1aa8255055..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbedded.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.Embedded;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullEmbedded extends AbstractResource implements Embedded, Annotation
-{
- protected NullEmbedded(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return Embedded.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java
deleted file mode 100644
index 69c511f83c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumerated.java
+++ /dev/null
@@ -1,77 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.Enumerated;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullEnumerated extends AbstractResource implements Enumerated, Annotation
-{
- protected NullEnumerated(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return Enumerated.ANNOTATION_NAME;
- }
-
- protected Enumerated createEnumeratedResource() {
- return (Enumerated) parent().addAnnotation(getAnnotationName());
- }
-
-
- public EnumType getValue() {
- return null;
- }
-
- public void setValue(EnumType value) {
- if (value != null) {
- createEnumeratedResource().setValue(value);
- }
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java
deleted file mode 100644
index 86a27db0a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritance.java
+++ /dev/null
@@ -1,79 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.Inheritance;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-
-public class NullInheritance extends AbstractResource implements Inheritance, Annotation
-{
- protected NullInheritance(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return Inheritance.ANNOTATION_NAME;
- }
-
- public InheritanceType getStrategy() {
- return null;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (strategy != null) {
- createInheritanceResource().setStrategy(strategy);
- }
-
- }
-
- protected Inheritance createInheritanceResource() {
- return (Inheritance) parent().addAnnotation(getAnnotationName());
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
-
- }
-
- public TextRange strategyTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java
deleted file mode 100644
index e3b713cc68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumn.java
+++ /dev/null
@@ -1,50 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-
-
-
-public class NullJoinColumn extends NullAbstractColumn implements JoinColumnAnnotation, Annotation
-{
- public NullJoinColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected JoinColumnAnnotation createColumnResource() {
- throw new UnsupportedOperationException();
- }
-
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java
deleted file mode 100644
index a70b34fa70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTable.java
+++ /dev/null
@@ -1,84 +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.internal.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-
-public class NullJoinTable extends NullAbstractTable implements JoinTableAnnotation
-{
- protected NullJoinTable(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return null;
- }
-
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int inverseJoinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java
deleted file mode 100644
index 4736a22b6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumn.java
+++ /dev/null
@@ -1,82 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-
-
-public abstract class NullNamedColumn extends AbstractResource implements NamedColumnAnnotation, Annotation
-{
- protected NullNamedColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- protected abstract NamedColumnAnnotation createColumnResource();
-
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- createColumnResource().setName(name);
- }
- }
-
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (columnDefinition != null) {
- createColumnResource().setColumnDefinition(columnDefinition);
- }
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange columnDefinitionTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java
deleted file mode 100644
index b2b1d0da3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,50 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-
-
-public class NullPrimaryKeyJoinColumn extends NullNamedColumn implements PrimaryKeyJoinColumnAnnotation, Annotation
-{
- public NullPrimaryKeyJoinColumn(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected PrimaryKeyJoinColumnAnnotation createColumnResource() {
- throw new UnsupportedOperationException();
- }
-
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.java
deleted file mode 100644
index a0832f080b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTable.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.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-
-public class NullTable extends NullAbstractTable implements TableAnnotation
-{
- protected NullTable(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java
deleted file mode 100644
index 4c67947c17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporal.java
+++ /dev/null
@@ -1,77 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.Temporal;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-
-
-public class NullTemporal extends AbstractResource implements Temporal, Annotation
-{
- protected NullTemporal(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //null, nothing to initialize
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return null;
- }
-
- public void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public String getAnnotationName() {
- return Temporal.ANNOTATION_NAME;
- }
-
- @Override
- public JavaResourcePersistentMember parent() {
- return (JavaResourcePersistentMember) super.parent();
- }
-
- protected Temporal createTemporalResource() {
- return (Temporal) parent().addAnnotation(getAnnotationName());
- }
-
-
- public TemporalType getValue() {
- return null;
- }
-
- public void setValue(TemporalType value) {
- if (value != null) {
- createTemporalResource().setValue(value);
- }
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java
deleted file mode 100644
index d5a6d6059f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyImpl.java
+++ /dev/null
@@ -1,158 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToMany;
-
-public class OneToManyImpl extends AbstractRelationshipMappingAnnotation implements OneToMany
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
- private String mappedBy;
-
- protected OneToManyImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> targetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> fetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return elementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setMappedBy(this.mappedBy(astRoot));
- }
-
- protected String mappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- public static class OneToManyAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final OneToManyAnnotationDefinition INSTANCE = new OneToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static OneToManyAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new OneToManyImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java
deleted file mode 100644
index 6064819b1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneImpl.java
+++ /dev/null
@@ -1,199 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.BooleanExpressionConverter;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToOne;
-
-public class OneToOneImpl extends AbstractRelationshipMappingAnnotation implements OneToOne
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
-
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
-
- private final AnnotationElementAdapter<String> mappedByAdapter;
-
-
- private Boolean optional;
-
- private String mappedBy;
-
- public OneToOneImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.mappedBy(astRoot);
- this.optional = this.optional(astRoot);
- }
-
- //**************** AbstractRelationshipMappingAnnotation implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> targetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> fetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- //**************** Annotation implementation **************
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean newOptional) {
- Boolean oldOptional = this.optional;
- this.optional = newOptional;
- this.optionalAdapter.setValue(newOptional);
- firePropertyChanged(OPTIONAL_PROPERTY, oldOptional, newOptional);
- }
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String newMappedBy) {
- String oldMappedBy = this.mappedBy;
- this.mappedBy = newMappedBy;
- this.mappedByAdapter.setValue(newMappedBy);
- firePropertyChanged(MAPPED_BY_PROPERTY, oldMappedBy, newMappedBy);
- }
-
- public TextRange mappedByTextRange(CompilationUnit astRoot) {
- return elementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public TextRange optionalTextRange(CompilationUnit astRoot) {
- return elementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setOptional(this.optional(astRoot));
- this.setMappedBy(this.mappedByAdapter.getValue(astRoot));
- }
-
- protected String mappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- protected Boolean optional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- public static class OneToOneAnnotationDefinition implements AnnotationDefinition
- {
-
- // singleton
- private static final OneToOneAnnotationDefinition INSTANCE = new OneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static OneToOneAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new OneToOneImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java
deleted file mode 100644
index e17ad11f33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByImpl.java
+++ /dev/null
@@ -1,113 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OrderBy;
-
-public class OrderByImpl extends AbstractAnnotationResource<Attribute> implements OrderBy
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private String value;
-
- protected OrderByImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ORDER_BY__VALUE, false);
- }
-
-
- public static class OrderByAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final OrderByAnnotationDefinition INSTANCE = new OrderByAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OrderByAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new OrderByImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java
deleted file mode 100644
index 0c801d9dc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OverrideImpl.java
+++ /dev/null
@@ -1,89 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-
-public abstract class OverrideImpl
- extends AbstractAnnotationResource<Member>
- implements OverrideAnnotation
-{
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private String name;
-
-
- protected OverrideImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.ATTRIBUTE_OVERRIDE__NAME, false); // false = do not remove annotation when empty
- this.nameAdapter = new ShortCircuitAnnotationElementAdapter<String>(getMember(),this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- OverrideAnnotation oldOverride = (OverrideAnnotation) oldAnnotation;
- setName(oldOverride.getName());
- }
-
- //************ AttriubteOverride implementation ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, oldName, newName);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java
deleted file mode 100644
index 8fc204d93f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnImpl.java
+++ /dev/null
@@ -1,181 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-public class PrimaryKeyJoinColumnImpl extends AbstractNamedColumn implements NestablePrimaryKeyJoinColumn
-{
-
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // hold this so we can get the 'referenced column name' text range
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
-
- private String referencedColumnName;
-
- protected PrimaryKeyJoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- protected PrimaryKeyJoinColumnImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected PrimaryKeyJoinColumnImpl(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.referencedColumnName(astRoot);
- }
-
- @Override
- protected String nameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String columnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- PrimaryKeyJoinColumnAnnotation oldColumn = (PrimaryKeyJoinColumnAnnotation) oldAnnotation;
- setReferencedColumnName(oldColumn.getReferencedColumnName());
- }
-
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String newReferencedColumnName) {
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = newReferencedColumnName;
- this.referencedColumnNameAdapter.setValue(newReferencedColumnName);
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, newReferencedColumnName);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setReferencedColumnName(this.referencedColumnName(astRoot));
- }
-
- protected String referencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
- public TextRange referencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- // ********** static methods **********
-
- static PrimaryKeyJoinColumnImpl createPrimaryKeyJoinColumn(JavaResourceNode parent, Member member) {
- return new PrimaryKeyJoinColumnImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static PrimaryKeyJoinColumnImpl createNestedPrimaryKeyJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, pkJoinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new PrimaryKeyJoinColumnImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(pkJoinColumnsAdapter, index, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
-
-
- static NestablePrimaryKeyJoinColumn createSecondaryTablePrimaryKeyJoinColumn(DeclarationAnnotationAdapter secondaryTableAdapter, JavaResourceNode parent, Member member, int index) {
- return new PrimaryKeyJoinColumnImpl(parent, member, buildSecondaryTableAnnotationAdapter(secondaryTableAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildSecondaryTableAnnotationAdapter(DeclarationAnnotationAdapter secondaryTableAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTableAdapter, JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS, index, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
-
- public static class PrimaryKeyJoinColumnAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final PrimaryKeyJoinColumnAnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private PrimaryKeyJoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return PrimaryKeyJoinColumnImpl.createPrimaryKeyJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java
deleted file mode 100644
index dbd95f2db5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsImpl.java
+++ /dev/null
@@ -1,156 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumns;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class PrimaryKeyJoinColumnsImpl extends AbstractAnnotationResource<Member> implements PrimaryKeyJoinColumns
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private List<NestablePrimaryKeyJoinColumn> pkJoinColumns;
-
- protected PrimaryKeyJoinColumnsImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.pkJoinColumns = new ArrayList<NestablePrimaryKeyJoinColumn>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return "value";
- }
-
- public ListIterator<NestablePrimaryKeyJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestablePrimaryKeyJoinColumn>(this.pkJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumn addInternal(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = createPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- public NestablePrimaryKeyJoinColumn add(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = createPrimaryKeyJoinColumn(index);
- add(index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void add(int index, NestablePrimaryKeyJoinColumn pkJoinColumn) {
- addItemToList(index, pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void remove(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- removeItemFromList(pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public int indexOf(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- return this.pkJoinColumns.indexOf(pkJoinColumn);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationFor(Annotation jdtAnnotation) {
- for (NestablePrimaryKeyJoinColumn pkJoinColumn : this.pkJoinColumns) {
- if (jdtAnnotation == pkJoinColumn.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private PrimaryKeyJoinColumnImpl createPrimaryKeyJoinColumn(int index) {
- return PrimaryKeyJoinColumnImpl.createNestedPrimaryKeyJoinColumn(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
-
- public static class PrimaryKeyJoinColumnsAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final PrimaryKeyJoinColumnsAnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private PrimaryKeyJoinColumnsAnnotationDefinition() {
- super();
- }
-
- public PrimaryKeyJoinColumns buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new PrimaryKeyJoinColumnsImpl(parent, member);
- }
-
- public PrimaryKeyJoinColumns buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java
deleted file mode 100644
index 25dac71043..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/QueryHintImpl.java
+++ /dev/null
@@ -1,153 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-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.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Type;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHint;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-
-public class QueryHintImpl extends AbstractAnnotationResource<Type>
- implements NestableQueryHint
-{
-
- // hold this so we can get the 'name' text range
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
-
- // hold this so we can get the 'value' text range
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String> nameAdapter;
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private String name;
-
- private String value;
-
- public QueryHintImpl(JavaResourceNode parent, Type type, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, type, idaa, new MemberIndexedAnnotationAdapter(type, idaa));
- this.nameDeclarationAdapter = this.nameAdapter(idaa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.valueDeclarationAdapter = this.valueAdapter(idaa);
- this.valueAdapter = this.buildAdapter(this.valueDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.name(astRoot);
- this.value = this.value(astRoot);
- }
-
- // ********** initialization **********
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new ShortCircuitAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__NAME);
- }
-
- protected DeclarationAnnotationElementAdapter<String> valueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JPA.QUERY_HINT__VALUE);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public IndexedAnnotationAdapter getAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.nameAdapter.setValue(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(newValue);
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange nameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setName(this.name(astRoot));
- this.setValue(this.value(astRoot));
- }
-
- protected String name(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- protected String value(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- // ********** persistence model -> java annotations **********
- public void moveAnnotation(int newIndex) {
- getAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- QueryHintAnnotation oldQueryHint = (QueryHintAnnotation) oldAnnotation;
- setName(oldQueryHint.getName());
- setValue(oldQueryHint.getValue());
- }
-
- // ********** static methods **********
- static QueryHintImpl createNamedQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new QueryHintImpl(parent, type, buildNamedQueryQueryHintAnnotationAdapter(namedQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueryAdapter, JPA.NAMED_QUERY__HINTS, index, JPA.QUERY_HINT);
- }
-
- static QueryHintImpl createNamedNativeQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new QueryHintImpl(parent, type, buildNamedNativeQueryQueryHintAnnotationAdapter(namedNativeQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedNativeQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedNativeQueryAdapter, JPA.NAMED_NATIVE_QUERY__HINTS, index, JPA.QUERY_HINT);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java
deleted file mode 100644
index 6170fd7e41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableImpl.java
+++ /dev/null
@@ -1,322 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter;
-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.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.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTable;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class SecondaryTableImpl extends AbstractTableResource implements NestableSecondaryTable
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(SecondaryTableAnnotation.ANNOTATION_NAME);
-
- private final List<NestablePrimaryKeyJoinColumn> pkJoinColumns;
-
- private final PkJoinColumnsContainerAnnotation pkJoinColumnsContainerAnnotation;
-
-
- protected SecondaryTableImpl(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.pkJoinColumns = new ArrayList<NestablePrimaryKeyJoinColumn>();
- this.pkJoinColumnsContainerAnnotation = new PkJoinColumnsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.pkJoinColumnsContainerAnnotation);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> catalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__CATALOG);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__NAME);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> schemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__SCHEMA);
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public void moveAnnotation(int newIndex) {
- getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- SecondaryTableAnnotation oldSecondaryTable = (SecondaryTableAnnotation) oldAnnotation;
- setName(oldSecondaryTable.getName());
- setCatalog(oldSecondaryTable.getCatalog());
- setSchema(oldSecondaryTable.getSchema());
- for (UniqueConstraint uniqueConstraint : CollectionTools.iterable(oldSecondaryTable.uniqueConstraints())) {
- NestableUniqueConstraint newUniqueConstraint = addUniqueConstraint(oldSecondaryTable.indexOfUniqueConstraint(uniqueConstraint));
- newUniqueConstraint.initializeFrom((NestableAnnotation) uniqueConstraint);
- }
- for (PrimaryKeyJoinColumnAnnotation pkJoinColumn : CollectionTools.iterable(oldSecondaryTable.pkJoinColumns())) {
- NestablePrimaryKeyJoinColumn newPkJoinColumn = addPkJoinColumn(oldSecondaryTable.indexOfPkJoinColumn(pkJoinColumn));
- newPkJoinColumn.initializeFrom((NestableAnnotation) pkJoinColumn);
- }
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createSecondaryTableUniqueConstraint(this, this.getMember(), this.getDeclarationAnnotationAdapter(), index);
- }
-
- // ************* SecondaryTable implementation *******************
-
-
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumn pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation joinColumn) {
- return this.pkJoinColumns.indexOf(joinColumn);
- }
-
- public NestablePrimaryKeyJoinColumn addPkJoinColumn(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = (NestablePrimaryKeyJoinColumn) ContainerAnnotationTools.addNestedAnnotation(index, this.pkJoinColumnsContainerAnnotation);
- fireItemAdded(SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void addPkJoinColumn(int index, NestablePrimaryKeyJoinColumn pkJoinColumn) {
- addItemToList(index, pkJoinColumn, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
- public void removePkJoinColumn(int index) {
- NestablePrimaryKeyJoinColumn pkJoinColumn = this.pkJoinColumns.get(index);
- removePkJoinColumn(pkJoinColumn);
- pkJoinColumn.removeAnnotation();
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.pkJoinColumnsContainerAnnotation);
- }
-
- protected void removePkJoinColumn(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- removeItemFromList(pkJoinColumn, this.pkJoinColumns, SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST);
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- movePkJoinColumnInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.pkJoinColumnsContainerAnnotation);
- fireItemMoved(SecondaryTableAnnotation.PK_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected void movePkJoinColumnInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex);
- }
-
-
- protected NestablePrimaryKeyJoinColumn createPrimaryKeyJoinColumn(int index) {
- return PrimaryKeyJoinColumnImpl.createSecondaryTablePrimaryKeyJoinColumn(getDeclarationAnnotationAdapter(), this, getMember(), index);
- }
-
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.updatePkJoinColumnsFromJava(astRoot);
- }
-
- private void updatePkJoinColumnsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.pkJoinColumnsContainerAnnotation);
- }
-
- // ********** static methods **********
- static SecondaryTableImpl createSecondaryTable(JavaResourceNode parent, Member member) {
- return new SecondaryTableImpl(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SecondaryTableImpl createNestedSecondaryTable(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, secondaryTablesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SecondaryTableImpl(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTablesAdapter, index, JPA.SECONDARY_TABLE);
- }
-
-
- private class PkJoinColumnsContainerAnnotation extends AbstractResource
- implements ContainerAnnotation<NestablePrimaryKeyJoinColumn>
- {
- public PkJoinColumnsContainerAnnotation() {
- super(SecondaryTableImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestablePrimaryKeyJoinColumn addInternal(int index) {
- NestablePrimaryKeyJoinColumn pKJoinColumn = SecondaryTableImpl.this.createPrimaryKeyJoinColumn(index);
- SecondaryTableImpl.this.pkJoinColumns.add(index, pKJoinColumn);
- return pKJoinColumn;
- }
-
- public NestablePrimaryKeyJoinColumn add(int index) {
- NestablePrimaryKeyJoinColumn pKJoinColumn = SecondaryTableImpl.this.createPrimaryKeyJoinColumn(index);
- SecondaryTableImpl.this.addPkJoinColumn(index, pKJoinColumn);
- return pKJoinColumn;
- }
-
- public int indexOf(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- return SecondaryTableImpl.this.indexOfPkJoinColumn(pkJoinColumn);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- SecondaryTableImpl.this.movePkJoinColumn(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- SecondaryTableImpl.this.movePkJoinColumnInternal(targetIndex, sourceIndex);
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationAt(int index) {
- return SecondaryTableImpl.this.pkJoinColumnAt(index);
- }
-
- public ListIterator<NestablePrimaryKeyJoinColumn> nestedAnnotations() {
- return new CloneListIterator<NestablePrimaryKeyJoinColumn>(SecondaryTableImpl.this.pkJoinColumns);
- }
-
- public int nestedAnnotationsSize() {
- return pkJoinColumnsSize();
- }
-
- public String getAnnotationName() {
- return SecondaryTableImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN;
- }
-
- public NestablePrimaryKeyJoinColumn nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestablePrimaryKeyJoinColumn pkJoinColumn : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == pkJoinColumn.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return pkJoinColumn;
- }
- }
- return null;
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public void remove(NestablePrimaryKeyJoinColumn pkJoinColumn) {
- SecondaryTableImpl.this.removePkJoinColumn(pkJoinColumn);
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return SecondaryTableImpl.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- SecondaryTableImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- SecondaryTableImpl.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- SecondaryTableImpl.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return SecondaryTableImpl.this.textRange(astRoot);
- }
-
- public String getElementName() {
- return "pkJoinColumns";
- }
- }
-
- public static class SecondaryTableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final SecondaryTableAnnotationDefinition INSTANCE = new SecondaryTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private SecondaryTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SecondaryTableImpl.createSecondaryTable(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java
deleted file mode 100644
index 68424d1ca5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesImpl.java
+++ /dev/null
@@ -1,160 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTable;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTables;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class SecondaryTablesImpl extends AbstractAnnotationResource<Member> implements SecondaryTables
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final List<NestableSecondaryTable> secondaryTables;
-
- protected SecondaryTablesImpl(JavaResourcePersistentType parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.secondaryTables = new ArrayList<NestableSecondaryTable>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public String getNestableAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public String getElementName() {
- return "value";
- }
-
- public ListIterator<NestableSecondaryTable> nestedAnnotations() {
- return new CloneListIterator<NestableSecondaryTable>(this.secondaryTables);
- }
-
- public int nestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- public NestableSecondaryTable addInternal(int index) {
- NestableSecondaryTable secondaryTable = createSecondaryTable(index);
- this.secondaryTables.add(index, secondaryTable);
- return secondaryTable;
- }
-
- public NestableSecondaryTable add(int index) {
- NestableSecondaryTable secondaryTable = createSecondaryTable(index);
- this.add(index, secondaryTable);
- return secondaryTable;
- }
-
- protected void add(int index, NestableSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.secondaryTables, SecondaryTables.SECONDARY_TABLES_LIST);
- }
-
- public void remove(NestableSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.secondaryTables, SecondaryTables.SECONDARY_TABLES_LIST);
- }
-
- public void remove(int index) {
- removeItemFromList(index, this.secondaryTables, SecondaryTables.SECONDARY_TABLES_LIST);
- }
-
- public int indexOf(NestableSecondaryTable secondaryTable) {
- return this.secondaryTables.indexOf(secondaryTable);
- }
-
- public NestableSecondaryTable nestedAnnotationAt(int index) {
- return this.secondaryTables.get(index);
- }
-
- public NestableSecondaryTable nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableSecondaryTable secondaryTable : this.secondaryTables) {
- if (jdtAnnotation == secondaryTable.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return secondaryTable;
- }
- }
- return null;
- }
-
- public void move(int targetIndex, int sourceIndex) {
- moveItemInList(targetIndex, sourceIndex, this.secondaryTables, SecondaryTables.SECONDARY_TABLES_LIST);
- }
- //TODO this move is different than how we handle SecondarTable.pkJoinColumns
-// public void movePkJoinColumn(int oldIndex, int newIndex) {
-// movePkJoinColumnInternal(oldIndex, newIndex);
-// ContainerAnnotationTools.synchAnnotationsAfterMove(newIndex, oldIndex, this.pkJoinColumnsContainerAnnotation);
-// fireItemMoved(SecondaryTable.PK_JOIN_COLUMNS_LIST, newIndex, oldIndex);
-// }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.secondaryTables, targetIndex, sourceIndex);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this);
- }
-
- private SecondaryTableImpl createSecondaryTable(int index) {
- return SecondaryTableImpl.createNestedSecondaryTable(this, getMember(), index, getDeclarationAnnotationAdapter());
- }
-
- public static class SecondaryTablesAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final SecondaryTablesAnnotationDefinition INSTANCE = new SecondaryTablesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private SecondaryTablesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SecondaryTablesImpl((JavaResourcePersistentType) parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java
deleted file mode 100644
index 69974d650e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorImpl.java
+++ /dev/null
@@ -1,147 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-
-public class SequenceGeneratorImpl extends GeneratorImpl implements SequenceGeneratorAnnotation
-{
- private final AnnotationElementAdapter<String> sequenceNameAdapter;
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> SEQUENCE_NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME);
-
- private String sequenceName;
-
- protected SequenceGeneratorImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.sequenceNameAdapter = this.buildAdapter(SEQUENCE_NAME_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.sequenceName = this.sequenceName(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- //************ GeneratorImpl implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> allocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationAdapter annotationAdapter() {
- return DECLARATION_ANNOTATION_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> initialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> nameAdapter() {
- return NAME_ADAPTER;
- }
-
-
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String newSequenceName) {
- String oldSequenceName = this.sequenceName;
- this.sequenceName = newSequenceName;
- this.sequenceNameAdapter.setValue(newSequenceName);
- firePropertyChanged(SEQUENCE_NAME_PROPERTY, oldSequenceName, newSequenceName);
- }
-
- public TextRange sequenceNameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(SEQUENCE_NAME_ADAPTER, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setSequenceName(this.sequenceName(astRoot));
- }
-
- protected String sequenceName(CompilationUnit astRoot) {
- return this.sequenceNameAdapter.getValue(astRoot);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- public static class SequenceGeneratorAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final SequenceGeneratorAnnotationDefinition INSTANCE = new SequenceGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private SequenceGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SequenceGeneratorImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java
deleted file mode 100644
index 5f34123892..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorImpl.java
+++ /dev/null
@@ -1,465 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class TableGeneratorImpl extends GeneratorImpl implements TableGeneratorAnnotation
-{
- private final AnnotationElementAdapter<String> tableAdapter;
-
- private final AnnotationElementAdapter<String> catalogAdapter;
-
- private final AnnotationElementAdapter<String> schemaAdapter;
-
- private final AnnotationElementAdapter<String> pkColumnNameAdapter;
-
- private final AnnotationElementAdapter<String> valueColumnNameAdapter;
-
- private final AnnotationElementAdapter<String> pkColumnValueAdapter;
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> TABLE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__TABLE);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__CATALOG);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_VALUE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
-
- private String table;
-
- private String catalog;
-
- private String schema;
-
- private String pkColumnName;
-
- private String valueColumnName;
-
- private String pkColumnValue;
-
- private final List<NestableUniqueConstraint> uniqueConstraints;
-
- private final UniqueConstraintsContainerAnnotation uniqueConstraintsContainerAnnotation;
-
-
- protected TableGeneratorImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.tableAdapter = this.buildAdapter(TABLE_ADAPTER);
- this.catalogAdapter = this.buildAdapter(CATALOG_ADAPTER);
- this.schemaAdapter = this.buildAdapter(SCHEMA_ADAPTER);
- this.pkColumnNameAdapter = this.buildAdapter(PK_COLUMN_NAME_ADAPTER);
- this.valueColumnNameAdapter = this.buildAdapter(VALUE_COLUMN_NAME_ADAPTER);
- this.pkColumnValueAdapter = this.buildAdapter(PK_COLUMN_VALUE_ADAPTER);
- this.uniqueConstraints = new ArrayList<NestableUniqueConstraint>();
- this.uniqueConstraintsContainerAnnotation = new UniqueConstraintsContainerAnnotation();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.table(astRoot);
- this.catalog = this.catalog(astRoot);
- this.schema = this.schema(astRoot);
- this.pkColumnName = this.pkColumnName(astRoot);
- this.valueColumnName = this.valueColumnName(astRoot);
- this.pkColumnValue = this.pkColumnValue(astRoot);
- ContainerAnnotationTools.initializeNestedAnnotations(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- //************ GeneratorImpl implementation **************
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> allocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationAdapter annotationAdapter() {
- return DECLARATION_ANNOTATION_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<Integer> initialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> nameAdapter() {
- return NAME_ADAPTER;
- }
-
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String newTable) {
- String oldTable = this.table;
- this.table = newTable;
- this.tableAdapter.setValue(newTable);
- firePropertyChanged(TABLE_PROPERTY, oldTable, newTable);
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String newCatalog) {
- String oldCatalog = this.catalog;
- this.catalog = newCatalog;
- this.catalogAdapter.setValue(newCatalog);
- firePropertyChanged(CATALOG_PROPERTY, oldCatalog, newCatalog);
- }
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String newSchema) {
- String oldSchema = this.schema;
- this.schema = newSchema;
- this.schemaAdapter.setValue(newSchema);
- firePropertyChanged(SCHEMA_PROPERTY, oldSchema, newSchema);
- }
-
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String newPkColumnName) {
- String oldPkColumnName = this.pkColumnName;
- this.pkColumnName = newPkColumnName;
- this.pkColumnNameAdapter.setValue(newPkColumnName);
- firePropertyChanged(PK_COLUMN_NAME_PROPERTY, oldPkColumnName, newPkColumnName);
- }
-
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String newValueColumnName) {
- String oldValueColumnName = this.valueColumnName;
- this.valueColumnName = newValueColumnName;
- this.valueColumnNameAdapter.setValue(newValueColumnName);
- firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, oldValueColumnName, newValueColumnName);
- }
-
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String newPkColumnValue) {
- String oldPkColumnValue = this.pkColumnValue;
- this.pkColumnValue = newPkColumnValue;
- this.pkColumnValueAdapter.setValue(newPkColumnValue);
- firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, oldPkColumnValue, newPkColumnValue);
- }
-
- public ListIterator<UniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraint uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraint uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraint addUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = (NestableUniqueConstraint) ContainerAnnotationTools.addNestedAnnotation(index, this.uniqueConstraintsContainerAnnotation);
- fireItemAdded(TableGeneratorAnnotation.UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- private void addUniqueConstraint(int index, NestableUniqueConstraint uniqueConstraint) {
- addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void removeUniqueConstraint(int index) {
- NestableUniqueConstraint uniqueConstraint = this.uniqueConstraints.get(index);
- removeUniqueConstraint(uniqueConstraint);
- uniqueConstraint.removeAnnotation();
- synchUniqueConstraintAnnotationsAfterRemove(index);
- }
-
- protected void removeUniqueConstraint(NestableUniqueConstraint uniqueConstraint) {
- removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- moveUniqueConstraintInternal(targetIndex, sourceIndex);
- ContainerAnnotationTools.synchAnnotationsAfterMove(targetIndex, sourceIndex, this.uniqueConstraintsContainerAnnotation);
- fireItemMoved(TableAnnotation.UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveUniqueConstraintInternal(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- }
-
- /**
- * synchronize the annotations with the model join columns,
- * starting at the specified index to prevent overlap
- */
- private void synchUniqueConstraintAnnotationsAfterRemove(int index) {
- ContainerAnnotationTools.synchAnnotationsAfterRemove(index, this.uniqueConstraintsContainerAnnotation);
- }
-
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createTableGeneratorUniqueConstraint(this, this.getMember(), index);
- }
-
- public TextRange tableTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(TABLE_ADAPTER, astRoot);
- }
-
- public TextRange catalogTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(CATALOG_ADAPTER, astRoot);
- }
-
- public TextRange schemaTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(SCHEMA_ADAPTER, astRoot);
- }
-
- public TextRange pkColumnNameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(PK_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- public TextRange pkColumnValueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(PK_COLUMN_VALUE_ADAPTER, astRoot);
- }
-
- public TextRange valueColumnNameTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- // ********** java annotations -> persistence model **********
- @Override
- public void updateFromJava(CompilationUnit astRoot) {
- super.updateFromJava(astRoot);
- this.setTable(this.table(astRoot));
- this.setCatalog(this.catalog(astRoot));
- this.setSchema(this.schema(astRoot));
- this.setPkColumnName(this.pkColumnName(astRoot));
- this.setValueColumnName(this.valueColumnName(astRoot));
- this.setPkColumnValue(this.pkColumnValue(astRoot));
- this.updateUniqueConstraintsFromJava(astRoot);
- }
-
- protected String table(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
- protected String catalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
- protected String schema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
- protected String pkColumnName(CompilationUnit astRoot) {
- return this.pkColumnNameAdapter.getValue(astRoot);
- }
- protected String valueColumnName(CompilationUnit astRoot) {
- return this.valueColumnNameAdapter.getValue(astRoot);
- }
- protected String pkColumnValue(CompilationUnit astRoot) {
- return this.pkColumnValueAdapter.getValue(astRoot);
- }
-
- /**
- * here we just worry about getting the unique constraints lists the same size;
- * then we delegate to the unique constraints to synch themselves up
- */
- private void updateUniqueConstraintsFromJava(CompilationUnit astRoot) {
- ContainerAnnotationTools.updateNestedAnnotationsFromJava(astRoot, this.uniqueConstraintsContainerAnnotation);
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
-
- private class UniqueConstraintsContainerAnnotation extends AbstractResource
- implements ContainerAnnotation<NestableUniqueConstraint>
- {
- public UniqueConstraintsContainerAnnotation() {
- super(TableGeneratorImpl.this);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public NestableUniqueConstraint addInternal(int index) {
- NestableUniqueConstraint uniqueConstraint = TableGeneratorImpl.this.createUniqueConstraint(index);
- TableGeneratorImpl.this.uniqueConstraints.add(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public NestableUniqueConstraint add(int index) {
- NestableUniqueConstraint uniqueConstraint = TableGeneratorImpl.this.createUniqueConstraint(index);
- TableGeneratorImpl.this.addUniqueConstraint(index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public String getAnnotationName() {
- return TableGeneratorImpl.this.getAnnotationName();
- }
-
- public String getNestableAnnotationName() {
- return JPA.UNIQUE_CONSTRAINT;
- }
-
- public int indexOf(NestableUniqueConstraint uniqueConstraint) {
- return TableGeneratorImpl.this.indexOfUniqueConstraint(uniqueConstraint);
- }
-
- public void move(int targetIndex, int sourceIndex) {
- TableGeneratorImpl.this.moveUniqueConstraint(targetIndex, sourceIndex);
- }
-
- public void moveInternal(int targetIndex, int sourceIndex) {
- TableGeneratorImpl.this.moveUniqueConstraintInternal(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraint nestedAnnotationAt(int index) {
- return TableGeneratorImpl.this.uniqueConstraintAt(index);
- }
-
- public NestableUniqueConstraint nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation) {
- for (NestableUniqueConstraint uniqueConstraint : CollectionTools.iterable(nestedAnnotations())) {
- if (jdtAnnotation == uniqueConstraint.jdtAnnotation((CompilationUnit) jdtAnnotation.getRoot())) {
- return uniqueConstraint;
- }
- }
- return null;
- }
-
- public ListIterator<NestableUniqueConstraint> nestedAnnotations() {
- return new CloneListIterator<NestableUniqueConstraint>(TableGeneratorImpl.this.uniqueConstraints);
- }
-
- public int nestedAnnotationsSize() {
- return TableGeneratorImpl.this.uniqueConstraints.size();
- }
-
- public void remove(NestableUniqueConstraint uniqueConstraint) {
- TableGeneratorImpl.this.removeUniqueConstraint(uniqueConstraint);
- }
-
- public void remove(int index) {
- this.remove(nestedAnnotationAt(index));
- }
-
- public org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot) {
- return TableGeneratorImpl.this.jdtAnnotation(astRoot);
- }
-
- public void newAnnotation() {
- TableGeneratorImpl.this.newAnnotation();
- }
-
- public void removeAnnotation() {
- TableGeneratorImpl.this.removeAnnotation();
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- TableGeneratorImpl.this.updateFromJava(astRoot);
- }
-
- public TextRange textRange(CompilationUnit astRoot) {
- return TableGeneratorImpl.this.textRange(astRoot);
- }
-
- public String getElementName() {
- return "uniqueConstraints";
- }
- }
-
- public static class TableGeneratorAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TableGeneratorAnnotationDefinition INSTANCE = new TableGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TableGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TableGeneratorImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.java
deleted file mode 100644
index 54e3f8bb3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableImpl.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.core.internal.resource.java;
-
-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.Member;
-import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-public class TableImpl extends AbstractTableResource
-{
- private static final String ANNOTATION_NAME = JPA.TABLE;
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__CATALOG);
-
- protected TableImpl(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> nameAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> schemaAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> catalogAdapter(@SuppressWarnings("unused") DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected NestableUniqueConstraint createUniqueConstraint(int index) {
- return UniqueConstraintImpl.createTableUniqueConstraint(this, this.getMember(), index);
- }
-
- public static class TableAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TableAnnotationDefinition INSTANCE = new TableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TableImpl(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullTable(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java
deleted file mode 100644
index e063d48f83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalImpl.java
+++ /dev/null
@@ -1,113 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.Temporal;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-
-public class TemporalImpl extends AbstractAnnotationResource<Attribute> implements Temporal
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
-
- private final AnnotationElementAdapter<String> valueAdapter;
-
- private TemporalType value;
-
- protected TemporalImpl(JavaResourceNode parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.value(astRoot);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType newValue) {
- TemporalType oldValue = this.value;
- this.value = newValue;
- this.valueAdapter.setValue(TemporalType.toJavaAnnotationValue(newValue));
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public TextRange valueTextRange(CompilationUnit astRoot) {
- return this.elementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.setValue(this.value(astRoot));
- }
-
- protected TemporalType value(CompilationUnit astRoot) {
- return TemporalType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- // ********** static methods **********
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.TEMPORAL__VALUE);
- }
-
- public static class TemporalAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TemporalAnnotationDefinition INSTANCE = new TemporalAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TemporalAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TemporalImpl(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new NullTemporal(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java
deleted file mode 100644
index 1e7e7b36b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.Transient;
-
-public class TransientImpl extends AbstractAnnotationResource<Attribute> implements Transient
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- protected TransientImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class TransientAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final TransientAnnotationDefinition INSTANCE = new TransientAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static TransientAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TransientAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new TransientImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java
deleted file mode 100644
index fef81ac5d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/UniqueConstraintImpl.java
+++ /dev/null
@@ -1,166 +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.internal.resource.java;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.AnnotationStringArrayExpressionConverter;
-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.ExpressionConverter;
-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.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitArrayAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.UniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class UniqueConstraintImpl extends AbstractAnnotationResource<Member> implements NestableUniqueConstraint
-{
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.UNIQUE_CONSTRAINT);
-
- private final DeclarationAnnotationElementAdapter<String[]> columnNamesDeclarationAdapter;
-
- private final AnnotationElementAdapter<String[]> columnNamesAdapter;
-
- private final List<String> columnNames;
-
-
- public UniqueConstraintImpl(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- this.columnNamesDeclarationAdapter = buildArrayAnnotationElementAdapter(idaa, JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- this.columnNamesAdapter = this.buildAnnotationElementAdapter(this.columnNamesDeclarationAdapter);
- this.columnNames = new ArrayList<String>();
- }
-
- public void initialize(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- for (int i = 0; i < javaColumnNames.length; i++) {
- this.columnNames.add(javaColumnNames[i]);
- }
- }
-
- protected AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new ShortCircuitArrayAnnotationElementAdapter<String>(getMember(), daea);
- }
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, false, converter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public IndexedAnnotationAdapter getAnnotationAdapter() {
- return (IndexedAnnotationAdapter) super.getAnnotationAdapter();
- }
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- UniqueConstraint oldUniqueConstraint = (UniqueConstraint) oldAnnotation;
- for (String columnName : CollectionTools.iterable(oldUniqueConstraint.columnNames())) {
- addColumnName(columnName);
- }
- }
-
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(String columnName) {
- addItemToList(columnName, this.columnNames, COLUMN_NAMES_LIST);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- public void removeColumnName(String columnName) {
- removeItemFromList(columnName, this.columnNames, COLUMN_NAMES_LIST);
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.columnNamesDeclarationAdapter, pos, astRoot);
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- this.updateColumnNamesFromJava(astRoot);
- }
-
- protected void updateColumnNamesFromJava(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- //TODO hmm, seems we need change notification for this
- CollectionTools.retainAll(this.columnNames, javaColumnNames);
- for (int i = 0; i < javaColumnNames.length; i++) {
- String columnName = javaColumnNames[i];
- if (!this.columnNames.contains(columnName)) {
- addColumnName(columnName);
- }
- }
- }
-
- // ********** persistence model -> java annotations **********
- public void moveAnnotation(int newIndex) {
- getAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- // ********** static methods **********
- static NestableUniqueConstraint createSecondaryTableUniqueConstraint(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter declarationAnnotationAdapter, int index) {
- return new UniqueConstraintImpl(parent, member, buildSecondaryTableUniqueConstraintAnnotationAdapter(declarationAnnotationAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildSecondaryTableUniqueConstraintAnnotationAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createJoinTableUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildJoinTableUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildJoinTableUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(JoinTableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createTableUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildTableUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTableUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(TableImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- static NestableUniqueConstraint createTableGeneratorUniqueConstraint(JavaResourceNode parent, Member member, int index) {
- return new UniqueConstraintImpl(parent, member, buildTableGeneratorUniqueConstraintAnnotationAdapter(index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTableGeneratorUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(TableGeneratorImpl.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java
deleted file mode 100644
index 560c600141..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionImpl.java
+++ /dev/null
@@ -1,75 +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.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jdtutility.Attribute;
-import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.Version;
-
-public class VersionImpl extends AbstractAnnotationResource<Attribute> implements Version
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public VersionImpl(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public void initialize(CompilationUnit astRoot) {
- //nothing to initialize
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void updateFromJava(CompilationUnit astRoot) {
- //no annotation members
- }
-
- public static class VersionAnnotationDefinition implements AnnotationDefinition
- {
- // singleton
- private static final VersionAnnotationDefinition INSTANCE = new VersionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static VersionAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private VersionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new VersionImpl((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member) {
- return null;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java
deleted file mode 100644
index 1e8a3efc57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AssociationOverrideTranslator.java
+++ /dev/null
@@ -1,48 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AssociationOverrideTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AssociationOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createJoinColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAssociationOverride_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlAssociationOverride_JoinColumns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java
deleted file mode 100644
index 6ab8d906cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributeOverrideTranslator.java
+++ /dev/null
@@ -1,55 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AttributeOverrideTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AttributeOverrideTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlAttributeOverrideImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeOverride_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getXmlAttributeOverride_Column());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java
deleted file mode 100644
index 80ee0f83e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/AttributesTranslator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class AttributesTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public AttributesTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createIdTranslator(),
- createEmbeddedIdTranslator(),
- createBasicTranslator(),
- createVersionTranslator(),
- createManyToOneTranslator(),
- createOneToManyTranslator(),
- createOneToOneTranslator(),
- createManyToManyTranslator(),
- createEmbeddedTranslator(),
- createTransientTranslator()
- };
- }
-
- private Translator createIdTranslator() {
- return new IdTranslator(ID, ORM_PKG.getAttributes_Ids());
- }
-
- private Translator createEmbeddedIdTranslator() {
- return new EmbeddedIdTranslator(EMBEDDED_ID, ORM_PKG.getAttributes_EmbeddedIds());
- }
-
- private Translator createBasicTranslator() {
- return new BasicTranslator(BASIC, ORM_PKG.getAttributes_Basics());
- }
-
- private Translator createVersionTranslator() {
- return new VersionTranslator(VERSION, ORM_PKG.getAttributes_Versions());
- }
-
- private Translator createManyToOneTranslator() {
- return new ManyToOneTranslator(MANY_TO_ONE, ORM_PKG.getAttributes_ManyToOnes());
- }
-
- private Translator createOneToManyTranslator() {
- return new OneToManyTranslator(ONE_TO_MANY, ORM_PKG.getAttributes_OneToManys());
- }
-
- private Translator createOneToOneTranslator() {
- return new OneToOneTranslator(ONE_TO_ONE, ORM_PKG.getAttributes_OneToOnes());
- }
-
- private Translator createManyToManyTranslator() {
- return new ManyToManyTranslator(MANY_TO_MANY, ORM_PKG.getAttributes_ManyToManys());
- }
-
- private Translator createEmbeddedTranslator() {
- return new EmbeddedTranslator(EMBEDDED, ORM_PKG.getAttributes_Embeddeds());
- }
-
- private Translator createTransientTranslator() {
- return new TransientTranslator(TRANSIENT, ORM_PKG.getAttributes_Transients());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.java
deleted file mode 100644
index 27ee171703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/BasicTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class BasicTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public BasicTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlBasicImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createColumnTranslator(),
- createLobTranslator(),
- createTemporalTranslator(),
- createEnumeratedTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlBasic_Fetch(), DOM_ATTRIBUTE);
- }
-
- private Translator createOptionalTranslator() {
- return new BooleanTranslator(OPTIONAL, ORM_PKG.getXmlBasic_Optional(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- private Translator createLobTranslator() {
- return new EmptyTagBooleanTranslator(LOB, ORM_PKG.getXmlBasic_Lob());
- }
-
- private Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlBasic_Temporal());
- }
-
- private Translator createEnumeratedTranslator() {
- return new Translator(ENUMERATED, ORM_PKG.getXmlBasic_Enumerated());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java
deleted file mode 100644
index c01e162dbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/CascadeTypeTranslator.java
+++ /dev/null
@@ -1,63 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class CascadeTypeTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public CascadeTypeTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createCascadeAllTranslator(),
- createCascadePersistTranslator(),
- createCascadeMergeTranslator(),
- createCascadeRemoveTranslator(),
- createCascadeRefreshTranslator()
- };
- }
-
- private Translator createCascadeAllTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_ALL, ORM_PKG.getCascadeType_CascadeAll());
- }
-
- private Translator createCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_PERSIST, ORM_PKG.getCascadeType_CascadePersist());
- }
-
- private Translator createCascadeMergeTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_MERGE, ORM_PKG.getCascadeType_CascadeMerge());
- }
-
- private Translator createCascadeRemoveTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_REMOVE, ORM_PKG.getCascadeType_CascadeRemove());
- }
-
- private Translator createCascadeRefreshTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_REFRESH, ORM_PKG.getCascadeType_CascadeRefresh());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java
deleted file mode 100644
index 1a22562303..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnResultTranslator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ColumnResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ColumnResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getColumnResult_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.java
deleted file mode 100644
index a56028192b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ColumnTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlColumnImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createUniqueTranslator(),
- createNullableTranslator(),
- createInsertableTranslator(),
- createUpdatableTranslator(),
- createColumnDefinitionTranslator(),
- createTableTranslator(),
- createLengthTranslator(),
- createPrecisionTranslator(),
- createScaleTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueTranslator() {
- return new BooleanTranslator(UNIQUE, ORM_PKG.getXmlAbstractColumn_Unique(), DOM_ATTRIBUTE);
- }
-
- private Translator createNullableTranslator() {
- return new BooleanTranslator(NULLABLE, ORM_PKG.getXmlAbstractColumn_Nullable(), DOM_ATTRIBUTE);
- }
-
- private Translator createInsertableTranslator() {
- return new BooleanTranslator(INSERTABLE, ORM_PKG.getXmlAbstractColumn_Insertable(), DOM_ATTRIBUTE);
- }
-
- private Translator createUpdatableTranslator() {
- return new BooleanTranslator(UPDATABLE, ORM_PKG.getXmlAbstractColumn_Updatable(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlAbstractColumn_Table(), DOM_ATTRIBUTE);
- }
-
- private Translator createLengthTranslator() {
- return new Translator(LENGTH, ORM_PKG.getXmlColumn_Length(), DOM_ATTRIBUTE);
- }
-
- private Translator createPrecisionTranslator() {
- return new Translator(PRECISION, ORM_PKG.getXmlColumn_Precision(), DOM_ATTRIBUTE);
- }
-
- private Translator createScaleTranslator() {
- return new Translator(SCALE, ORM_PKG.getXmlColumn_Scale(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java
deleted file mode 100644
index bd9bd82a3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/DiscriminatorColumnTranslator.java
+++ /dev/null
@@ -1,58 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class DiscriminatorColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public DiscriminatorColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createDiscrminiatorTypeTranslator(),
- createColumnDefinitionTranslator(),
- createLengthTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- protected Translator createDiscrminiatorTypeTranslator() {
- return new Translator(DISCRIMINATOR_TYPE, ORM_PKG.getXmlDiscriminatorColumn_DiscriminatorType(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- protected Translator createLengthTranslator() {
- return new Translator(LENGTH, ORM_PKG.getXmlDiscriminatorColumn_Length(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java
deleted file mode 100644
index 364de87a3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddableTranslator.java
+++ /dev/null
@@ -1,63 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createAttributesTranslator()
- };
- }
-
- private Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- private Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- private Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java
deleted file mode 100644
index 4e5a010f0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedIdTranslator.java
+++ /dev/null
@@ -1,56 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddedIdTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddedIdTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlEmbeddedIdImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createAttributeOverrideTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getXmlEmbeddedId_AttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java
deleted file mode 100644
index 93f61a1caf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmbeddedTranslator.java
+++ /dev/null
@@ -1,56 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EmbeddedTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EmbeddedTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlEmbeddedImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createAttributeOverrideTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getXmlEmbedded_AttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmptyTagBooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmptyTagBooleanTranslator.java
deleted file mode 100644
index b5fd85a4f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EmptyTagBooleanTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * This translator is to be used for empty xml tags that correspond
- * to a boolean attribute in the emf model.
- * cascade-persist is an example from the orm.xsd:
- *
- * <persistence-unit-defaults>
- * <cascade-persist/>
- * </persistence-unit-defaults> ==> cascadePersist == true
- *
- * vs.
- *
- * <persistence-unit-defaults>
- * </persistence-unit-defaults> ==> cascadePersist == false
- *
- */
-public class EmptyTagBooleanTranslator extends Translator
-{
- public EmptyTagBooleanTranslator(String domNameAndPath, EStructuralFeature feature) {
- super(domNameAndPath, feature, EMPTY_TAG | BOOLEAN_FEATURE);
- }
-
- public EmptyTagBooleanTranslator(String domNameAndPath, EStructuralFeature aFeature, int style) {
- super(domNameAndPath, aFeature, style | EMPTY_TAG | BOOLEAN_FEATURE);
- }
-
- @Override
- public Object getMOFValue(EObject mofObject) {
- // I am overriding this method. This is so the tag will be removed when
- // the value is false.
- // I'm not sure if this is a bug in the ecore or maybe in the translators,
- // but I really don't think that we should have to depend on the boolean
- // being "unset" to remove the tag.
- Boolean value = (Boolean) super.getMOFValue(mofObject);
- return (value == Boolean.TRUE) ? value : null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java
deleted file mode 100644
index 6152eb2dde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenerTranslator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityListenerTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityListenerTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createClassTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator()
- };
- }
-
- private Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getEntityListener_ClassName());
- }
-
- private Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getEntityListener_PrePersist());
- }
-
- private Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getEntityListener_PostPersist());
- }
-
- private Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getEntityListener_PreRemove());
- }
-
- private Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getEntityListener_PostRemove());
- }
-
- private Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getEntityListener_PreUpdate());
- }
-
- private Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getEntityListener_PostUpdate());
- }
-
- private Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getEntityListener_PostLoad());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java
deleted file mode 100644
index 9ba02f5efc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityListenersTranslator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityListenersTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityListenersTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createEntityListenerTranslator()
- };
- }
-
- private Translator createEntityListenerTranslator() {
- return new EntityListenerTranslator(ENTITY_LISTENER, ORM_PKG.getEntityListeners_EntityListeners());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java
deleted file mode 100644
index 17dbd864ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityMappingsTranslator.java
+++ /dev/null
@@ -1,120 +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.internal.resource.orm.translators;
-
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityMappingsTranslator extends RootTranslator
- implements OrmXmlMapper
-{
- public static EntityMappingsTranslator INSTANCE = new EntityMappingsTranslator();
-
-
- private Translator[] children;
-
-
- public EntityMappingsTranslator() {
- super(ENTITY_MAPPINGS, ORM_PKG.getXmlEntityMappings());
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- new ConstantAttributeTranslator(XML_NS, PERSISTENCE_NS_URL),
- new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL),
- new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, PERSISTENCE_NS_URL + ' ' + ORM_SCHEMA_LOC_1_0),
- createVersionTranslator(),
- createDescriptionTranslator(),
- createPersistenceUnitMetadataTranslator(),
- createPackageTranslator(),
- createSchemaTranslator(),
- createCatalogTranslator(),
- createAccessTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createMappedSuperclassTranslator(),
- createEntityTranslator(),
- createEmbeddableTranslator()
- };
- }
-
- private Translator createVersionTranslator() {
- return new Translator(VERSION, ORM_PKG.getXmlEntityMappings_Version(), DOM_ATTRIBUTE);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getXmlEntityMappings_Description());
- }
-
- private Translator createPersistenceUnitMetadataTranslator() {
- return new PersistenceUnitMetadataTranslator(PERSISTENCE_UNIT_METADATA, ORM_PKG.getXmlEntityMappings_PersistenceUnitMetadata());
- }
-
- private Translator createPackageTranslator() {
- return new Translator(PACKAGE, ORM_PKG.getXmlEntityMappings_Package());
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlEntityMappings_Schema());
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlEntityMappings_Catalog());
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getXmlEntityMappings_Access());
- }
-
- private Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlEntityMappings_SequenceGenerators());
- }
-
- private Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlEntityMappings_TableGenerators());
- }
-
- private Translator createNamedQueryTranslator() {
- return new NamedQueryTranslator(NAMED_QUERY, ORM_PKG.getXmlEntityMappings_NamedQueries());
- }
-
- private Translator createNamedNativeQueryTranslator() {
- return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, ORM_PKG.getXmlEntityMappings_NamedNativeQueries());
- }
-
- private Translator createSqlResultSetMappingTranslator() {
- return new SqlResultSetMappingTranslator(SQL_RESULT_SET_MAPPING, ORM_PKG.getXmlEntityMappings_SqlResultSetMappings());
- }
-
- private Translator createMappedSuperclassTranslator() {
- return new MappedSuperclassTranslator(MAPPED_SUPERCLASS, ORM_PKG.getXmlEntityMappings_MappedSuperclasses());
- }
-
- private Translator createEntityTranslator() {
- return new EntityTranslator(ENTITY, ORM_PKG.getXmlEntityMappings_Entities());
- }
-
- private Translator createEmbeddableTranslator() {
- return new EmbeddableTranslator(EMBEDDABLE, ORM_PKG.getXmlEntityMappings_Embeddables());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java
deleted file mode 100644
index b09a1965f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityResultTranslator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createEntityClassTranslator(),
- createDiscriminatorColumnTranslator(),
- createFieldResultTranslator()
- };
- }
-
- private Translator createEntityClassTranslator() {
- return new Translator(ENTITY_CLASS, ORM_PKG.getEntityResult_EntityClass(), DOM_ATTRIBUTE);
- }
-
- private Translator createDiscriminatorColumnTranslator() {
- return new Translator(DISCRIMINATOR_COLUMN, ORM_PKG.getEntityResult_DiscriminatorColumn(), DOM_ATTRIBUTE);
- }
-
- private Translator createFieldResultTranslator() {
- return new FieldResultTranslator(FIELD_RESULT, ORM_PKG.getEntityResult_FieldResults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java
deleted file mode 100644
index c3e5479e65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EntityTranslator.java
+++ /dev/null
@@ -1,188 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EntityTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EntityTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createTableTranslator(),
- createSecondaryTableTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createIdClassTranslator(),
- createInheritanceTranslator(),
- createDiscriminatorValueTranslator(),
- createDiscriminatorColumnTranslator(),
- createSequenceGeneratorTranslator(),
- createTableGeneratorTranslator(),
- createNamedQueryTranslator(),
- createNamedNativeQueryTranslator(),
- createSqlResultSetMappingTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributeOverrideTranslator(),
- createAssociationOverrideTranslator(),
- createAttributesTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlEntity_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- private Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- private Translator createTableTranslator() {
- return new TableTranslator(TABLE, ORM_PKG.getXmlEntity_Table());
- }
-
- private Translator createSecondaryTableTranslator() {
- return new SecondaryTableTranslator(SECONDARY_TABLE, ORM_PKG.getXmlEntity_SecondaryTables());
- }
-
- private Translator createPrimaryKeyJoinColumnTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlEntity_PrimaryKeyJoinColumns());
- }
-
- private Translator createIdClassTranslator() {
- return new IdClassTranslator(ID_CLASS, ORM_PKG.getXmlEntity_IdClass());
- }
-
- private Translator createInheritanceTranslator() {
- return new InheritanceTranslator(INHERITANCE, ORM_PKG.getXmlEntity_Inheritance());
- }
-
- private Translator createDiscriminatorValueTranslator() {
- return new Translator(DISCRIMINATOR_VALUE, ORM_PKG.getXmlEntity_DiscriminatorValue());
- }
-
- private Translator createDiscriminatorColumnTranslator() {
- return new DiscriminatorColumnTranslator(DISCRIMINATOR_COLUMN, ORM_PKG.getXmlEntity_DiscriminatorColumn());
- }
-
- private Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlEntity_SequenceGenerator());
- }
-
- private Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlEntity_TableGenerator());
- }
-
- private Translator createNamedQueryTranslator() {
- return new NamedQueryTranslator(NAMED_QUERY, ORM_PKG.getXmlEntity_NamedQueries());
- }
-
- private Translator createNamedNativeQueryTranslator() {
- return new NamedNativeQueryTranslator(NAMED_NATIVE_QUERY, ORM_PKG.getXmlEntity_NamedNativeQueries());
- }
-
- private Translator createSqlResultSetMappingTranslator() {
- return new SqlResultSetMappingTranslator(SQL_RESULT_SET_MAPPING, ORM_PKG.getXmlEntity_SqlResultSetMappings());
- }
-
- private Translator createExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_DEFAULT_LISTENERS, ORM_PKG.getXmlEntity_ExcludeDefaultListeners());
- }
-
- private Translator createExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_SUPERCLASS_LISTENERS, ORM_PKG.getXmlEntity_ExcludeSuperclassListeners());
- }
-
- private Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlEntity_EntityListeners());
- }
-
- private Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getXmlEntity_PrePersist());
- }
-
- private Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getXmlEntity_PostPersist());
- }
-
- private Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getXmlEntity_PreRemove());
- }
-
- private Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getXmlEntity_PostRemove());
- }
-
- private Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getXmlEntity_PreUpdate());
- }
-
- private Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getXmlEntity_PostUpdate());
- }
-
- private Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getXmlEntity_PostLoad());
- }
-
- private Translator createAttributeOverrideTranslator() {
- return new AttributeOverrideTranslator(ATTRIBUTE_OVERRIDE, ORM_PKG.getXmlEntity_AttributeOverrides());
- }
-
- private Translator createAssociationOverrideTranslator() {
- return new AssociationOverrideTranslator(ASSOCIATION_OVERRIDE, ORM_PKG.getXmlEntity_AssociationOverrides());
- }
-
- private Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java
deleted file mode 100644
index e0158d1a0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/EventMethodTranslator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class EventMethodTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public EventMethodTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createMethodNameTranslator()
- };
- }
-
- private Translator createMethodNameTranslator() {
- return new Translator(METHOD_NAME, ORM_PKG.getEventMethod_MethodName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java
deleted file mode 100644
index 0c2ac780ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/FieldResultTranslator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class FieldResultTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public FieldResultTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createColumnTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getFieldResult_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new Translator(COLUMN, ORM_PKG.getFieldResult_Column(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java
deleted file mode 100644
index 4b2f7d013b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/GeneratedValueTranslator.java
+++ /dev/null
@@ -1,55 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class GeneratedValueTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public GeneratedValueTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlGeneratedValueImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createStrategyTranslator(),
- createGeneratorTranslator()
- };
- }
-
- protected Translator createStrategyTranslator() {
- return new Translator(STRATEGY, ORM_PKG.getXmlGeneratedValue_Strategy(), DOM_ATTRIBUTE);
- }
-
- protected Translator createGeneratorTranslator() {
- return new Translator(GENERATOR, ORM_PKG.getXmlGeneratedValue_Generator(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.java
deleted file mode 100644
index 81b2ba5703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdClassTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class IdClassTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public IdClassTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createClassTranslator()
- };
- }
-
- protected Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getIdClass_ClassName(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.java
deleted file mode 100644
index fe75f9b394..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/IdTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class IdTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public IdTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlIdImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createColumnTranslator(),
- createGeneratedValueTranslator(),
- createTemporalTranslator(),
- createTableGeneratorTranslator(),
- createSequenceGeneratorTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- private Translator createGeneratedValueTranslator() {
- return new GeneratedValueTranslator(GENERATED_VALUE, ORM_PKG.getXmlId_GeneratedValue());
- }
-
- private Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlId_Temporal());
- }
-
- private Translator createTableGeneratorTranslator() {
- return new TableGeneratorTranslator(TABLE_GENERATOR, ORM_PKG.getXmlId_TableGenerator());
- }
-
- private Translator createSequenceGeneratorTranslator() {
- return new SequenceGeneratorTranslator(SEQUENCE_GENERATOR, ORM_PKG.getXmlId_SequenceGenerator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java
deleted file mode 100644
index 8868e8bc88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/InheritanceTranslator.java
+++ /dev/null
@@ -1,41 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class InheritanceTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public InheritanceTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- createStrategyTranslator(),
- };
- }
-
- private Translator createStrategyTranslator() {
- return new Translator(STRATEGY, ORM_PKG.getInheritance_Strategy(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java
deleted file mode 100644
index dbb0429bee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinColumnTranslator.java
+++ /dev/null
@@ -1,87 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JoinColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public JoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlJoinColumnImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createReferencedColumnNameTranslator(),
- createUniqueTranslator(),
- createNullableTranslator(),
- createInsertableTranslator(),
- createUpdatableTranslator(),
- createColumnDefinitionTranslator(),
- createTableTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createReferencedColumnNameTranslator() {
- return new Translator(REFERENCED_COLUMN_NAME, ORM_PKG.getXmlJoinColumn_ReferencedColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueTranslator() {
- return new BooleanTranslator(UNIQUE, ORM_PKG.getXmlAbstractColumn_Unique(), DOM_ATTRIBUTE);
- }
-
- private Translator createNullableTranslator() {
- return new BooleanTranslator(NULLABLE, ORM_PKG.getXmlAbstractColumn_Nullable(), DOM_ATTRIBUTE);
- }
-
- private Translator createInsertableTranslator() {
- return new BooleanTranslator(INSERTABLE, ORM_PKG.getXmlAbstractColumn_Insertable(), DOM_ATTRIBUTE);
- }
-
- private Translator createUpdatableTranslator() {
- return new BooleanTranslator(UPDATABLE, ORM_PKG.getXmlAbstractColumn_Updatable(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlAbstractColumn_Table(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java
deleted file mode 100644
index 9c0fcd7a55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/JoinTableTranslator.java
+++ /dev/null
@@ -1,75 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JoinTableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public JoinTableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlJoinTableImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createJoinColumnTranslator(),
- createInverseJoinColumnTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlJoinTable_JoinColumns());
- }
-
- private Translator createInverseJoinColumnTranslator() {
- return new JoinColumnTranslator(INVERSE_JOIN_COLUMN, ORM_PKG.getXmlJoinTable_InverseJoinColumns());
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java
deleted file mode 100644
index 14bfff8079..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToManyTranslator.java
+++ /dev/null
@@ -1,85 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ManyToManyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ManyToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlManyToManyImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- private Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- private Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlMultiRelationshipMapping_MappedBy(), DOM_ATTRIBUTE);
- }
-
- private Translator createOrderByTranslator() {
- return new Translator(ORDER_BY, ORM_PKG.getXmlMultiRelationshipMapping_OrderBy());
- }
-
- private Translator createMapKeyTranslator() {
- return new MapKeyTranslator(MAP_KEY, ORM_PKG.getXmlMultiRelationshipMapping_MapKey());
- }
-
- private Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- private Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.java
deleted file mode 100644
index d25d5f7e80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/ManyToOneTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class ManyToOneTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public ManyToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlManyToOneImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- private Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- private Translator createOptionalTranslator() {
- return new Translator(OPTIONAL, ORM_PKG.getXmlSingleRelationshipMapping_Optional(), DOM_ATTRIBUTE);
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlSingleRelationshipMapping_JoinColumns());
- }
-
- private Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- private Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.java
deleted file mode 100644
index cc5aaef63a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MapKeyTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-public class MapKeyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public MapKeyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator()
- };
- }
-
- protected Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getMapKey_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java
deleted file mode 100644
index f444e89b03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/MappedSuperclassTranslator.java
+++ /dev/null
@@ -1,118 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class MappedSuperclassTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public MappedSuperclassTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createClassTranslator(),
- createAccessTranslator(),
- createMetadataCompleteTranslator(),
- createDescriptionTranslator(),
- createIdClassTranslator(),
- createExcludeDefaultListenersTranslator(),
- createExcludeSuperclassListenersTranslator(),
- createEntityListenersTranslator(),
- createPrePersistTranslator(),
- createPostPersistTranslator(),
- createPreRemoveTranslator(),
- createPostRemoveTranslator(),
- createPreUpdateTranslator(),
- createPostUpdateTranslator(),
- createPostLoadTranslator(),
- createAttributesTranslator()
- };
- }
-
- private Translator createClassTranslator() {
- return new Translator(CLASS, ORM_PKG.getAbstractXmlTypeMapping_ClassName(), DOM_ATTRIBUTE);
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getAbstractXmlTypeMapping_Access(), DOM_ATTRIBUTE);
- }
-
- private Translator createMetadataCompleteTranslator() {
- return new Translator(METADATA_COMPLETE, ORM_PKG.getAbstractXmlTypeMapping_MetadataComplete(), DOM_ATTRIBUTE);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, ORM_PKG.getAbstractXmlTypeMapping_Description());
- }
-
- private Translator createIdClassTranslator() {
- return new IdClassTranslator(ID_CLASS, ORM_PKG.getXmlMappedSuperclass_IdClass());
- }
-
- private Translator createExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_DEFAULT_LISTENERS, ORM_PKG.getXmlMappedSuperclass_ExcludeDefaultListeners());
- }
-
- private Translator createExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(EXCLUDE_SUPERCLASS_LISTENERS, ORM_PKG.getXmlMappedSuperclass_ExcludeSuperclassListeners());
- }
-
- private Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlMappedSuperclass_EntityListeners());
- }
-
- private Translator createPrePersistTranslator() {
- return new EventMethodTranslator(PRE_PERSIST, ORM_PKG.getXmlMappedSuperclass_PrePersist());
- }
-
- private Translator createPostPersistTranslator() {
- return new EventMethodTranslator(POST_PERSIST, ORM_PKG.getXmlMappedSuperclass_PostPersist());
- }
-
- private Translator createPreRemoveTranslator() {
- return new EventMethodTranslator(PRE_REMOVE, ORM_PKG.getXmlMappedSuperclass_PreRemove());
- }
-
- private Translator createPostRemoveTranslator() {
- return new EventMethodTranslator(POST_REMOVE, ORM_PKG.getXmlMappedSuperclass_PostRemove());
- }
-
- private Translator createPreUpdateTranslator() {
- return new EventMethodTranslator(PRE_UPDATE, ORM_PKG.getXmlMappedSuperclass_PreUpdate());
- }
-
- private Translator createPostUpdateTranslator() {
- return new EventMethodTranslator(POST_UPDATE, ORM_PKG.getXmlMappedSuperclass_PostUpdate());
- }
-
- private Translator createPostLoadTranslator() {
- return new EventMethodTranslator(POST_LOAD, ORM_PKG.getXmlMappedSuperclass_PostLoad());
- }
-
- private Translator createAttributesTranslator() {
- return new AttributesTranslator(ATTRIBUTES, ORM_PKG.getAbstractXmlTypeMapping_Attributes());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java
deleted file mode 100644
index 83cfe82083..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedNativeQueryTranslator.java
+++ /dev/null
@@ -1,63 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class NamedNativeQueryTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public NamedNativeQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createResultClassTranslator(),
- createResultSetMappingTranslator(),
- createQueryTranslator(),
- createHintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQuery_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createResultClassTranslator() {
- return new Translator(RESULT_CLASS, ORM_PKG.getXmlNamedNativeQuery_ResultClass(), DOM_ATTRIBUTE);
- }
-
- private Translator createResultSetMappingTranslator() {
- return new Translator(RESULT_SET_MAPPING, ORM_PKG.getXmlNamedNativeQuery_ResultSetMapping(), DOM_ATTRIBUTE);
- }
-
- private Translator createQueryTranslator() {
- return new Translator(QUERY, ORM_PKG.getXmlQuery_Query());
- }
-
- private Translator createHintTranslator() {
- return new QueryHintTranslator(HINT, ORM_PKG.getXmlQuery_Hints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.java
deleted file mode 100644
index cdbf4f0f1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/NamedQueryTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class NamedQueryTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public NamedQueryTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createQueryTranslator(),
- createHintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQuery_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createQueryTranslator() {
- return new Translator(QUERY, ORM_PKG.getXmlQuery_Query());
- }
-
- private Translator createHintTranslator() {
- return new QueryHintTranslator(HINT, ORM_PKG.getXmlQuery_Hints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.java
deleted file mode 100644
index 2a1666bfba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToManyTranslator.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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class OneToManyTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public OneToManyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlOneToManyImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createMappedByTranslator(),
- createOrderByTranslator(),
- createMapKeyTranslator(),
- createJoinTableTranslator(),
- createJoinColumnTranslator(),
- createCascadeTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- private Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- private Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlMultiRelationshipMapping_MappedBy(), DOM_ATTRIBUTE);
- }
-
- private Translator createOrderByTranslator() {
- return new Translator(ORDER_BY, ORM_PKG.getXmlMultiRelationshipMapping_OrderBy());
- }
-
- private Translator createMapKeyTranslator() {
- return new MapKeyTranslator(MAP_KEY, ORM_PKG.getXmlMultiRelationshipMapping_MapKey());
- }
-
- private Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlOneToMany_JoinColumns());
- }
-
- private Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java
deleted file mode 100644
index 8c9d064447..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OneToOneTranslator.java
+++ /dev/null
@@ -1,92 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class OneToOneTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public OneToOneTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlOneToOneImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTargetEntityTranslator(),
- createFetchTranslator(),
- createOptionalTranslator(),
- createMappedByTranslator(),
- createPrimaryKeyJoinColumnTranslator(),
- createJoinColumnTranslator(),
- createJoinTableTranslator(),
- createCascadeTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTargetEntityTranslator() {
- return new Translator(TARGET_ENTITY, ORM_PKG.getXmlRelationshipMapping_TargetEntity(), DOM_ATTRIBUTE);
- }
-
- private Translator createFetchTranslator() {
- return new Translator(FETCH, ORM_PKG.getXmlRelationshipMapping_Fetch(), DOM_ATTRIBUTE);
- }
-
- private Translator createOptionalTranslator() {
- return new Translator(OPTIONAL, ORM_PKG.getXmlSingleRelationshipMapping_Optional(), DOM_ATTRIBUTE);
- }
-
- private Translator createMappedByTranslator() {
- return new Translator(MAPPED_BY, ORM_PKG.getXmlOneToOne_MappedBy(), DOM_ATTRIBUTE);
- }
-
- private Translator createPrimaryKeyJoinColumnTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlOneToOne_PrimaryKeyJoinColumns());
- }
-
- private Translator createJoinColumnTranslator() {
- return new JoinColumnTranslator(JOIN_COLUMN, ORM_PKG.getXmlSingleRelationshipMapping_JoinColumns());
- }
-
- private Translator createJoinTableTranslator() {
- return new JoinTableTranslator(JOIN_TABLE, ORM_PKG.getXmlRelationshipMapping_JoinTable());
- }
-
- private Translator createCascadeTranslator() {
- return new CascadeTypeTranslator(CASCADE, ORM_PKG.getXmlRelationshipMapping_Cascade());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java
deleted file mode 100644
index aa74a96d3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/OrmXmlMapper.java
+++ /dev/null
@@ -1,126 +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.internal.resource.orm.translators;
-
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-
-public interface OrmXmlMapper
-{
- OrmPackage ORM_PKG = OrmPackage.eINSTANCE;
-
- String XML_NS = "xmlns"; //$NON-NLS-1$
- String XML_NS_XSI = "xmlns:xsi"; //$NON-NLS-1$
- String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$
- String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- String PERSISTENCE_NS_URL = "http://java.sun.com/xml/ns/persistence/orm"; //$NON-NLS-1$
- String ORM_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"; //$NON-NLS-1$
-
-
- String ACCESS = "access"; //$NON-NLS-1$
- String ALLOCATION_SIZE = "allocation-size"; //$NON-NLS-1$
- String ASSOCIATION_OVERRIDE = "association-override"; //$NON-NLS-1$
- String ATTRIBUTE_OVERRIDE = "attribute-override"; //$NON-NLS-1$
- String ATTRIBUTES = "attributes"; //$NON-NLS-1$
- String BASIC = "basic"; //$NON-NLS-1$
- String CASCADE = "cascade"; //$NON-NLS-1$
- String CASCADE_ALL = "cascade-all"; //$NON-NLS-1$
- String CASCADE_MERGE = "cascade-merge"; //$NON-NLS-1$
- String CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$
- String CASCADE_REFRESH = "cascade-refresh"; //$NON-NLS-1$
- String CASCADE_REMOVE = "cascade-remove"; //$NON-NLS-1$
- String CATALOG = "catalog"; //$NON-NLS-1$
- String CLASS = "class"; //$NON-NLS-1$
- String COLUMN = "column"; //$NON-NLS-1$
- String COLUMN_DEFINITION= "column-definition"; //$NON-NLS-1$
- String COLUMN_NAME = "column-name"; //$NON-NLS-1$
- String COLUMN_RESULT = "column-result"; //$NON-NLS-1$
- String DESCRIPTION = "description"; //$NON-NLS-1$
- String DISCRIMINATOR_COLUMN = "discriminator-column"; //$NON-NLS-1$
- String DISCRIMINATOR_TYPE = "discriminator-type"; //$NON-NLS-1$
- String DISCRIMINATOR_VALUE = "discriminator-value"; //$NON-NLS-1$
- String EMBEDDABLE = "embeddable"; //$NON-NLS-1$
- String EMBEDDED = "embedded"; //$NON-NLS-1$
- String EMBEDDED_ID = "embedded-id"; //$NON-NLS-1$
- String ENTITY = "entity"; //$NON-NLS-1$
- String ENTITY_CLASS = "entity-class"; //$NON-NLS-1$
- String ENTITY_LISTENER = "entity-listener"; //$NON-NLS-1$
- String ENTITY_LISTENERS = "entity-listeners"; //$NON-NLS-1$
- String ENTITY_MAPPINGS = "entity-mappings"; //$NON-NLS-1$
- String ENTITY_RESULT = "entity-result"; //$NON-NLS-1$
- String ENUMERATED = "enumerated"; //$NON-NLS-1$
- String EXCLUDE_DEFAULT_LISTENERS = "exclude-default-listeners"; //$NON-NLS-1$
- String EXCLUDE_SUPERCLASS_LISTENERS = "exclude-superclass-listeners"; //$NON-NLS-1$
- String FETCH = "fetch"; //$NON-NLS-1$
- String FIELD_RESULT = "field-result"; //$NON-NLS-1$
- String GENERATED_VALUE = "generated-value"; //$NON-NLS-1$
- String GENERATOR = "generator"; //$NON-NLS-1$
- String HINT = "hint"; //$NON-NLS-1$
- String ID = "id"; //$NON-NLS-1$
- String ID_CLASS = "id-class"; //$NON-NLS-1$
- String INHERITANCE = "inheritance"; //$NON-NLS-1$
- String INITIAL_VALUE = "initial-value"; //$NON-NLS-1$
- String INSERTABLE = "insertable"; //$NON-NLS-1$
- String INVERSE_JOIN_COLUMN = "inverse-join-column"; //$NON-NLS-1$
- String JOIN_COLUMN = "join-column"; //$NON-NLS-1$
- String JOIN_TABLE = "join-table"; //$NON-NLS-1$
- String LENGTH = "length"; //$NON-NLS-1$
- String LOB = "lob"; //$NON-NLS-1$
- String MANY_TO_MANY = "many-to-many"; //$NON-NLS-1$
- String MANY_TO_ONE = "many-to-one"; //$NON-NLS-1$
- String MAP_KEY = "map-key"; //$NON-NLS-1$
- String MAPPED_BY = "mapped-by"; //$NON-NLS-1$
- String MAPPED_SUPERCLASS = "mapped-superclass"; //$NON-NLS-1$
- String METADATA_COMPLETE = "metadata-complete"; //$NON-NLS-1$
- String METHOD_NAME = "method-name"; //$NON-NLS-1$
- String NAME = "name"; //$NON-NLS-1$
- String NAMED_NATIVE_QUERY = "named-native-query"; //$NON-NLS-1$
- String NAMED_QUERY = "named-query"; //$NON-NLS-1$
- String NULLABLE = "nullable"; //$NON-NLS-1$
- String ONE_TO_MANY = "one-to-many"; //$NON-NLS-1$
- String ONE_TO_ONE = "one-to-one"; //$NON-NLS-1$
- String OPTIONAL = "optional"; //$NON-NLS-1$
- String ORDER_BY = "order-by"; //$NON-NLS-1$
- String PACKAGE = "package"; //$NON-NLS-1$
- String PERSISTENCE_UNIT_DEFAULTS = "persistence-unit-defaults"; //$NON-NLS-1$
- String PERSISTENCE_UNIT_METADATA = "persistence-unit-metadata"; //$NON-NLS-1$
- String PK_COLUMN_NAME = "pk-column-name"; //$NON-NLS-1$
- String PK_COLUMN_VALUE = "pk-column-value"; //$NON-NLS-1$
- String POST_LOAD = "post-load"; //$NON-NLS-1$
- String POST_PERSIST = "post-persist"; //$NON-NLS-1$
- String POST_REMOVE = "post-remove"; //$NON-NLS-1$
- String POST_UPDATE = "post-update"; //$NON-NLS-1$
- String PRE_PERSIST = "pre-persist"; //$NON-NLS-1$
- String PRE_REMOVE = "pre-remove"; //$NON-NLS-1$
- String PRE_UPDATE = "pre-update"; //$NON-NLS-1$
- String PRECISION= "precision"; //$NON-NLS-1$
- String PRIMARY_KEY_JOIN_COLUMN = "primary-key-join-column"; //$NON-NLS-1$
- String QUERY = "query"; //$NON-NLS-1$
- String REFERENCED_COLUMN_NAME = "referenced-column-name"; //$NON-NLS-1$
- String RESULT_CLASS = "result-class"; //$NON-NLS-1$
- String RESULT_SET_MAPPING = "result-set-mapping"; //$NON-NLS-1$
- String SCALE= "scale"; //$NON-NLS-1$
- String SCHEMA = "schema"; //$NON-NLS-1$
- String SECONDARY_TABLE = "secondary-table"; //$NON-NLS-1$
- String SEQUENCE_GENERATOR = "sequence-generator"; //$NON-NLS-1$
- String SEQUENCE_NAME = "sequence-name"; //$NON-NLS-1$
- String SQL_RESULT_SET_MAPPING = "sql-result-set-mapping"; //$NON-NLS-1$
- String STRATEGY = "strategy"; //$NON-NLS-1$
- String TABLE = "table"; //$NON-NLS-1$
- String TABLE_GENERATOR = "table-generator"; //$NON-NLS-1$
- String TARGET_ENTITY = "target-entity"; //$NON-NLS-1$
- String TEMPORAL = "temporal"; //$NON-NLS-1$
- String TRANSIENT = "transient"; //$NON-NLS-1$
- String UNIQUE = "unique"; //$NON-NLS-1$
- String UNIQUE_CONSTRAINT = "unique-constraint"; //$NON-NLS-1$
- String UPDATABLE = "updatable"; //$NON-NLS-1$
- String VALUE = "value"; //$NON-NLS-1$
- String VALUE_COLUMN_NAME = "value-column-name"; //$NON-NLS-1$
- String VERSION = "version"; //$NON-NLS-1$
- String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.java
deleted file mode 100644
index 3889e96bc2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitDefaultsTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitDefaultsTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitDefaultsTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createSchemaTranslator(),
- createCatalogTranslator(),
- createAccessTranslator(),
- createCascadePersistTranslator(),
- createEntityListenersTranslator()
- };
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlPersistenceUnitDefaults_Schema());
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlPersistenceUnitDefaults_Catalog());
- }
-
- private Translator createAccessTranslator() {
- return new Translator(ACCESS, ORM_PKG.getXmlPersistenceUnitDefaults_Access());
- }
-
- private Translator createCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(CASCADE_PERSIST, ORM_PKG.getXmlPersistenceUnitDefaults_CascadePersist());
- }
-
- private Translator createEntityListenersTranslator() {
- return new EntityListenersTranslator(ENTITY_LISTENERS, ORM_PKG.getXmlPersistenceUnitDefaults_EntityListeners());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.java
deleted file mode 100644
index 538f96573f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PersistenceUnitMetadataTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitMetadataTranslator extends Translator implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitMetadataTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- private Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createXmlMappingMetadataCompleteTranslator(),
- createPersistenceUnitDefaultsTranslator(),
- };
- }
-
- private Translator createXmlMappingMetadataCompleteTranslator() {
- return new EmptyTagBooleanTranslator(XML_MAPPING_METADATA_COMPLETE, ORM_PKG.getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete());
- }
-
- private Translator createPersistenceUnitDefaultsTranslator() {
- return new PersistenceUnitDefaultsTranslator(PERSISTENCE_UNIT_DEFAULTS, ORM_PKG.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java
deleted file mode 100644
index 236324d307..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/PrimaryKeyJoinColumnTranslator.java
+++ /dev/null
@@ -1,54 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PrimaryKeyJoinColumnTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public PrimaryKeyJoinColumnTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createReferencedColumnNameTranslator(),
- createColumnDefinitionTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlNamedColumn_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createReferencedColumnNameTranslator() {
- return new Translator(REFERENCED_COLUMN_NAME, ORM_PKG.getXmlPrimaryKeyJoinColumn_ReferencedColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnDefinitionTranslator() {
- return new Translator(COLUMN_DEFINITION, ORM_PKG.getXmlNamedColumn_ColumnDefinition(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java
deleted file mode 100644
index 09aa17523b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/QueryHintTranslator.java
+++ /dev/null
@@ -1,48 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class QueryHintTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public QueryHintTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createValueTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlQueryHint_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueTranslator() {
- return new Translator(VALUE, ORM_PKG.getXmlQueryHint_Value(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.java
deleted file mode 100644
index 67ab1bcf1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SecondaryTableTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SecondaryTableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SecondaryTableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlSecondaryTableImpl();
- }
-
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createPrimaryKeyJoinColumnsTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- protected Translator createPrimaryKeyJoinColumnsTranslator() {
- return new PrimaryKeyJoinColumnTranslator(PRIMARY_KEY_JOIN_COLUMN, ORM_PKG.getXmlSecondaryTable_PrimaryKeyJoinColumns());
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java
deleted file mode 100644
index 29d40efe3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SequenceGeneratorTranslator.java
+++ /dev/null
@@ -1,65 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SequenceGeneratorTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SequenceGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createSequenceNameTranslator(),
- createInitialValueTranslator(),
- createAllocationSizeTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlGenerator_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createSequenceNameTranslator() {
- return new Translator(SEQUENCE_NAME, ORM_PKG.getXmlSequenceGenerator_SequenceName(), DOM_ATTRIBUTE);
- }
-
- private Translator createInitialValueTranslator() {
- return new Translator(INITIAL_VALUE, ORM_PKG.getXmlGenerator_InitialValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createAllocationSizeTranslator() {
- return new Translator(ALLOCATION_SIZE, ORM_PKG.getXmlGenerator_AllocationSize(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java
deleted file mode 100644
index 916225227b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/SqlResultSetMappingTranslator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class SqlResultSetMappingTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public SqlResultSetMappingTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createEntityResultTranslator(),
- createColumnResultTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getSqlResultSetMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createEntityResultTranslator() {
- return new EntityResultTranslator(ENTITY_RESULT, ORM_PKG.getSqlResultSetMapping_EntityResults());
- }
-
- private Translator createColumnResultTranslator() {
- return new ColumnResultTranslator(COLUMN_RESULT, ORM_PKG.getSqlResultSetMapping_ColumnResults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java
deleted file mode 100644
index 6c0b45b0fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableGeneratorTranslator.java
+++ /dev/null
@@ -1,95 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TableGeneratorTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TableGeneratorTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlTableGeneratorImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTableTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createPkColumnNameTranslator(),
- createValueColumnNameTranslator(),
- createPkColumnValueTranslator(),
- createInitialValueTranslator(),
- createAllocationSizeTranslator(),
- createUniqueConstraintTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlGenerator_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTableTranslator() {
- return new Translator(TABLE, ORM_PKG.getXmlTableGenerator_Table(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlTableGenerator_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlTableGenerator_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createPkColumnNameTranslator() {
- return new Translator(PK_COLUMN_NAME, ORM_PKG.getXmlTableGenerator_PkColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueColumnNameTranslator() {
- return new Translator(VALUE_COLUMN_NAME, ORM_PKG.getXmlTableGenerator_ValueColumnName(), DOM_ATTRIBUTE);
- }
-
- private Translator createPkColumnValueTranslator() {
- return new Translator(PK_COLUMN_VALUE, ORM_PKG.getXmlTableGenerator_PkColumnValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createInitialValueTranslator() {
- return new Translator(INITIAL_VALUE, ORM_PKG.getXmlGenerator_InitialValue(), DOM_ATTRIBUTE);
- }
-
- private Translator createAllocationSizeTranslator() {
- return new Translator(ALLOCATION_SIZE, ORM_PKG.getXmlGenerator_AllocationSize(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlTableGenerator_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java
deleted file mode 100644
index 7fdebe51ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TableTranslator.java
+++ /dev/null
@@ -1,58 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TableTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TableTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createCatalogTranslator(),
- createSchemaTranslator(),
- createUniqueConstraintTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlBaseTable_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createCatalogTranslator() {
- return new Translator(CATALOG, ORM_PKG.getXmlBaseTable_Catalog(), DOM_ATTRIBUTE);
- }
-
- private Translator createSchemaTranslator() {
- return new Translator(SCHEMA, ORM_PKG.getXmlBaseTable_Schema(), DOM_ATTRIBUTE);
- }
-
- private Translator createUniqueConstraintTranslator() {
- return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, ORM_PKG.getXmlBaseTable_UniqueConstraints());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java
deleted file mode 100644
index 29fb14680e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/TransientTranslator.java
+++ /dev/null
@@ -1,51 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class TransientTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public TransientTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlTransientImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.java
deleted file mode 100644
index daf7e6d1dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/UniqueConstraintTranslator.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.core.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class UniqueConstraintTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public UniqueConstraintTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- creatColumnNameTranslator(),
- };
- }
-
- private Translator creatColumnNameTranslator() {
- return new Translator(COLUMN_NAME, ORM_PKG.getUniqueConstraint_ColumnNames());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java
deleted file mode 100644
index 9f5266808b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/translators/VersionTranslator.java
+++ /dev/null
@@ -1,61 +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.internal.resource.orm.translators;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class VersionTranslator extends Translator
- implements OrmXmlMapper
-{
- private Translator[] children;
-
-
- public VersionTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
- @Override
- public EObject createEMFObject(String nodeName, String readAheadName) {
- return OrmFactory.eINSTANCE.createXmlVersionImpl();
- }
-
- @Override
- public Translator[] getChildren(Object target, int versionID) {
- if (this.children == null) {
- this.children = createChildren();
- }
- return this.children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createColumnTranslator(),
- createTemporalTranslator(),
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, ORM_PKG.getXmlAttributeMapping_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createColumnTranslator() {
- return new ColumnTranslator(COLUMN, ORM_PKG.getColumnMapping_Column());
- }
-
- private Translator createTemporalTranslator() {
- return new Translator(TEMPORAL, ORM_PKG.getXmlVersion_Temporal());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.java
deleted file mode 100644
index 94f75c440f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/JavaClassRefTranslator.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.core.internal.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class JavaClassRefTranslator extends Translator
-{
- private static Translator[] children;
-
-
- public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature, int style) {
- super(domNameAndPath, feature, style);
- }
-
- public JavaClassRefTranslator(String domNameAndPath, EStructuralFeature feature) {
- super(domNameAndPath, feature);
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- private static Translator[] createChildren() {
- return new Translator[] {
- new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getXmlJavaClassRef_JavaClass())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.java
deleted file mode 100644
index f7fca54fd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/MappingFileTranslator.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.core.internal.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class MappingFileTranslator extends Translator
-{
- private Translator[] children;
-
-
- public MappingFileTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- new Translator(TEXT_ATTRIBUTE_VALUE, PersistencePackage.eINSTANCE.getXmlMappingFileRef_FileName())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.java
deleted file mode 100644
index 91c79d89b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceTranslator.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.core.internal.resource.persistence.translators;
-
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceTranslator extends RootTranslator
- implements PersistenceXmlMapper
-{
- public static PersistenceTranslator INSTANCE = new PersistenceTranslator();
-
- private Translator[] children;
-
-
- public PersistenceTranslator() {
- super(PERSISTENCE, PERSISTENCE_PKG.eINSTANCE.getXmlPersistence());
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createVersionTranslator(),
- new ConstantAttributeTranslator(XML_NS, PERSISTENCE_NS_URL),
- new ConstantAttributeTranslator(XML_NS_XSI, XSI_NS_URL),
- new ConstantAttributeTranslator(XSI_SCHEMA_LOCATION, PERSISTENCE_NS_URL + ' ' + PERSISTENCE_SCHEMA_LOC_1_0),
- createPersistenceUnitTranslator()
- };
- }
-
- private Translator createVersionTranslator() {
- return new Translator(VERSION, PERSISTENCE_PKG.getXmlPersistence_Version(), DOM_ATTRIBUTE);
- }
-
- private Translator createPersistenceUnitTranslator() {
- return new PersistenceUnitTranslator(PERSISTENCE_UNIT, PERSISTENCE_PKG.getXmlPersistence_PersistenceUnits());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java
deleted file mode 100644
index 67cecd6bf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceUnitTranslator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.resource.common.translators.BooleanTranslator;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PersistenceUnitTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PersistenceUnitTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createTransactionTypeTranslator(),
- createDescriptionTranslator(),
- createProviderTranslator(),
- createJtaDataSourceTranslator(),
- createNonJtaDataSourceTranslator(),
- createMappingFileTranslator(),
- createJarFileTranslator(),
- createClassTranslator(),
- createExcludeUnlistedClassesTranslator(),
- createPropertiesTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, PERSISTENCE_PKG.getXmlPersistenceUnit_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createTransactionTypeTranslator() {
- return new Translator(TRANSACTION_TYPE, PERSISTENCE_PKG.getXmlPersistenceUnit_TransactionType(), DOM_ATTRIBUTE | UNSET_IF_NULL);
- }
-
- private Translator createDescriptionTranslator() {
- return new Translator(DESCRIPTION, PERSISTENCE_PKG.getXmlPersistenceUnit_Description());
- }
-
- private Translator createProviderTranslator() {
- return new Translator(PROVIDER, PERSISTENCE_PKG.getXmlPersistenceUnit_Provider());
- }
-
- private Translator createJtaDataSourceTranslator() {
- return new Translator(JTA_DATA_SOURCE, PERSISTENCE_PKG.getXmlPersistenceUnit_JtaDataSource());
- }
-
- private Translator createNonJtaDataSourceTranslator() {
- return new Translator(NON_JTA_DATA_SOURCE, PERSISTENCE_PKG.getXmlPersistenceUnit_NonJtaDataSource());
- }
-
- private Translator createMappingFileTranslator() {
- return new MappingFileTranslator(MAPPING_FILE, PERSISTENCE_PKG.getXmlPersistenceUnit_MappingFiles());
- }
-
- private Translator createJarFileTranslator() {
- return new Translator(JAR_FILE, PERSISTENCE_PKG.getXmlPersistenceUnit_JarFiles());
- }
-
- private Translator createClassTranslator() {
- return new JavaClassRefTranslator(CLASS, PERSISTENCE_PKG.getXmlPersistenceUnit_Classes());
- }
-
- private Translator createExcludeUnlistedClassesTranslator() {
- return new BooleanTranslator(EXCLUDE_UNLISTED_CLASSES, PERSISTENCE_PKG.getXmlPersistenceUnit_ExcludeUnlistedClasses());
- }
-
- private Translator createPropertiesTranslator() {
- return new PropertiesTranslator(PROPERTIES, PERSISTENCE_PKG.getXmlPersistenceUnit_Properties());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.java
deleted file mode 100644
index dfc4186d4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PersistenceXmlMapper.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.core.internal.resource.persistence.translators;
-
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-
-public interface PersistenceXmlMapper
-{
- PersistencePackage PERSISTENCE_PKG = PersistencePackage.eINSTANCE;
-
- String XML_NS = "xmlns"; //$NON-NLS-1$
- String XML_NS_XSI = "xmlns:xsi"; //$NON-NLS-1$
- String XSI_SCHEMA_LOCATION = "xsi:schemaLocation"; //$NON-NLS-1$
- String XSI_NS_URL = "http://www.w3.org/2001/XMLSchema-instance"; //$NON-NLS-1$
- String PERSISTENCE_NS_URL = "http://java.sun.com/xml/ns/persistence"; //$NON-NLS-1$
- String PERSISTENCE_SCHEMA_LOC_1_0 = "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"; //$NON-NLS-1$
-
-
- String CLASS = "class"; //$NON-NLS-1$
- String DESCRIPTION = "description"; //$NON-NLS-1$
- String EXCLUDE_UNLISTED_CLASSES = "exclude-unlisted-classes"; //$NON-NLS-1$
- String JAR_FILE = "jar-file"; //$NON-NLS-1$
- String JTA_DATA_SOURCE = "jta-data-source"; //$NON-NLS-1$
- String MAPPING_FILE = "mapping-file"; //$NON-NLS-1$
- String NAME = "name"; //$NON-NLS-1$
- String NON_JTA_DATA_SOURCE = "non-jta-data-source"; //$NON-NLS-1$
- String PERSISTENCE = "persistence"; //$NON-NLS-1$
- String PERSISTENCE_UNIT = "persistence-unit"; //$NON-NLS-1$
- String PROPERTIES = "properties"; //$NON-NLS-1$
- String PROPERTY = "property"; //$NON-NLS-1$
- String PROVIDER = "provider"; //$NON-NLS-1$
- String TRANSACTION_TYPE = "transaction-type"; //$NON-NLS-1$
- String VALUE = "value"; //$NON-NLS-1$
- String VERSION = "version"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java
deleted file mode 100644
index b2a2383646..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertiesTranslator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PropertiesTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PropertiesTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature);
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createPropertyTranslator()
- };
- }
-
- private Translator createPropertyTranslator() {
- return new PropertyTranslator(PROPERTY, PERSISTENCE_PKG.getXmlProperties_Properties());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java
deleted file mode 100644
index 17d72d1c45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/translators/PropertyTranslator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.eclipse.jpt.core.internal.resource.persistence.translators;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-public class PropertyTranslator extends Translator
- implements PersistenceXmlMapper
-{
- private Translator[] children;
-
-
- public PropertyTranslator(String domNameAndPath, EStructuralFeature aFeature) {
- super(domNameAndPath, aFeature, END_TAG_NO_INDENT);
- }
-
-
- public Translator[] getChildren(Object target, int versionID) {
- if (children == null) {
- children = createChildren();
- }
- return children;
- }
-
- protected Translator[] createChildren() {
- return new Translator[] {
- IDTranslator.INSTANCE,
- createNameTranslator(),
- createValueTranslator()
- };
- }
-
- private Translator createNameTranslator() {
- return new Translator(NAME, PERSISTENCE_PKG.getXmlProperty_Name(), DOM_ATTRIBUTE);
- }
-
- private Translator createValueTranslator() {
- return new Translator(VALUE, PERSISTENCE_PKG.getXmlProperty_Value(), DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
deleted file mode 100644
index 11b2a0ddc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.synch;
-
-import java.io.IOException;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResource;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResourceModel;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-
-/**
- * Synchronizes the lists of persistent classes in a persistence unit and a
- * persistence project.
- */
-public class SynchronizeClassesJob extends Job
-{
- private IFile persistenceXmlFile;
-
-
- public SynchronizeClassesJob(IFile file) {
- super(JptCoreMessages.SYNCHRONIZE_CLASSES_JOB);
- setRule(file.getProject());
- this.persistenceXmlFile = file;
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- monitor.beginTask(JptCoreMessages.SYNCHRONIZING_CLASSES_TASK, 150);
-
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
-
- JpaFile jpaFile = JptCorePlugin.jpaFile(this.persistenceXmlFile);
- PersistenceResourceModel persistenceResourceModel = (PersistenceResourceModel) jpaFile.getResourceModel();
- PersistenceResource persistenceResource;
- try {
- persistenceResource = (PersistenceResource) persistenceResourceModel.resource();
- }
- catch (ClassCastException cce) {
- return new Status(IStatus.ERROR, JptCorePlugin.PLUGIN_ID, JptCoreMessages.INVALID_PERSISTENCE_XML_CONTENT);
- }
-
- XmlPersistence persistence = persistenceResource.getPersistence();
-
- if (persistence == null) {
- persistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- persistenceResource.getContents().add(persistence);
- }
-
- XmlPersistenceUnit persistenceUnitResource;
-
- if (persistence.getPersistenceUnits().size() > 0) {
- persistenceUnitResource = persistence.getPersistenceUnits().get(0);
- }
- else {
- persistenceUnitResource = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- persistenceUnitResource.setName(this.persistenceXmlFile.getProject().getName());
- persistence.getPersistenceUnits().add(persistenceUnitResource);
- }
-
- persistenceUnitResource.getClasses().clear();
- JpaProject jpaProject = jpaFile.jpaProject();
-
- //TODO njh - should be checking to see if the reference is necessary
- // ref is not necessary if defined in the XML, see commented code below
- for (Iterator<IType> stream = jpaProject.annotatedClasses(); stream.hasNext(); ) {
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(stream.next().getFullyQualifiedName());
- persistenceUnitResource.getClasses().add(classRef);
- }
-
- monitor.worked(50);
-
- try {
- persistenceResource.save(null);
- }
- catch (IOException ioe) {
- return new Status(IStatus.ERROR, JptCorePlugin.PLUGIN_ID, JptCoreMessages.ERROR_WRITING_FILE, ioe);
- }
-
- return Status.OK_STATUS;
- }
-}
-// private Iterator<String> sortedMappedTypeNames(XmlPersistenceUnit persistenceUnit) {
-// return CollectionTools.sort(this.mappedTypeNames(persistenceUnit));
-// }
-//
-// private Iterator<String> mappedTypeNames(XmlPersistenceUnit persistenceUnit) {
-// return new TransformationIterator<IPersistentType, String>(this.mappedTypes(persistenceUnit)) {
-// @Override
-// protected String transform(IPersistentType pType) {
-// return pType.resource().findJdtType().getFullyQualifiedName();
-// }
-// };
-// }
-//
-// private Iterator<IPersistentType> mappedTypes(XmlPersistenceUnit persistenceUnit) {
-// return new FilteringIterator<IPersistentType>(allJavaTypes(persistenceUnit.getJpaProject()), filter(persistenceUnit));
-// }
-//
-// private Iterator<IPersistentType> allJavaTypes(IJpaProject jpaProject) {
-// return new TransformationIterator<IJpaFile, IPersistentType>(jpaProject.jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE).iterator()) {
-// @Override
-// protected IPersistentType transform(IJpaFile next) {
-// JpaCompilationUnit jcu = (JpaCompilationUnit) next.getContent();
-// return (jcu.getTypes().isEmpty()) ? null : jcu.getTypes().get(0);
-// }
-// };
-// }
-//
-// private Filter<IPersistentType> filter(final XmlPersistenceUnit persistenceUnit) {
-// return new Filter<IPersistentType>() {
-// public boolean accept(IPersistentType o) {
-// if (o == null) {
-// return false;
-// }
-// if (o.getMappingKey() == IMappingKeys.NULL_TYPE_MAPPING_KEY) {
-// return false;
-// }
-// IType jdtType = o.findJdtType();
-// if (jdtType == null) {
-// return false;
-// }
-// for (XmlMappingFileRef mappingFileRef : persistenceUnit.getMappingFiles()) {
-// if (containsType(mappingFileRef, jdtType)) {
-// return false;
-// }
-// }
-// return true;
-// }
-// };
-// }
-//
-// private boolean containsType(XmlMappingFileRef mappingFileRef, IType jdtType) {
-// IJpaFile mappingFile = mappingFileRef.getMappingFile();
-// if (mappingFile == null) {
-// return false;
-// }
-//
-// XmlRootContentNode root;
-// try {
-// root = (XmlRootContentNode) mappingFile.getContent();
-// }
-// catch (ClassCastException cce) {
-// return false;
-// }
-//
-// EntityMappingsInternal entityMappings = root.getEntityMappings();
-//
-// if (entityMappings == null) {
-// return false;
-// }
-//
-// for (IPersistentType persistentType : entityMappings.getPersistentTypes()) {
-// IType otherJdtType = persistentType.findJdtType();
-// if (otherJdtType != null && otherJdtType.equals(jdtType)) {
-// return true;
-// }
-// }
-//
-// return false;
-// }
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java
deleted file mode 100644
index 52481b0785..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.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.core.internal.validation;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class DefaultJpaValidationMessages
- implements JpaValidationMessages
-{
- private static String[] DEFAULT_PARMS = new String[0];
-
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject) {
- return buildMessage(severity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, Object targetObject, TextRange textRange) {
- return buildMessage(severity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(
- int severity, String messageId, String[] parms, Object targetObject, TextRange textRange) {
- IMessage message = new Message(BUNDLE, severity, messageId, parms, targetObject);
- message.setLineNo(textRange.getLineNumber());
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- return message;
- }
-
-
- private DefaultJpaValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java
deleted file mode 100644
index 2544e99abf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java
+++ /dev/null
@@ -1,32 +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.internal.validation;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaNode;
-
-public class JpaHelper extends org.eclipse.wst.validation.internal.operations.WorkbenchContext {
-
- @Override
- public IResource getResource(Object obj) {
- return ((JpaNode) obj).resource();
- }
-
- /*
- * This is used when no line number is set. We generally use line numbers.
- * Therefore, when this is called, we will use the default location, i.e.
- * null.
- */
- @Override
- public String getLocation(Object object) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
deleted file mode 100644
index 4a62747165..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.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.core.internal.validation;
-
-public interface JpaValidationMessages
-{
- public static final String BUNDLE = "jpa_validation";
-
-
- public static final String PROJECT_NO_CONNECTION = "PROJECT_NO_CONNECTION";
-
- public static final String PROJECT_INACTIVE_CONNECTION = "PROJECT_INACTIVE_CONNECTION";
-
- public static final String PROJECT_NO_PERSISTENCE_XML = "PROJECT_NO_PERSISTENCE_XML";
-
- public static final String PROJECT_MULTIPLE_PERSISTENCE_XML = "PROJECT_MULTIPLE_PERSISTENCE_XML";
-
- public static final String PERSISTENCE_XML_INVALID_CONTENT = "PERSISTENCE_XML_INVALID_CONTENT";
-
- public static final String PERSISTENCE_NO_PERSISTENCE_UNIT = "PERSISTENCE_NO_PERSISTENCE_UNIT";
-
- public static final String PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS = "PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS";
-
- public static final String PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE = "PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE";
-
- public static final String PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE = "PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE";
-
- public static final String PERSISTENCE_UNIT_INVALID_MAPPING_FILE = "PERSISTENCE_UNIT_INVALID_MAPPING_FILE";
-
- public static final String PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE = "PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE";
-
- public static final String PERSISTENCE_UNIT_UNSPECIFIED_CLASS = "PERSISTENCE_UNIT_UNSPECIFIED_CLASS";
-
- public static final String PERSISTENCE_UNIT_NONEXISTENT_CLASS = "PERSISTENCE_UNIT_NONEXISTENT_CLASS";
-
- public static final String PERSISTENCE_UNIT_INVALID_CLASS = "PERSISTENCE_UNIT_INVALID_CLASS";
-
- public static final String PERSISTENCE_UNIT_DUPLICATE_CLASS = "PERSISTENCE_UNIT_DUPLICATE_CLASS";
-
- public static final String ENTITY_MAPPINGS_MULTIPLE_METADATA = "ENTITY_MAPPINGS_MULTIPLE_METADATA";
-
- public static final String PERSISTENT_TYPE_UNSPECIFIED_CONTEXT = "PERSISTENT_TYPE_UNSPECIFIED_CONTEXT";
-
- public static final String PERSISTENT_TYPE_UNSPECIFIED_CLASS = "PERSISTENT_TYPE_UNSPECIFIED_CLASS";
-
- public static final String PERSISTENT_TYPE_UNRESOLVED_CLASS = "PERSISTENT_TYPE_UNRESOLVED_CLASS";
-
- public static final String ENTITY_NO_ID = "ENTITY_NO_ID";
-
- public static final String PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME = "PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME";
-
- public static final String PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME = "PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME";
-
- public static final String PERSISTENT_ATTRIBUTE_FINAL_FIELD = "PERSISTENT_ATTRIBUTE_FINAL_FIELD";
-
- public static final String PERSISTENT_ATTRIBUTE_PUBLIC_FIELD = "PERSISTENT_ATTRIBUTE_PUBLIC_FIELD";
-
- public static final String PERSISTENT_ATTRIBUTE_INVALID_MAPPING = "PERSISTENT_ATTRIBUTE_INVALID_MAPPING";
-
- public static final String MAPPING_UNRESOLVED_MAPPED_BY = "MAPPING_UNRESOLVED_MAPPED_BY";
-
- public static final String MAPPING_INVALID_MAPPED_BY = "MAPPING_INVALID_MAPPED_BY";
-
- public static final String MAPPING_MAPPED_BY_WITH_JOIN_TABLE = "MAPPING_MAPPED_BY_WITH_JOIN_TABLE";
-
- public static final String MAPPING_MAPPED_BY_ON_BOTH_SIDES = "MAPPING_MAPPED_BY_ON_BOTH_SIDES";
-
- public static final String TABLE_UNRESOLVED_SCHEMA = "TABLE_UNRESOLVED_SCHEMA";
-
- public static final String TABLE_UNRESOLVED_NAME = "TABLE_UNRESOLVED_NAME";
-
- public static final String SECONDARY_TABLE_UNRESOLVED_SCHEMA = "SECONDARY_TABLE_UNRESOLVED_SCHEMA";
-
- public static final String SECONDARY_TABLE_UNRESOLVED_NAME = "SECONDARY_TABLE_UNRESOLVED_NAME";
-
- public static final String JOIN_TABLE_UNRESOLVED_SCHEMA = "JOIN_TABLE_UNRESOLVED_SCHEMA";
-
- public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA";
-
- public static final String JOIN_TABLE_UNRESOLVED_NAME = "JOIN_TABLE_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME";
-
- public static final String COLUMN_UNRESOLVED_TABLE = "COLUMN_UNRESOLVED_TABLE";
-
- public static final String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_TABLE";
-
- public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_TABLE";
-
- public static final String COLUMN_UNRESOLVED_NAME = "COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME";
-
- public static final String JOIN_COLUMN_UNRESOLVED_TABLE = "JOIN_COLUMN_UNRESOLVED_TABLE";
-
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE";
-
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_TABLE";
-
- public static final String JOIN_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME";
-
- public static final String JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
-
- public static final String GENERATED_VALUE_UNRESOLVED_GENERATOR = "GENERATED_VALUE_UNRESOLVED_GENERATOR";
-
- public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME";
-
- public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
deleted file mode 100644
index 519650d658..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.validation;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jpt.core.JpaModel;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
-
-/**
- * This class is referenced in the JPA extension for the
- * WTP validator extension point.
- */
-public class JpaValidator implements IValidatorJob {
-
-
- // ********** IValidator implementation **********
-
- public void validate(IValidationContext context, IReporter reporter) throws ValidationException {
- reporter.removeAllMessages(this);
-
- for (Iterator<IMessage> stream = this.validationMessages(context); stream.hasNext(); ) {
- reporter.addMessage(this, stream.next());
- }
- }
-
- private Iterator<IMessage> validationMessages(IValidationContext context) {
- IProject project = ((IProjectValidationContext) context).getProject();
- return JptCorePlugin.jpaProject(project).validationMessages();
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // ********** IValidatorJob implementation **********
-
- public ISchedulingRule getSchedulingRule(IValidationContext context) {
- // don't know what to return here. my guess is that we want to return
- // the resource that is possibly being changed during our validation,
- // and since many resources in the project may be changed during this
- // validation, returning the project makes the most sense.
- return ((IWorkbenchContext) context).getProject();
- }
-
- public IStatus validateInJob(IValidationContext context, IReporter reporter) throws ValidationException {
- if (reporter.isCancelled()) {
- return Status.CANCEL_STATUS;
- }
- this.validate(context, reporter);
- return OK_STATUS;
- }
-
-
- // ********** marker clean-up **********
-
- private static final CollectionChangeListener JPA_MODEL_LISTENER = new LocalCollectionChangeListener();
-
- static {
- JptCorePlugin.jpaModel().addCollectionChangeListener(JpaModel.JPA_PROJECTS_COLLECTION, JPA_MODEL_LISTENER);
- }
-
- /**
- * When a JPA project is removed this listener will schedule a job to
- * remove all the markers associated with the JPA project.
- */
- private static class LocalCollectionChangeListener implements CollectionChangeListener {
-
- LocalCollectionChangeListener() {
- super();
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- // ignore
- }
-
- /**
- * For now, we expect JPA projects to be removed one at a time.
- */
- public void itemsRemoved(CollectionChangeEvent event) {
- @SuppressWarnings("unchecked")
- Iterator<JpaProject> items = (Iterator<JpaProject>) event.items();
- Job j = new DeleteMarkersJob(items.next());
- j.schedule();
- if (items.hasNext()) {
- throw new UnsupportedOperationException("unexpected event");
- }
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- throw new UnsupportedOperationException("unexpected event");
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- throw new UnsupportedOperationException("unexpected event");
- }
-
- }
-
- /**
- * Delete all the markers associated with the specified JPA project.
- */
- private static class DeleteMarkersJob extends Job {
- private final JpaProject jpaProject;
-
- DeleteMarkersJob(JpaProject jpaProject) {
- super("Delete Markers");
- this.jpaProject = jpaProject;
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- IMarker[] markers = this.jpaProject.project().findMarkers(JptCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
- ResourcesPlugin.getWorkspace().deleteMarkers(markers);
- } catch (CoreException ex) {
- JptCorePlugin.log(ex); // not much else we can do
- }
- return Status.OK_STATUS;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
deleted file mode 100644
index 96e92775e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.common;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IResource;
-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.common.util.EList;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml EObject</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.common.CommonPackage#getXmlEObject()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractJpaEObject extends EObjectImpl implements JpaEObject
-{
- protected IDOMNode node;
-
- /**
- * Sets of "insignificant" feature ids, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final Map<Class<? extends AbstractJpaEObject>, Set<Integer>> insignificantFeatureIdSets = new Hashtable<Class<? extends AbstractJpaEObject>, Set<Integer>>();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractJpaEObject() {
- super();
- }
-
-
- // **************** IJpaEObject implementation *****************************
-
- public IResource platformResource() {
- return resource().getFile();
- }
-
- public JpaXmlResource resource() {
- return (JpaXmlResource) eResource();
- }
-
- /*
- * Must be overridden by actual root object to return itself
- */
- public JpaEObject root() {
- return ((JpaEObject) eContainer()).root();
-
- }
-
-
- // **************** change notification ************************************
-
- /**
- * override to prevent notification when the object's state is unchanged
- */
- @Override
- public void eNotify(Notification notification) {
- if (!notification.isTouch()) {
- super.eNotify(notification);
- this.featureChanged(notification.getFeatureID(this.getClass()));
- }
- }
-
- protected void featureChanged(int featureId) {
- if (this.featureIsSignificant(featureId)) {
- resource().resourceChanged();
- }
- }
-
- protected boolean featureIsSignificant(int featureId) {
- return ! this.featureIsInsignificant(featureId);
- }
-
- protected boolean featureIsInsignificant(int featureId) {
- return this.insignificantFeatureIds().contains(new Integer(featureId));
- }
-
- /**
- * Return a set of the object's "insignificant" feature ids.
- * These are the EMF features that will not be used to determine if all
- * the features are unset. We use this to determine when to remove
- * an element from the xml.
- *
- * If you need instance-based calculation of your xml "insignificant" aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addInsignificantXmlFeatureIdsTo(Set).
- *
- * @see isAllFeaturesUnset()
- */
- protected Set<Integer> insignificantFeatureIds() {
- synchronized (insignificantFeatureIdSets) {
- Set<Integer> insignificantXmlFeatureIds = insignificantFeatureIdSets.get(this.getClass());
- if (insignificantXmlFeatureIds == null) {
- insignificantXmlFeatureIds = new HashSet<Integer>();
- this.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
- insignificantFeatureIdSets.put(this.getClass(), insignificantXmlFeatureIds);
- }
- return insignificantXmlFeatureIds;
- }
- }
-
- /**
- * Add the object's "insignificant" feature ids to the specified set.
- * These are the EMF features that, when they change, will NOT cause the
- * object (or its containing tree) to be resynched, i.e. defaults calculated.
- * If class-based calculation of your "insignificant" features is sufficient,
- * override this method. If you need instance-based calculation,
- * override #insignificantXmlFeatureIds().
- */
- protected void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds) {
- // when you override this method, don't forget to include:
- // super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
- }
-
-
- // *************************************************************************
-
- public boolean isAllFeaturesUnset() {
- for (EStructuralFeature feature : eClass().getEAllStructuralFeatures()) {
- if (eIsSet(feature)) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public EList<Adapter> eAdapters() {
- if (this.eAdapters == null) {
- this.eAdapters = new XmlEAdapterList<Adapter>(this);
- }
- return this.eAdapters;
- }
-
- public IDOMNode getNode() {
- return this.node;
- }
-
-
- protected class XmlEAdapterList<E extends Object & Adapter> extends EAdapterList<E>
- {
- public XmlEAdapterList(Notifier notifier) {
- super(notifier);
- }
-
- @Override
- protected void didAdd(int index, E newObject) {
- super.didAdd(index, newObject);
- try {
- node = (IDOMNode) ClassTools.executeMethod(newObject, "getNode");
- }
- catch (RuntimeException re) {
- // nothing to do
- }
- }
-
- @Override
- protected void didRemove(int index, E oldObject) {
- super.didRemove(index, oldObject);
- if ((oldObject instanceof EMF2DOMAdapter) && (((EMF2DOMAdapter) oldObject).getNode() == AbstractJpaEObject.this.node)) {
- AbstractJpaEObject.this.node = null;
- }
- }
- }
-
- public TextRange validationTextRange() {
- return fullTextRange();
- }
-
- public TextRange selectionTextRange() {
- return fullTextRange();
- }
-
- public TextRange fullTextRange() {
- return buildTextRange(this.node);
- }
-
- protected TextRange buildTextRange(IDOMNode domNode) {
- if (domNode == null) {
- return null;
- }
- return new DOMNodeTextRange(domNode);
- }
-
- public boolean containsOffset(int textOffset) {
- if (node == null) {
- return false;
- }
- return node.contains(textOffset);
- }
-
- /**
- * Implementation of ITextRange that adapts a IDOMNode.
- */
- private static class DOMNodeTextRange implements TextRange
- {
- private final IDOMNode node;
-
- DOMNodeTextRange(IDOMNode node) {
- super();
- this.node = node;
- }
-
- public int getOffset() {
- return this.node.getStartOffset();
- }
-
- public int getLength() {
- if (this.node.getNodeType() == Node.ELEMENT_NODE) {
- return ((IDOMElement) this.node).getStartEndOffset() - this.node.getStartOffset();
- }
- return this.node.getLength();
- }
-
- public int getLineNumber() {
- return this.node.getStructuredDocument().getLineOfOffset(getOffset()) + 1;
- }
-
- public boolean includes(int index) {
- return (this.getOffset() <= index) && (index < this.end());
- }
-
- public boolean touches(int index) {
- return this.includes(index) || (index == this.end());
- }
-
- /**
- * The end offset is "exclusive", i.e. the element at the end offset
- * is not included in the range.
- */
- private int end() {
- return this.getOffset() + this.getLength();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == this.getOffset()) && (r.getLength() == this.getLength());
- }
-
- @Override
- public int hashCode() {
- return this.getOffset() ^ this.getLength();
- }
-
- @Override
- public String toString() {
- String start = String.valueOf(this.getOffset());
- String end = String.valueOf(this.getOffset() + this.getLength() - 1);
- return StringTools.buildToStringFor(this, start + ", " + end);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java
deleted file mode 100644
index f021d99116..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaArtifactEdit.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.common;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class JpaArtifactEdit extends ArtifactEdit
-{
- public JpaArtifactEdit(IProject aProject, boolean toAccessAsReadOnly)
- throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly);
- }
-
-
- /**
- * @return a resource for the given file
- */
- public abstract JpaXmlResource getResource(IFile file);
-
- /**
- * @param deployURI - this must be in a deployment relevant form
- * (e.g "META-INF/persistence.xml" instead of "src/META-INF/persistence.xml")
- * @return a resource for the given deployment file URI
- */
- public abstract JpaXmlResource getResource(String deployURI);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java
deleted file mode 100644
index 72b6bcddf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaEObject.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.common;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaEObject extends EObject
-{
- /**
- * Return the resource that most directly contains this object
- */
- IResource platformResource();
-
- /**
- * Return the JpaXmlResource containing this object.
- */
- JpaXmlResource resource();
-
- /**
- * Return the root object of the model
- */
- JpaEObject root();
-
- /**
- * Return true if this object's text representation contains the text offset
- */
- boolean containsOffset(int textOffset);
-
- /**
- * Return the text range to be used for validation. This is the source
- * range that will be highlighted for a validation error.
- */
- TextRange validationTextRange();
-
- /**
- * Return the text range to be used for selection. This is the source
- * range that will be highlighted when selecting in the structure view.
- */
- TextRange selectionTextRange();
-
-
- boolean isAllFeaturesUnset();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java
deleted file mode 100644
index 028eb87096..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResource.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.common;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class JpaXmlResource extends TranslatorResourceImpl
-{
- protected JpaXmlResourceModel resourceModel;
-
- protected final Collection<ResourceModelListener> resourceModelListeners;
-
-
- protected JpaXmlResource(Renderer aRenderer) {
- super(aRenderer);
- this.resourceModelListeners = new ArrayList<ResourceModelListener>();
- }
-
- protected JpaXmlResource(URI uri, Renderer aRenderer) {
- super(uri, aRenderer);
- this.resourceModelListeners = new ArrayList<ResourceModelListener>();
- }
-
- /**
- * override to prevent notification when the object's state is unchanged
- */
- @Override
- public void eNotify(Notification notification) {
- if (!notification.isTouch() && isLoaded()) {
- super.eNotify(notification);
- resourceChanged();
- }
- }
-
- /**
- * @see TranslatorResourceImpl#getDefaultPublicId()
- */
- @Override
- protected String getDefaultPublicId() {
- return null;
- // only applicable for DTD-based files
- }
-
- /**
- * @see TranslatorResourceImpl#getDefaultSystemId()
- */
- @Override
- protected String getDefaultSystemId() {
- return null;
- // only applicable for DTD-based files
- }
-
- /**
- * @see TranslatorResourceImpl#getDefaultVersionId()
- */
- @Override
- protected int getDefaultVersionID() {
- return 10;
- // this seems to be the default version of the spec for this doc
- // and the id 10 maps to the version 1.0
- }
-
- /**
- * @see TranslatorResource#getDoctype()
- */
- public String getDoctype() {
- return null;
- // only applicable for DTD-based files
- }
-
- public IFile getFile() {
- IFile file = null;
- file = getFile(getURI());
- if (file == null) {
- if (getResourceSet() != null) {
- URIConverter converter = getResourceSet().getURIConverter();
- URI convertedUri = converter.normalize(getURI());
- if (! getURI().equals(convertedUri)) {
- file = getFile(convertedUri);
- }
- }
- }
- return file;
- }
-
- /**
- * Return the IFile for the <code>uri</code> within the Workspace. This URI is assumed to be
- * absolute in the following format: platform:/resource/....
- */
- private IFile getFile(URI uri) {
- if (WorkbenchResourceHelperBase.isPlatformResourceURI(uri)) {
- String fileString = URI.decode(uri.path());
- fileString = fileString.substring(JEMUtilPlugin.PLATFORM_RESOURCE.length() + 1);
- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileString));
- }
- return null;
- }
-
- public boolean exists() {
- return getFile().exists();
- }
-
- public abstract void javaElementChanged(ElementChangedEvent event);
-
- public JpaXmlResourceModel resourceModel() {
- return resourceModel;
- }
-
- public void setResourceModel(JpaXmlResourceModel resourceModel) {
- this.resourceModel = resourceModel;
- }
-
- public void resourceChanged() {
- for (ResourceModelListener listener : this.resourceModelListeners) {
- listener.resourceModelChanged();
- }
- }
-
- public void addResourceModelChangeListener(ResourceModelListener listener) {
- if (listener == null) {
- throw new IllegalArgumentException("Listener cannot be null");
- }
- this.resourceModelListeners.add(listener);
- }
-
- public void removeResourceModelChangeListener(ResourceModelListener listener) {
- if (!this.resourceModelListeners.contains(listener)) {
- throw new IllegalArgumentException("Listener " + listener + " was never added");
- }
- this.resourceModelListeners.add(listener);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResourceModel.java
deleted file mode 100644
index 6aa46462be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/JpaXmlResourceModel.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.common;
-
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceModelListener;
-import org.eclipse.jpt.core.internal.AbstractResourceModel;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelEvent;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelListener;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class JpaXmlResourceModel extends AbstractResourceModel
-{
- protected JpaArtifactEdit artifactEdit;
-
- protected JpaXmlResource resource;
-
-
- protected JpaXmlResourceModel(IFile file) {
- super();
- this.artifactEdit = buildArtifactEdit(file.getProject());
- this.resource = this.artifactEdit.getResource(file);
- this.resource.setResourceModel(this);
- this.artifactEdit.addListener(buildReloadListener(this.resource));
- }
-
-
- protected abstract JpaArtifactEdit buildArtifactEdit(IProject project);
-
- private EditModelListener buildReloadListener(JpaXmlResource resource) {
- return new ReloadListener(resource);
- }
-
- @Override
- public JpaXmlResource resource() {
- return this.resource;
- }
-
- public void javaElementChanged(ElementChangedEvent event) {
- resource().javaElementChanged(event);
- }
-
- public void addResourceModelChangeListener(ResourceModelListener listener) {
- resource().addResourceModelChangeListener(listener);
- }
-
- public void removeResourceModelChangeListener(ResourceModelListener listener) {
- resource().removeResourceModelChangeListener(listener);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- this.artifactEdit.dispose();
- }
-
- public void resolveTypes() {
- //nothing to do here, JavaResourceModel needs this
- }
-
- private class ReloadListener implements EditModelListener
- {
- final JpaXmlResource resource;
-
-
- ReloadListener(JpaXmlResource resource) {
- super();
- this.resource = resource;
- }
-
-
- public void editModelChanged(EditModelEvent anEvent) {
- switch (anEvent.getEventCode()) {
- case EditModelEvent.UNLOADED_RESOURCE :
- if (anEvent.getChangedResources().contains(resource)
- && ! resource.isLoaded()) {
- try {
- resource.load(resource.getResourceSet().getLoadOptions());
- }
- catch (IOException ioe) {
- JptCorePlugin.log(ioe);
- }
- }
- break;
- case EditModelEvent.REMOVED_RESOURCE :
- if (anEvent.getChangedResources().contains(resource)) {
- anEvent.getEditModel().removeListener(this);
- }
- break;
-// case EditModelEvent.SAVE :
-// case EditModelEvent.PRE_DISPOSE :
- }
-
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AbstractColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AbstractColumnAnnotation.java
deleted file mode 100644
index 0e20d3582d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AbstractColumnAnnotation.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AbstractColumnAnnotation extends NamedColumnAnnotation
-{
-
- /**
- * Corresponds to the unique element of the *Column annotation.
- * Returns null if the unique valuePair does not exist in the annotation
- */
- Boolean getUnique();
-
- /**
- * Corresponds to the unique element of the *Column annotation.
- * Set to null to remove the unique valuePair from the annotation
- */
- void setUnique(Boolean unique);
- String UNIQUE_PROPERTY = "uniqueProperty";
-
- /**
- * Corresponds to the nullable element of the *Column annotation.
- * Returns null if the nullable valuePair does not exist in the annotation
- */
- Boolean getNullable();
-
- /**
- * Corresponds to the nullable element of the *Column annotation.
- * Set to null to remove the nullable valuePair from the annotation
- */
- void setNullable(Boolean nullable);
- String NULLABLE_PROPERTY = "nullableProperty";
-
- /**
- * Corresponds to the insertable element of the *Column annotation.
- * Returns null if the insertable valuePair does not exist in the annotation
- */
- Boolean getInsertable();
-
- /**
- * Corresponds to the insertable element of the *Column annotation.
- * Set to null to remove the insertable valuePair from the annotation
- */
- void setInsertable(Boolean insertable);
- String INSERTABLE_PROPERTY = "insertableProperty";
-
- /**
- * Corresponds to the updatable element of the *Column annotation.
- * Returns null if the updatable valuePair does not exist in the annotation
- */
- Boolean getUpdatable();
-
- /**
- * Corresponds to the updatable element of the *Column annotation.
- * Set to null to remove the updatable valuePair from the annotation
- */
- void setUpdatable(Boolean updatable);
- String UPDATABLE_PROPERTY = "updatableProperty";
-
- /**
- * Corresponds to the table element of the *Column annotation.
- * Returns null if the table valuePair does not exist in the annotation
- */
- String getTable();
-
- /**
- * Corresponds to the table element of the *Column annotation.
- * Set to null to remove the table valuePair from the annotation
- */
- void setTable(String table);
- String TABLE_PROPERTY = "tableProperty";
-
-
- /**
- * Return the ITextRange for the unique element. If the unique element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange uniqueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the nullable element. If the nullable element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange nullableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the insertable element. If the insertable element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange insertableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the updatable element. If the updatable element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange updatableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the table element. If the table element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange tableTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the table element.
- * Return false if the table element does not exist.
- */
- boolean tableTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java
deleted file mode 100644
index b37146038a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum AccessType {
-
- PROPERTY,
- FIELD;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
deleted file mode 100644
index fa109edbae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Annotation extends JavaResourceNode
-{
- /**
- * Return the fully qualified annotation name.
- * @see JPA
- */
- String getAnnotationName();
-
- org.eclipse.jdt.core.dom.Annotation jdtAnnotation(CompilationUnit astRoot);
-
- /**
- * Removing the underyling Java annotation
- */
- void removeAnnotation();
-
- /**
- * Create and add Java annotation
- */
- void newAnnotation();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java
deleted file mode 100644
index 14a327eca8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-
-/**
- * Used for building new Annotations.
- * These should be used to define non-mapping annotations. If you
- * want to provide new AnnotationDefinitions you will need
- * to create a new JpaPlatform by extending GenericJpaPlatform.
- *
- * @see MappingAnnotation
- * @see org.eclipse.jpt.core.internal.platform.GenericJpaPlatform
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AnnotationDefinition
-{
- /**
- * Return the fully qualified annotation name
- */
- String getAnnotationName();
-
- /**
- * Build and return an Annotation given the Member
- */
- Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member);
-
- Annotation buildNullAnnotation(JavaResourcePersistentMember parent, Member member);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
deleted file mode 100644
index ac978cd63c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the javax.persistence.AssociationOverride annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AssociationOverrideAnnotation extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDE;
-
-
- /**
- * Corresponds to the joinColumns element of the AssociationOverride annotation.
- * Returns an empty iterator if the joinColumns element does not exist in java.
- */
- ListIterator<JoinColumnAnnotation> joinColumns();
-
- JoinColumnAnnotation joinColumnAt(int index);
-
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- int joinColumnsSize();
-
- JoinColumnAnnotation addJoinColumn(int index);
-
- void removeJoinColumn(int index);
-
- void moveJoinColumn(int targetIndex, int sourceIndex);
-
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrides.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrides.java
deleted file mode 100644
index 0b45fee22f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrides.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AssociationOverrides extends ContainerAnnotation<NestableAssociationOverride>
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDES;
-
- String ASSOCIATION_OVERRIDES_LIST = "associationOveridesList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
deleted file mode 100644
index c9eaa5bd35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.AttributeOverride annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeOverrideAnnotation extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDE;
-
- /**
- * Corresponds to the column element of the AttributeOverride annotation.
- * Returns null if the column element does not exist in java.
- */
- ColumnAnnotation getColumn();
-
- /**
- * Add the column element to the AttributeOverride annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the column element from the AttributeOverride annotation.
- */
- void removeColumn();
-
- ColumnAnnotation getNonNullColumn();
-
- String COLUMN_PROPERTY = "columnProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrides.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrides.java
deleted file mode 100644
index 06654a7cf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrides.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeOverrides extends ContainerAnnotation<NestableAttributeOverride>
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDES;
-
- String ATTRIBUTE_OVERRIDES_LIST = "attributeOverridesList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Basic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Basic.java
deleted file mode 100644
index 6f9bc7538e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Basic.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Basic extends JavaResourceNode
-{
-
- String ANNOTATION_NAME = JPA.BASIC;
-
- /**
- * Corresponds to the fetch element of the Basic annotation.
- * Returns null if the fetch element does not exist in java.
- */
- FetchType getFetch();
-
- /**
- * Corresponds to the fetch element of the Basic annotation.
- * Set to null to remove the fetch element.
- */
- void setFetch(FetchType fetch);
- String FETCH_PROPERTY = "fetchProperty";
-
- /**
- * Corresponds to the optional element of the Basic annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the Basic annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty";
-
- /**
- * Return the ITextRange for the fetch element. If the fetch element
- * does not exist return the ITextRange for the Basic annotation.
- */
- TextRange fetchTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the optional element. If the optional element
- * does not exist return the ITextRange for the Basic annotation.
- */
- TextRange optionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java
deleted file mode 100644
index a54aa2393d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum CascadeType {
-
- ALL(JPA.CASCADE_TYPE__ALL),
- PERSIST(JPA.CASCADE_TYPE__PERSIST),
- MERGE(JPA.CASCADE_TYPE__MERGE),
- REMOVE(JPA.CASCADE_TYPE__REMOVE),
- REFRESH(JPA.CASCADE_TYPE__REFRESH);
-
- private String javaAnnotationValue;
-
- CascadeType(String javaAnnotationValue) {
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
- public static CascadeType[] fromJavaAnnotationValue(String[] javaAnnotationValues) {
- if (javaAnnotationValues == null) {
- return new CascadeType[0];
- }
- CascadeType[] cascadeTypes = new CascadeType[javaAnnotationValues.length];
- for (int i = 0; i < javaAnnotationValues.length; i++) {
- String javaAnnotationValue = javaAnnotationValues[i];
- if (javaAnnotationValue != null) {
- cascadeTypes[i] = cascadeType(javaAnnotationValue);
- }
- }
- return cascadeTypes;
- }
-
- private static CascadeType cascadeType(String javaAnnotationValue) {
- if (javaAnnotationValue.equals(ALL.getJavaAnnotationValue())) {
- return ALL;
- }
- else if (javaAnnotationValue.equals(PERSIST.getJavaAnnotationValue())) {
- return PERSIST;
- }
- else if (javaAnnotationValue.equals(MERGE.getJavaAnnotationValue())) {
- return MERGE;
- }
- else if (javaAnnotationValue.equals(REMOVE.getJavaAnnotationValue())) {
- return REMOVE;
- }
- else if (javaAnnotationValue.equals(REFRESH.getJavaAnnotationValue())) {
- return REFRESH;
- }
- throw new IllegalArgumentException("Unknown cascade type: " + javaAnnotationValue);
- }
-
- public static String[] toJavaAnnotationValue(CascadeType[] cascadeTypes) {
- String[] javaAnnotationValues = new String[cascadeTypes.length];
- for (int i = 0; i < cascadeTypes.length; i++) {
- CascadeType cascadeType = cascadeTypes[i];
- javaAnnotationValues[i] = cascadeType.javaAnnotationValue;
- }
- return javaAnnotationValues;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
deleted file mode 100644
index fae2a63f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ColumnAnnotation extends AbstractColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.COLUMN;
-
- /**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Returns null if the length valuePair does not exist in the annotation
- */
- Integer getLength();
-
- /**
- * Corresponds to the length element of the javax.persistence.Column annotation.
- * Set to null to remove the length valuePair from the annotation
- */
- void setLength(Integer length);
- String LENGTH_PROPERTY = "lengthProperty";
-
- /**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Returns null if the precision valuePair does not exist in the annotation
- */
- Integer getPrecision();
-
- /**
- * Corresponds to the precision element of the javax.persistence.Column annotation.
- * Set to null to remove the precision valuePair from the annotation
- */
- void setPrecision(Integer precision);
- String PRECISION_PROPERTY = "precisionProperty";
-
- /**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Returns null if the scale valuePair does not exist in the annotation
- */
- Integer getScale();
-
- /**
- * Corresponds to the scale element of the javax.persistence.Column annotation.
- * Set to null to remove the scale valuePair from the annotation
- */
- void setScale(Integer scale);
- String SCALE_PROPERTY = "scaleProperty";
-
- /**
- * Return the ITextRange for the length element. If length element
- * does not exist return the ITextRange for the Column annotation.
- */
- TextRange lengthTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the precision element. If precision element
- * does not exist return the ITextRange for the Column annotation.
- */
- TextRange precisionTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the scale element. If scale element
- * does not exist return the ITextRange for the Column annotation.
- */
- TextRange scaleTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java
deleted file mode 100644
index 7791efae3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ContainerAnnotation<T extends NestableAnnotation> extends Annotation
-{
- /**
- * Return the fully qualified nestable annotation name.
- */
- String getNestableAnnotationName();
-
- /**
- * Return the element name of the nestable annotation when
- * it is nested withing the container annotatio as a member value pai
- */
- String getElementName();
-
- ListIterator<T> nestedAnnotations();
-
- int nestedAnnotationsSize();
-
- T nestedAnnotationAt(int index);
-
- T nestedAnnotationFor(org.eclipse.jdt.core.dom.Annotation jdtAnnotation);
-
- int indexOf(T nestedAnnotation);
-
- T add(int index);
-
- /**
- * Add directly to the List without firing change notification.
- */
- T addInternal(int index);
-
- void remove(T nestedAnnotation);
-
- void remove(int index);
-
- /**
- * Move in the List without firing change notification.
- */
- void moveInternal(int targetIndex, int sourceIndex);
-
- void move(int targetIndex, int sourceIndex);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
deleted file mode 100644
index d86abfbeaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.DiscriminatorColumn annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DiscriminatorColumnAnnotation extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_COLUMN;
-
- /**
- * Corresponds to the discriminatorType element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the discriminatorType valuePair does not exist in the annotation
- */
- DiscriminatorType getDiscriminatorType();
-
- /**
- * Corresponds to the discriminatorType element of the javax.persistence.OrderBy annotation.
- * Set the discriminatorType to null to remove the discriminatorType valuePair
- */
- void setDiscriminatorType(DiscriminatorType discriminatorType);
- String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorTypeProperty";
-
- /**
- * Corresponds to the length element of the javax.persistence.DiscriminatorColumn annotation.
- * Returns null if the length valuePair does not exist in the annotation
- */
- Integer getLength();
-
- /**
- * Corresponds to the length element of the javax.persistence.OrderBy annotation.
- * Set the length to null to remove the length valuePair
- */
- void setLength(Integer length);
- String LENGTH_PROPERTY = "lengthProperty";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java
deleted file mode 100644
index be55e5b96a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum DiscriminatorType {
-
- STRING,
- CHAR,
- INTEGER;
-
-
- public static DiscriminatorType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__STRING)) {
- return STRING;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__CHAR)) {
- return CHAR;
- }
- if (javaAnnotationValue.equals(JPA.DISCRIMINATOR_TYPE__INTEGER)) {
- return INTEGER;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(DiscriminatorType discriminatorType) {
- if (discriminatorType == null) {
- return null;
- }
- switch (discriminatorType) {
- case STRING :
- return JPA.DISCRIMINATOR_TYPE__STRING;
- case CHAR :
- return JPA.DISCRIMINATOR_TYPE__CHAR;
- case INTEGER :
- return JPA.DISCRIMINATOR_TYPE__INTEGER;
- default :
- throw new IllegalArgumentException("unknown discriminator type: " + discriminatorType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValue.java
deleted file mode 100644
index 98e35e1e7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.OrderBy annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DiscriminatorValue extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_VALUE;
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Setting the value to null will not remove the OrderBy annotation
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the ITextRange for the value element. If value element
- * does not exist return the ITextRange for the DisriminatorValue annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java
deleted file mode 100644
index 188e3d381f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.Embeddable annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddableAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.EMBEDDABLE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Embedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Embedded.java
deleted file mode 100644
index 48d7a226d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Embedded.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Embedded extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.EMBEDDED;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedId.java
deleted file mode 100644
index 069925b110..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedId.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EmbeddedId extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.EMBEDDED_ID;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java
deleted file mode 100644
index 6b9626eb0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Entity annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EntityAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ENTITY;
-
- /**
- * Corresponds to the name element of the Entity annotation.
- * Returns null if the name element does not exist in java.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the Entity annotation.
- * Set to null to remove the name element.
- */
- void setName(String name);
-
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the Entity annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java
deleted file mode 100644
index f309e5f50e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum EnumType {
-
- ORDINAL,
- STRING;
-
-
- public static EnumType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.ENUM_TYPE__ORDINAL)) {
- return ORDINAL;
- }
- if (javaAnnotationValue.equals(JPA.ENUM_TYPE__STRING)) {
- return STRING;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(EnumType enumType) {
- if (enumType == null) {
- return null;
- }
- switch (enumType) {
- case ORDINAL :
- return JPA.ENUM_TYPE__ORDINAL;
- case STRING :
- return JPA.ENUM_TYPE__STRING;
- default :
- throw new IllegalArgumentException("unknown enum type: " + enumType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Enumerated.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Enumerated.java
deleted file mode 100644
index 502f8163f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Enumerated.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Enumerated annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Enumerated extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ENUMERATED;
-
- /**
- * Corresponds to the value element of the Enumerated annotation.
- * Returns null if the value element does not exist in java.
- */
- EnumType getValue();
-
- /**
- * Corresponds to the value element of the Enumerated annotation.
- * Set to null to remove the value element.
- */
- void setValue(EnumType value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the ITextRange for the value element. If the value element
- * does not exist return the ITextRange for the Enumerated annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java
deleted file mode 100644
index ca4f7e1b25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum FetchType {
-
- EAGER,
- LAZY;
-
-
- public static FetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.FETCH_TYPE__EAGER)) {
- return EAGER;
- }
- if (javaAnnotationValue.equals(JPA.FETCH_TYPE__LAZY)) {
- return LAZY;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(FetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case EAGER :
- return JPA.FETCH_TYPE__EAGER;
- case LAZY :
- return JPA.FETCH_TYPE__LAZY;
- default :
- throw new IllegalArgumentException("unknown fetch type: " + fetchType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java
deleted file mode 100644
index 5e4d34e90d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.GeneratedValue annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface GeneratedValueAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.GENERATED_VALUE;
-
- /**
- * Corresponds to the strategy element of the GeneratedValue annotation.
- * Returns null if the strategy element does not exist in java.
- */
- GenerationType getStrategy();
-
- /**
- * Corresponds to the strategy element of the GeneratedValue annotation.
- * Set to null to remove the strategy element.
- */
- void setStrategy(GenerationType strategy);
- String STRATEGY_PROPERTY = "strategyProperty";
-
- /**
- * Corresponds to the generator element of the GeneratedValue annotation.
- * Returns null if the generator element does not exist in java.
- */
- String getGenerator();
-
- /**
- * Corresponds to the generator element of the GeneratedValue annotation.
- * Set to null to remove the generator element.
- */
- void setGenerator(String generator);
- String GENERATOR_PROPERTY = "generatorProperty";
-
-
- /**
- * Return the ITextRange for the generator element. If the generator element
- * does not exist return the ITextRange for the Enumerated annotation.
- */
- TextRange generatorTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the strategy element. If the strategy element
- * does not exist return the ITextRange for the Enumerated annotation.
- */
- TextRange strategyTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java
deleted file mode 100644
index 6557614932..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum GenerationType {
-
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO;
-
-
- public static GenerationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__TABLE)) {
- return TABLE;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__SEQUENCE)) {
- return SEQUENCE;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__IDENTITY)) {
- return IDENTITY;
- }
- if (javaAnnotationValue.equals(JPA.GENERATION_TYPE__AUTO)) {
- return AUTO;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(GenerationType generationType) {
- if (generationType == null) {
- return null;
- }
- switch (generationType) {
- case TABLE :
- return JPA.GENERATION_TYPE__TABLE;
- case SEQUENCE :
- return JPA.GENERATION_TYPE__SEQUENCE;
- case IDENTITY :
- return JPA.GENERATION_TYPE__IDENTITY;
- case AUTO :
- return JPA.GENERATION_TYPE__AUTO;
- default :
- throw new IllegalArgumentException("unknown generation type: " + generationType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java
deleted file mode 100644
index 67a02d4030..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface GeneratorAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the name element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the name element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the name element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Corresponds to the initialValue element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the initialValue element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- Integer getInitialValue();
-
- /**
- * Corresponds to the initialValue element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the initialValue element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setInitialValue(Integer initialValue);
- String INITIAL_VALUE_PROPERTY = "initialValueProperty";
-
- /**
- * Corresponds to the allocationSize element of the TableGenerator or SequenceGenerator annotation.
- * Returns null if the allocationSize element does not exist in java. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- Integer getAllocationSize();
-
- /**
- * Corresponds to the allocationSize element of the TableGenerator or SequenceGenerator annotation.
- * Set to null to remove the allocationSize element. If no other memberValuePairs exist
- * the *Generator annotation will be removed as well.
- */
- void setAllocationSize(Integer allocationSize);
- String ALLOCATION_SIZE_PROPERTY = "allocationSizeProperty";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the *Generator annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the initialValue element. If the initialValue element
- * does not exist return the ITextRange for the *Generator annotation.
- */
- TextRange initialValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the allocationSize element. If the allocationSize element
- * does not exist return the ITextRange for the *Generator annotation.
- */
- TextRange allocationSizeTextRange(CompilationUnit astRoot);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Id.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Id.java
deleted file mode 100644
index b849f74030..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Id.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Id extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ID;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClass.java
deleted file mode 100644
index 32716363c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClass.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * This interface corresponds to the javax.persistence.IdClass annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface IdClass extends JavaResourceNode
-{
- final String ANNOTATION_NAME = JPA.ID_CLASS;
-
- /**
- * Corresponds to the value element of the IdClass annotation.
- * Returns null if the value element does not exist in java.
- * Returns the portion of the value preceding the .class.
- * <p>
- * &#64;IdClass(value=Employee.class)
- * </p>
- * will return "Employee"
- **/
- String getValue();
-
- /**
- * Corresponds to the value element of the IdClass annotation.
- * Set to null to remove the value element. This will also remove the IdClass
- * annotation itself.
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Returns the qualified value name as it is resolved in the AST
- * <p>
- * &#64;IdClass(Employee.class)
- * </p>
- * will return "model.Employee" if there is an import for model.Employee
- * @return
- */
- String getFullyQualifiedClass();
- String FULLY_QUALIFIED_CLASS_PROPERTY = "fullyQualifiedClassProperty";
-
- /**
- * Return the ITextRange for the value element. If the value element
- * does not exist return the ITextRange for the IdClass annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Inheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Inheritance.java
deleted file mode 100644
index 4e6d70e01e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Inheritance.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Inheritance annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Inheritance extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.INHERITANCE;
-
- InheritanceType getStrategy();
-
- void setStrategy(InheritanceType strategy);
- String STRATEGY_PROPERTY = "strategyProperty";
-
- /**
- * Return the ITextRange for the strategy element. If the strategy element
- * does not exist return the ITextRange for the Inheritance annotation.
- */
- TextRange strategyTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java
deleted file mode 100644
index b25eaa40ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum InheritanceType {
-
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS;
-
-
- public static InheritanceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__SINGLE_TABLE)) {
- return SINGLE_TABLE;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__JOINED)) {
- return JOINED;
- }
- if (javaAnnotationValue.equals(JPA.INHERITANCE_TYPE__TABLE_PER_CLASS)) {
- return TABLE_PER_CLASS;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(InheritanceType inheritanceType) {
- if (inheritanceType == null) {
- return null;
- }
- switch (inheritanceType) {
- case SINGLE_TABLE :
- return JPA.INHERITANCE_TYPE__SINGLE_TABLE;
- case JOINED :
- return JPA.INHERITANCE_TYPE__JOINED;
- case TABLE_PER_CLASS :
- return JPA.INHERITANCE_TYPE__TABLE_PER_CLASS;
- default :
- throw new IllegalArgumentException("unknown inheritance type: " + inheritanceType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
deleted file mode 100644
index 71cdfda387..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-
-/**
- * JPA Java-related stuff (annotations etc.)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JPA {
-
- // JPA package
- String PACKAGE = "javax.persistence";
- String PACKAGE_ = PACKAGE + ".";
-
-
- // ********** API **********
-
- // JPA annotations
- String ASSOCIATION_OVERRIDE = PACKAGE_ + "AssociationOverride";
- String ASSOCIATION_OVERRIDE__NAME = "name";
- String ASSOCIATION_OVERRIDE__JOIN_COLUMNS = "joinColumns";
- String ASSOCIATION_OVERRIDES = PACKAGE_ + "AssociationOverrides";
- String ASSOCIATION_OVERRIDES__VALUE = "value";
- String ATTRIBUTE_OVERRIDE = PACKAGE_ + "AttributeOverride";
- String ATTRIBUTE_OVERRIDE__NAME = "name";
- String ATTRIBUTE_OVERRIDE__COLUMN = "column";
- String ATTRIBUTE_OVERRIDES = PACKAGE_ + "AttributeOverrides";
- String ATTRIBUTE_OVERRIDES__VALUE = "value";
- String BASIC = PACKAGE_ + "Basic";
- String BASIC__FETCH = "fetch";
- String BASIC__OPTIONAL = "optional";
- String COLUMN = PACKAGE_ + "Column";
- String COLUMN__NAME = "name";
- String COLUMN__UNIQUE = "unique";
- String COLUMN__NULLABLE = "nullable";
- String COLUMN__INSERTABLE = "insertable";
- String COLUMN__UPDATABLE = "updatable";
- String COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String COLUMN__TABLE = "table";
- String COLUMN__LENGTH = "length";
- String COLUMN__PRECISION = "precision";
- String COLUMN__SCALE = "scale";
- String COLUMN_RESULT = PACKAGE_ + "ColumnResult";
- String COLUMN_RESULT__NAME = "name";
- String DISCRIMINATOR_COLUMN = PACKAGE_ + "DiscriminatorColumn";
- String DISCRIMINATOR_COLUMN__NAME = "name";
- String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType";
- String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String DISCRIMINATOR_COLUMN__LENGTH = "length";
- String DISCRIMINATOR_VALUE = PACKAGE_ + "DiscriminatorValue";
- String DISCRIMINATOR_VALUE__VALUE = "value";
- String EMBEDDABLE = PACKAGE_ + "Embeddable";
- String EMBEDDED = PACKAGE_ + "Embedded";
- String EMBEDDED_ID = PACKAGE_ + "EmbeddedId";
- String ENTITY = PACKAGE_ + "Entity";
- String ENTITY__NAME = "name";
- String ENTITY_LISTENERS = PACKAGE_ + "EntityListeners";
- String ENTITY_LISTENERS__VALUE = "value";
- String ENTITY_RESULT = PACKAGE_ + "EntityResult";
- String ENTITY_RESULT__ENTITY_CLASS = "entityClass";
- String ENTITY_RESULT__FIELDS = "fields";
- String ENTITY_RESULT__DISCRIMINATOR_COLUMN = "discriminatorColumn";
- String ENUMERATED = PACKAGE_ + "Enumerated";
- String ENUMERATED__VALUE = "value";
- String EXCLUDE_DEFAULT_LISTENERS = PACKAGE_ + "ExcludeDefaultListeners";
- String EXCLUDE_SUPERCLASS_LISTENERS = PACKAGE_ + "ExcludeSuperclassListeners";
- String FIELD_RESULT = PACKAGE_ + "FieldResult";
- String FIELD_RESULT__NAME = "name";
- String FIELD_RESULT__COLUMN = "column";
- String FLUSH_MODE = PACKAGE_ + "FlushMode";
- String FLUSH_MODE__VALUE = "value";
- String GENERATED_VALUE = PACKAGE_ + "GeneratedValue";
- String GENERATED_VALUE__STRATEGY = "strategy";
- String GENERATED_VALUE__GENERATOR = "generator";
- String ID = PACKAGE_ + "Id";
- String ID_CLASS = PACKAGE_ + "IdClass";
- String ID_CLASS__VALUE = "value";
- String INHERITANCE = PACKAGE_ + "Inheritance";
- String INHERITANCE__STRATEGY = "strategy";
- String JOIN_COLUMN = PACKAGE_ + "JoinColumn";
- String JOIN_COLUMN__NAME = "name";
- String JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String JOIN_COLUMN__UNIQUE = "unique";
- String JOIN_COLUMN__NULLABLE = "nullable";
- String JOIN_COLUMN__INSERTABLE = "insertable";
- String JOIN_COLUMN__UPDATABLE = "updatable";
- String JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String JOIN_COLUMN__TABLE = "table";
- String JOIN_COLUMNS = PACKAGE_ + "JoinColumns";
- String JOIN_COLUMNS__VALUE = "value";
- String JOIN_TABLE = PACKAGE_ + "JoinTable";
- String JOIN_TABLE__NAME = "name";
- String JOIN_TABLE__CATALOG = "catalog";
- String JOIN_TABLE__SCHEMA = "schema";
- String JOIN_TABLE__JOIN_COLUMNS = "joinColumns";
- String JOIN_TABLE__INVERSE_JOIN_COLUMNS = "inverseJoinColumns";
- String JOIN_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String LOB = PACKAGE_ + "Lob";
- String MANY_TO_MANY = PACKAGE_ + "ManyToMany";
- String MANY_TO_MANY__TARGET_ENTITY = "targetEntity";
- String MANY_TO_MANY__CASCADE = "cascade";
- String MANY_TO_MANY__FETCH = "fetch";
- String MANY_TO_MANY__MAPPED_BY = "mappedBy";
- String MANY_TO_ONE = PACKAGE_ + "ManyToOne";
- String MANY_TO_ONE__TARGET_ENTITY = "targetEntity";
- String MANY_TO_ONE__CASCADE = "cascade";
- String MANY_TO_ONE__FETCH = "fetch";
- String MANY_TO_ONE__OPTIONAL = "optional";
- String MAP_KEY = PACKAGE_ + "MapKey";
- String MAP_KEY__NAME = "name";
- String MAPPED_SUPERCLASS = PACKAGE_ + "MappedSuperclass";
- String NAMED_NATIVE_QUERIES = PACKAGE_ + "NamedNativeQueries";
- String NAMED_NATIVE_QUERIES__VALUE = "value";
- String NAMED_NATIVE_QUERY = PACKAGE_ + "NamedNativeQuery";
- String NAMED_NATIVE_QUERY__NAME = "name";
- String NAMED_NATIVE_QUERY__QUERY = "query";
- String NAMED_NATIVE_QUERY__HINTS = "hints";
- String NAMED_NATIVE_QUERY__RESULT_CLASS = "resultClass";
- String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "resultSetMapping";
- String NAMED_QUERIES = PACKAGE_ + "NamedQueries";
- String NAMED_QUERIES__VALUE = "value";
- String NAMED_QUERY = PACKAGE_ + "NamedQuery";
- String NAMED_QUERY__NAME = "name";
- String NAMED_QUERY__QUERY = "query";
- String NAMED_QUERY__HINTS = "hints";
- String ONE_TO_MANY = PACKAGE_ + "OneToMany";
- String ONE_TO_MANY__TARGET_ENTITY = "targetEntity";
- String ONE_TO_MANY__CASCADE = "cascade";
- String ONE_TO_MANY__FETCH = "fetch";
- String ONE_TO_MANY__MAPPED_BY = "mappedBy";
- String ONE_TO_ONE = PACKAGE_ + "OneToOne";
- String ONE_TO_ONE__TARGET_ENTITY = "targetEntity";
- String ONE_TO_ONE__CASCADE = "cascade";
- String ONE_TO_ONE__FETCH = "fetch";
- String ONE_TO_ONE__OPTIONAL = "optional";
- String ONE_TO_ONE__MAPPED_BY = "mappedBy";
- String ORDER_BY = PACKAGE_ + "OrderBy";
- String ORDER_BY__VALUE = "value";
- String PERSISTENCE_CONTEXT = PACKAGE_ + "PersistenceContext";
- String PERSISTENCE_CONTEXT__NAME = "name";
- String PERSISTENCE_CONTEXT__UNIT_NAME = "unitName";
- String PERSISTENCE_CONTEXT__TYPE = "type";
- String PERSISTENCE_CONTEXTS = PACKAGE_ + "PersistenceContexts";
- String PERSISTENCE_CONTEXTS__VALUE = "value";
- String PERSISTENCE_UNIT = PACKAGE_ + "XmlPersistenceUnit";
- String PERSISTENCE_UNIT__NAME = "name";
- String PERSISTENCE_UNIT__UNIT_NAME = "unitName";
- String PERSISTENCE_UNITS = PACKAGE_ + "PersistenceUnits";
- String PERSISTENCE_UNITS__VALUE = "value";
- String POST_LOAD = PACKAGE_ + "PostLoad";
- String POST_PERSIST = PACKAGE_ + "PostPersist";
- String POST_REMOVE = PACKAGE_ + "PostRemove";
- String POST_UPDATE = PACKAGE_ + "PostUpdate";
- String PRE_PERSIST = PACKAGE_ + "PrePersist";
- String PRE_REMOVE = PACKAGE_ + "PreRemove";
- String PRE_UPDATE = PACKAGE_ + "PreUpdate";
- String PRIMARY_KEY_JOIN_COLUMN = PACKAGE_ + "PrimaryKeyJoinColumn";
- String PRIMARY_KEY_JOIN_COLUMN__NAME = "name";
- String PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String PRIMARY_KEY_JOIN_COLUMNS = PACKAGE_ + "PrimaryKeyJoinColumns";
- String PRIMARY_KEY_JOIN_COLUMNS__VALUE = "value";
- String QUERY_HINT = PACKAGE_ + "QueryHint";
- String QUERY_HINT__NAME = "name";
- String QUERY_HINT__VALUE = "value";
- String SECONDARY_TABLE = PACKAGE_ + "SecondaryTable";
- String SECONDARY_TABLE__NAME = "name";
- String SECONDARY_TABLE__CATALOG = "catalog";
- String SECONDARY_TABLE__SCHEMA = "schema";
- String SECONDARY_TABLE__PK_JOIN_COLUMNS = "pkJoinColumns";
- String SECONDARY_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String SECONDARY_TABLES = PACKAGE_ + "SecondaryTables";
- String SECONDARY_TABLES__VALUE = "value";
- String SEQUENCE_GENERATOR = PACKAGE_ + "SequenceGenerator";
- String SEQUENCE_GENERATOR__NAME = "name";
- String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequenceName";
- String SEQUENCE_GENERATOR__INITIAL_VALUE = "initialValue";
- String SEQUENCE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String SQL_RESULT_SET_MAPPING = PACKAGE_ + "SqlResultSetMapping";
- String SQL_RESULT_SET_MAPPING__NAME = "name";
- String SQL_RESULT_SET_MAPPING__ENTITIES = "entities";
- String SQL_RESULT_SET_MAPPING__COLUMNS = "columns";
- String TABLE = PACKAGE_ + "Table";
- String TABLE__NAME = "name";
- String TABLE__CATALOG = "catalog";
- String TABLE__SCHEMA = "schema";
- String TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TABLE_GENERATOR = PACKAGE_ + "TableGenerator";
- String TABLE_GENERATOR__NAME = "name";
- String TABLE_GENERATOR__TABLE = "table";
- String TABLE_GENERATOR__CATALOG = "catalog";
- String TABLE_GENERATOR__SCHEMA = "schema";
- String TABLE_GENERATOR__PK_COLUMN_NAME = "pkColumnName";
- String TABLE_GENERATOR__VALUE_COLUMN_NAME = "valueColumnName";
- String TABLE_GENERATOR__PK_COLUMN_VALUE = "pkColumnValue";
- String TABLE_GENERATOR__INITIAL_VALUE = "initialValue";
- String TABLE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String TABLE_GENERATOR__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TEMPORAL = PACKAGE_ + "Temporal";
- String TEMPORAL__VALUE = "value";
- String TRANSIENT = PACKAGE_ + "Transient";
- String UNIQUE_CONSTRAINT = PACKAGE_ + "UniqueConstraint";
- String UNIQUE_CONSTRAINT__COLUMN_NAMES = "columnNames";
- String VERSION = PACKAGE_ + "Version";
-
- // JPA enums
- String GENERATION_TYPE = PACKAGE_ + "GenerationType";
- String GENERATION_TYPE_ = GENERATION_TYPE + ".";
- String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO";
- String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY";
- String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE";
- String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE";
-
- String CASCADE_TYPE = PACKAGE_ + "CascadeType";
- String CASCADE_TYPE_ = CASCADE_TYPE + ".";
- String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL";
- String CASCADE_TYPE__MERGE = CASCADE_TYPE_ + "MERGE";
- String CASCADE_TYPE__PERSIST = CASCADE_TYPE_ + "PERSIST";
- String CASCADE_TYPE__REFRESH = CASCADE_TYPE_ + "REFRESH";
- String CASCADE_TYPE__REMOVE = CASCADE_TYPE_ + "REMOVE";
-
- String DISCRIMINATOR_TYPE = PACKAGE_ + "DiscriminatorType";
- String DISCRIMINATOR_TYPE_ = DISCRIMINATOR_TYPE + ".";
- String DISCRIMINATOR_TYPE__CHAR = DISCRIMINATOR_TYPE_ + "CHAR";
- String DISCRIMINATOR_TYPE__INTEGER = DISCRIMINATOR_TYPE_ + "INTEGER";
- String DISCRIMINATOR_TYPE__STRING = DISCRIMINATOR_TYPE_ + "STRING";
-
- String ENUM_TYPE = PACKAGE_ + "EnumType";
- String ENUM_TYPE_ = ENUM_TYPE + ".";
- String ENUM_TYPE__ORDINAL = ENUM_TYPE_ + "ORDINAL";
- String ENUM_TYPE__STRING = ENUM_TYPE_ + "STRING";
-
- String FETCH_TYPE = PACKAGE_ + "FetchType";
- String FETCH_TYPE_ = FETCH_TYPE + ".";
- String FETCH_TYPE__EAGER = FETCH_TYPE_ + "EAGER";
- String FETCH_TYPE__LAZY = FETCH_TYPE_ + "LAZY";
-
- String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType";
- String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + ".";
- String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO";
- String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT";
-
- String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType";
- String INHERITANCE_TYPE_ = INHERITANCE_TYPE + ".";
- String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED";
- String INHERITANCE_TYPE__SINGLE_TABLE = INHERITANCE_TYPE_ + "SINGLE_TABLE";
- String INHERITANCE_TYPE__TABLE_PER_CLASS = INHERITANCE_TYPE_ + "TABLE_PER_CLASS";
-
- String PERSISTENCE_CONTEXT_TYPE = PACKAGE_ + "PersistenceContextType";
- String PERSISTENCE_CONTEXT_TYPE_ = PERSISTENCE_CONTEXT_TYPE + ".";
- String PERSISTENCE_CONTEXT_TYPE__EXTENDED = PERSISTENCE_CONTEXT_TYPE_ + "EXTENDED";
- String PERSISTENCE_CONTEXT_TYPE__TRANSACTION = PERSISTENCE_CONTEXT_TYPE_ + "TRANSACTION";
-
- String TEMPORAL_TYPE = PACKAGE_ + "TemporalType";
- String TEMPORAL_TYPE_ = TEMPORAL_TYPE + ".";
- String TEMPORAL_TYPE__DATE = TEMPORAL_TYPE_ + "DATE";
- String TEMPORAL_TYPE__TIME = TEMPORAL_TYPE_ + "TIME";
- String TEMPORAL_TYPE__TIMESTAMP = TEMPORAL_TYPE_ + "TIMESTAMP";
-
- // JPA interfaces
- String ENTITY_MANAGER = PACKAGE_ + "EntityManager";
- String ENTITY_MANAGER_FACTORY = PACKAGE_ + "EntityManagerFactory";
- String ENTITY_TRANSACTION = PACKAGE_ + "EntityTransaction";
- String INSTRUMENTABLE_CLASS_LOADER = PACKAGE_ + "InstrumentableClassLoader";
- String QUERY = PACKAGE_ + "Query";
-
- // JPA classes
- String PERSISTENCE = PACKAGE_ + "XmlPersistence";
-
- // JPA exceptions
- String NON_UNIQUE_RESULT_EXCEPTION = PACKAGE_ + "NonUniqueResultException";
- String OBJECT_NOT_FOUND_EXCEPTION = PACKAGE_ + "ObjectNotFoundException";
- String PERSISTENCE_EXCEPTION = PACKAGE_ + "PersistenceException";
-
-
- // ********** SPI **********
-
- // JPA SPI package
- String SPI_PACKAGE = PACKAGE_ + "spi";
- String SPI_PACKAGE_ = SPI_PACKAGE + ".";
-
- // JPA SPI interfaces
- String ENTITY_MANAGER_FACTORY_PROVIDER = SPI_PACKAGE_ + "EntityManagerFactoryProvider";
- String PERSISTENCE_INFO = SPI_PACKAGE_ + "PersistenceInfo";
- String PERSISTENCE_PROVIDER = SPI_PACKAGE_ + "PersistenceProvider";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
deleted file mode 100644
index 6defe3e342..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.core.internal.resource.java.JpaCompilationUnitResource;
-import org.eclipse.jpt.utility.CommandExecutorProvider;
-import org.eclipse.jpt.utility.internal.node.Node;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaResourceNode extends Node
-{
- void initialize(CompilationUnit astRoot);
-
- JavaResourceModel resourceModel();
-
- JpaCompilationUnitResource root();
-
- JpaAnnotationProvider annotationProvider();
-
- CommandExecutorProvider modifySharedDocumentCommandExecutorProvider();
-
- void updateFromJava(CompilationUnit astRoot);
-
- /**
- * Use to resolve type information that could be dependent on other files being added/removed
- */
- void resolveTypes(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange
- */
- TextRange textRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java
deleted file mode 100644
index f94759b049..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-//TODO how do we handle:
-// @Basic
-// private String foo, bar;
-public interface JavaResourcePersistentAttribute extends JavaResourcePersistentMember
-{
- String getName();
-
- Member getMember();
-
- boolean isForField();
-
- boolean isForProperty();
-
- boolean typeIsBasic();
- String TYPE_IS_BASIC_PROPERTY = "typeIsBasicProperty";
-
- /**
- * Return true if the attribute type is a container:
- * java.util.Collection
- * java.util.Set
- * java.util.List
- * java.util.Map
- * @return
- */
- boolean typeIsContainer();
- String TYPE_IS_CONTAINER_PROPERTY = "typeIsContainerProperty";
-
- /**
- * Returns the resolved qualfied type name for the attribute
- */
- String getQualifiedTypeName();
- String QUALIFIED_TYPE_NAME_PROPERTY = "qualfiedTypeNameProperty";
-
- /**
- * Returns the resolved qualfied type name for the attribute
- * if it as valid as a target entity type. i.e. not an array.
- * see typeIsContainer() to be used with this
- */
- String getQualifiedReferenceEntityTypeName();
- String QUALIFIED_REFERENCE_ENTITY_TYPE_NAME_PROPERTY = "qualfiedReferenceEntityTypeNameProperty";
-
- /**
- * Returns the fully qualified type parameter for use as a target entity
- */
- String getQualifiedReferenceEntityElementTypeName();
- String QUALIFIED_REFERENCE_ENTITY_ELEMENT_TYPE_NAME_PROPERTY = "qualfiedReferenceEntityElementTypeNameProperty";
-
- /**
- * Return true if this attribute has any mapping or non-mapping annotations
- * (of course only persistence related annotations)
- */
- boolean hasAnyAnnotation();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java
deleted file mode 100644
index f45433b6f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaResourcePersistentMember extends JavaResourceNode
-{
-
- /**
- * Return all <code>JavaResource</code>s that correspond to type
- * mapping annotations specified in the source code. In JPA these could be
- * Entity, MappedSuperclass, Embeddable.
- * <p>Does not return duplicate annotations as this error is handled by the java compiler.
- */
- <T extends JavaResourceNode> Iterator<T> mappingAnnotations();
-
- String MAPPING_ANNOTATIONS_COLLECTION = "mappingAnnotationsCollection";
-
- int mappingAnnotationsSize();
- /**
- * Return the <code>JavaResource</code> specified on this JavaPersistentResource
- * In the case of multiples the first one will be returned as defined by the order of
- * {@link org.eclipse.jpt.core.internal.platform.GenericJpaPlatform#typeMappingAnnotationDefinitions()} or
- * {@link org.eclipse.jpt.core.internal.platform.GenericJpaPlatform#attributeMappingAnnotationDefinitions()}
- * @return
- */
- JavaResourceNode mappingAnnotation();
-
- /**
- * Returns the <code>JavaResource</code> with this fully qualifed annotation name.
- * In JPA the valid annotations are "javax.persistence.Embedddable", "javax.persistence.Entity",
- * and "javax.persistence.MappedSuperclass"
- * Return the first if there are duplicates in the source code
- * @param annotationName - fully qualified annotation name
- * @return
- */
- //TODO not sure we need this API, first 2 seem sufficient
- JavaResourceNode mappingAnnotation(String annotationName);
-
- /**
- * Use this to change the type mapping annotation. This will only remove
- * other mapping annotations in case there were multiple before. It
- * will not remove any non-mapping annotations
- * @param annotationName - fully qualified annotation name
- */
- void setMappingAnnotation(String annotationName);
-
- /**
- * Return all <code>JavaResource</code>s that correspond to annotations in the source code.
- * Does not return duplicate annotations as this error is handled by the java compiler.
- * No <code>MappingAnnotation</code>s should be included.
- * @see #mappingAnnotations()
- */
- <T extends JavaResourceNode> Iterator<T> annotations();
-
- String ANNOTATIONS_COLLECTION = "annotationsCollection";
-
- int annotationsSize();
-
- //TODO tie the singular and plural annotations together somehow in the resource model so we can give
- //a validation error for the case of both being specified
- /**
- * Given a nestable and container annotation name return the specified <code>JavaResource</code>s.
- * If both the nestable and container annotations are specified on the Type, then only
- * return the nestable annotations specified within the container annotation. This is
- * only going to return JavaResources that match the nestableAnnotationName
- */
- <T extends JavaResourceNode> ListIterator<T> annotations(String nestableAnnotationName, String containerAnnotationName);
-
-
- /**
- * Returns the <code>JavaResource</code> with this fully qualifed annotation name.
- * Return the first if there are duplicates in the source code.
- * @param annotationName
- * @return
- */
- JavaResourceNode annotation(String annotationName);
-
- /**
- * Returns the <code>JavaResource</code> with this fully qualifed annotation name.
- * Return the first if there are duplicates in the source code. Will not return null,
- * but a null Object instead if no annotation with this name exists in the java source.
- * @param annotationName
- * @return
- */
- JavaResourceNode nonNullAnnotation(String annotationName);
-
- /**
- * Returns the <code>JavaResource</code> with this fully qualifed annotation name.
- * Return the first if there are duplicates in the source code. Will not return null,
- * but a null Object instead if no annotation with this name exists in the java source.
- * @param annotationName
- * @return
- */
- JavaResourceNode nonNullMappingAnnotation(String annotationName);
-
- /**
- * Add an annotation for the given fully qualified annotation name
- */
- JavaResourceNode addAnnotation(String annotationName);
-
- void removeAnnotation(String annotationName);
-
- /**
- * Add a new NestableAnnotation named nestableAnnotationName. Create a new container annotation
- * if necessary and add the nestable annotation to it. If both nestable and container already
- * exist then add to the container annotation leaving the existing nestable annotaion alone.
- * If only nestable exists, then create the new container annotation and move the nestable to it
- * also adding the new one. If neither exists, create a new nestable annotation.
- * @return the new JavaResource with the name nestableAnnotationName
- */
- JavaResourceNode addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
-
- void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * Move nestableAnnotation found in the containerAnnotation from the specified source
- * index to the specified target index.
- */
- void move(int targetIndex, int sourceIndex, String containerAnnotationName);
-
- /**
- * Return whether the underlying JDT member is persistable according to the JPA spec
- * @return
- */
- boolean isPersistable();
- String PERSISTABLE_PROPERTY = "persistableProperty";
-
- /**
- * Return whether the underlying JDT member is currently annotated as being persistent
- * (equivalent to "is mapped")
- */
- boolean isPersisted();
-
- /**
- * Return true if this JavaPersistentResource represents the underlying JDT IMeber
- * @param member
- * @return
- */
- boolean isFor(IMember member);
-
-
- /**
- * return the text range for the name of the persistent resource
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
deleted file mode 100644
index a811909f77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.internal.jdtutility.Member;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaResourcePersistentType extends JavaResourcePersistentMember
-{
- /**
- * Return only the persistable nestedTypes
- */
- Iterator<JavaResourcePersistentType> nestedTypes();
- String NESTED_TYPES_COLLECTION = "nestedTypesCollection";
-
- /**
- * Return only the persistable attributes, those that respond true to
- * {@link JavaResourcePersistentAttribute#isPersistable()}
- * This returns fields and properties
- * @return
- */
- Iterator<JavaResourcePersistentAttribute> attributes();
- String ATTRIBUTES_COLLECTION = "attributesCollection";
-
- /**
- * Return only the persistable fields, those that respond true to
- * {@link JavaResourcePersistentAttribute#isPersistable()}
- * This returns filters out all properties and only returns fields
- * @return
- */
- Iterator<JavaResourcePersistentAttribute> fields();
-
- /**
- * Return only the persistable fields, those that respond true to
- * {@link JavaResourcePersistentAttribute#isPersistable()}
- * This returns filters out all fields and only returns properties
- * @return
- */
- Iterator<JavaResourcePersistentAttribute> properties();
-
- JavaResourcePersistentType javaPersistentTypeResource(String fullyQualifiedTypeName);
-
- /**
- * Return the fully qualified type name
- */
- String getQualifiedName();
- String QUALIFIED_NAME_PROPERTY = "qualifiedNameProperty";
-
- /**
- * Return the fully unqualified type name
- */
- String getName();
- String NAME_PROPERTY = "nameProperty";
-
- String getSuperClassQualifiedName();
- String SUPER_CLASS_QUALIFIED_NAME_PROPERTY = "superClassQualifiedNameProperty";
-
- AccessType getAccess();
- String ACCESS_PROPERTY = "accessProperty";
-
- boolean isAbstract();
- String ABSTRACT_PROPERTY = "abstractProperty";
-
- Member getMember();
-
- /**
- * Return whether any attributes in this persistentType have
- * JPA annotations on them.
- */
- boolean hasAnyAttributeAnnotations();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
deleted file mode 100644
index 0359634250..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinColumnAnnotation extends AbstractColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMN;
-
- /**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Returns null if the referencedColumnName valuePair does not exist in the annotation
- */
- String getReferencedColumnName();
-
- /**
- * Corresponds to the referencedColumnName element of the javax.persistence.JoinColumn annotation.
- * Set to null to remove the referencedColumnName valuePait from the Annotation
- */
- void setReferencedColumnName(String referencedColumnName);
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnNameProperty";
-
- /**
- * Return the ITextRange for the referencedColumnName element. If the
- * referencedColumnName element does not exist return the ITextRange
- * for the JoinColumn annotation.
- */
- TextRange referencedColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName element does not exist.
- */
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumns.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumns.java
deleted file mode 100644
index 57580aadbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumns.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinColumns extends ContainerAnnotation<NestableJoinColumn>
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMNS;
-
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java
deleted file mode 100644
index 38d8df3505..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JoinTableAnnotation extends TableAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_TABLE;
-
- ListIterator<JoinColumnAnnotation> joinColumns();
-
- JoinColumnAnnotation joinColumnAt(int index);
-
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- int joinColumnsSize();
-
- JoinColumnAnnotation addJoinColumn(int index);
-
- void removeJoinColumn(int index);
-
- void moveJoinColumn(int targetIndex, int sourceIndex);
- String JOIN_COLUMNS_LIST = "joinColumnsList";
-
- ListIterator<JoinColumnAnnotation> inverseJoinColumns();
-
- JoinColumnAnnotation inverseJoinColumnAt(int index);
-
- int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn);
-
- int inverseJoinColumnsSize();
-
- JoinColumnAnnotation addInverseJoinColumn(int index);
-
- void removeInverseJoinColumn(int index);
-
- void moveInverseJoinColumn(int targetIndex, int sourceIndex);
- String INVERSE_JOIN_COLUMNS_LIST = "inverseJoinColumnsList";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Lob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Lob.java
deleted file mode 100644
index 03802d22b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Lob.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.Lob annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Lob extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.LOB;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToMany.java
deleted file mode 100644
index 4f07e38954..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToMany.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ManyToMany extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.MANY_TO_MANY;
-
- /**
- * Corresponds to the mappedBy element of the ManyToMany annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the ManyToMany annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the ITextRange for the mappedBy element. If the mappedBy element
- * does not exist return the ITextRange for the ManyToMany annotation.
- */
- TextRange mappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy element does not exist.
- */
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOne.java
deleted file mode 100644
index 8c1887836a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOne.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ManyToOne extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.MANY_TO_ONE;
-
- /**
- * Corresponds to the optional element of the ManyToOne annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the ManyToOne annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty";
-
- /**
- * Return the ITextRange for the optional element. If the optional element
- * does not exist return the ITextRange for the ManyToOne annotation.
- */
- TextRange optionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKey.java
deleted file mode 100644
index 1f6c1e9c34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKey.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.MapKey annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MapKey extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.MAP_KEY;
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the MapKey annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name element does not exist.
- */
- public boolean nameTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java
deleted file mode 100644
index 2d1acafaeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappedSuperclassAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.MAPPED_SUPERCLASS;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java
deleted file mode 100644
index 1e555edef9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedColumnAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the name element of the *Column annotation.
- * Returns null if the name valuePair does not exist in the annotation
- */
- String getName();
-
- /**
- * Corresponds to the name element of the *Column annotation.
- * Set to null to remove the name valuePair from the annotation
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Corresponds to the columnDefinition element of the *Column annotation.
- * Returns null if the columnDefinition valuePair does not exist in the annotation
- */
- String getColumnDefinition();
-
- /**
- * Corresponds to the columnDefinition element of the *Column annotation.
- * Set to null to remove the columnDefinition valuePair from the annotation
- */
- void setColumnDefinition(String columnDefinition);
- String COLUMN_DEFINITION_PROPERTY = "columnDefinitionPropety";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the *Column annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the columnDefinition element. If the columnDefinition
- * element does not exist return the ITextRange for the *Column annotation.
- */
- TextRange columnDefinitionTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueries.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueries.java
deleted file mode 100644
index d36840628d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueries.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedNativeQueries extends ContainerAnnotation<NestableNamedNativeQuery>
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERIES;
-
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueriesList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java
deleted file mode 100644
index 8ae1ad3158..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-
-/**
- * Corresponds to the javax.persistence.NamedNativeQuery annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedNativeQueryAnnotation extends QueryAnnotation
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERY;
-
- /**
- * Corresponds to the resultClass element of the NamedNativeQuery annotation.
- * Returns null if the resultClass element does not exist in java.
- */
- String getResultClass();
-
- /**
- * Corresponds to the resultClass element of the NamedNativeQuery annotation.
- * Set to null to remove the resultClass element.
- */
- void setResultClass(String resultClass);
- String RESULT_CLASS_PROPERTY = "resultClassProperty";
-
- /**
- * Corresponds to the resultSetMapping element of the NamedNativeQuery annotation.
- * Returns null if the resultSetMapping element does not exist in java.
- */
- String getResultSetMapping();
-
- /**
- * Corresponds to the resultSetMapping element of the NamedNativeQuery annotation.
- * Set to null to remove the resultSetMapping element.
- */
- void setResultSetMapping(String resultSetMapping);
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMappingProperty";
-
- String getFullyQualifiedResultClass();
- String FULLY_QUALIFIED_RESULT_CLASS_PROPERTY = "fullyQualifiedResultClassProperty";
-
- /**
- * Return the ITextRange for the resultClass element. If resultClass element
- * does not exist return the ITextRange for the NamedNativeQuery annotation.
- */
- TextRange resultClassTextRange(CompilationUnit astRoot);
-
-
- /**
- * Return the ITextRange for the resultSetMapping element. If resultSetMapping element
- * does not exist return the ITextRange for the NamedNativeQuery annotation.
- */
- TextRange resultSetMappingTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueries.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueries.java
deleted file mode 100644
index e802864d20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueries.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedQueries extends ContainerAnnotation<NestableNamedQuery>
-{
- String ANNOTATION_NAME = JPA.NAMED_QUERIES;
-
- String NAMED_QUERIES_LIST = "namedQueriesList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java
deleted file mode 100644
index 6da7aabe69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.NamedQuery annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NamedQueryAnnotation extends QueryAnnotation
-{
- String ANNOTATION_NAME = JPA.NAMED_QUERY;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
deleted file mode 100644
index 49502da0d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAnnotation extends Annotation
-{
- //currently using this when the NestableAnnotation is moved from
- //standalone to nested or from nested to standalone.
- //not the greatest since you have to make sure to call all setter methods
- void initializeFrom(NestableAnnotation oldAnnotation);
-
- /**
- * Should only be called when the NestableAnnotation is actually nested
- * @param newIndex
- */
- void moveAnnotation(int newIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java
deleted file mode 100644
index c6c51173b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverride.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAssociationOverride
- extends AssociationOverrideAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java
deleted file mode 100644
index e36c20e35c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverride.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableAttributeOverride
- extends AttributeOverrideAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java
deleted file mode 100644
index e3dd4c60d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumn.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableJoinColumn extends JoinColumnAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java
deleted file mode 100644
index fcd8d07cf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQuery.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableNamedNativeQuery
- extends NamedNativeQueryAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java
deleted file mode 100644
index 1754fe5248..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQuery.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableNamedQuery
- extends NamedQueryAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java
deleted file mode 100644
index eddbe970d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestablePrimaryKeyJoinColumn
- extends PrimaryKeyJoinColumnAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java
deleted file mode 100644
index c5f2735638..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHint.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableQueryHint
- extends QueryHintAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java
deleted file mode 100644
index 633653c430..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableSecondaryTable
- extends SecondaryTableAnnotation, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java
deleted file mode 100644
index 830f7f77ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraint.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface NestableUniqueConstraint
- extends UniqueConstraint, NestableAnnotation
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToMany.java
deleted file mode 100644
index c4c4c68e10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToMany.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OneToMany extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_MANY;
-
- /**
- * Corresponds to the mappedBy element of the OneToMany annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the OneToMany annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the ITextRange for the mappedBy element. If the mappedBy element
- * does not exist return the ITextRange for the OneToMany annotation.
- */
- TextRange mappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy element does not exist.
- */
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOne.java
deleted file mode 100644
index ace1e3305f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOne.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OneToOne extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_ONE;
-
- /**
- * Corresponds to the optional element of the OneToOne annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the OneToOne annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optionalProperty";
-
- /**
- * Corresponds to the mappedBy element of the OneToOne annotation.
- * Returns null if the mappedBy element does not exist in java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the mappedBy element of the OneToOne annotation.
- * Set to null to remove the mappedBy element.
- */
- void setMappedBy(String mappedBy);
- String MAPPED_BY_PROPERTY = "mappedByProperty";
-
- /**
- * Return the ITextRange for the mappedBy element. If the mappedBy element
- * does not exist return the ITextRange for the OneToOne annotation.
- */
- TextRange mappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the optional element. If the optional element
- * does not exist return the ITextRange for the OneToOne annotation.
- */
- TextRange optionalTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the mappedBy element.
- * Return false if the mappedBy element does not exist.
- */
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderBy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderBy.java
deleted file mode 100644
index 2efb1c4e7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderBy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.OrderBy annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrderBy extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.ORDER_BY;
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the javax.persistence.OrderBy annotation.
- * Setting the value to null will not remove the OrderBy annotation
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the ITextRange for the value element. If the value element
- * does not exist return the ITextRange for the OrderBy annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java
deleted file mode 100644
index d1464e8760..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.AttributeOverride annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OverrideAnnotation extends JavaResourceNode
-{
-
- /**
- * Corresponds to the name element of the AttributeOverride annotation.
- * Returns null if the name element does not exist in java.
- */
- String getName();
-
- /**
- * Corresponds to the name element of the AttributeOverride annotation.
- * Set to null to remove the name element.
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Return the ITextRange for the name element. If name element
- * does not exist return the ITextRange for the AttributeOverride annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the table element.
- * Return false if the table element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 9ddd04ba8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PrimaryKeyJoinColumnAnnotation extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMN;
-
- String getReferencedColumnName();
-
- void setReferencedColumnName(String referencedColumnName);
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnNameProperty";
-
- /**
- * Return whether the specified postition touches the referencedColumnName element.
- * Return false if the referencedColumnName element does not exist.
- */
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the referencedColumnName element. If the referencedColumnName
- * element does not exist return the ITextRange for the PrimaryKeyJoinColumn annotation.
- */
- TextRange referencedColumnNameTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumns.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumns.java
deleted file mode 100644
index 69eb380186..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumns.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PrimaryKeyJoinColumns extends ContainerAnnotation<NestablePrimaryKeyJoinColumn>
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMNS;
-
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumnsList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java
deleted file mode 100644
index 5306096d09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface QueryAnnotation extends JavaResourceNode
-{
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- String getQuery();
- void setQuery(String query);
- String QUERY_PROPERTY = "queryProperty";
-
- ListIterator<QueryHintAnnotation> hints();
-
- QueryHintAnnotation hintAt(int index);
-
- int indexOfHint(QueryHintAnnotation hint);
-
- int hintsSize();
-
- QueryHintAnnotation addHint(int index);
-
- void removeHint(int index);
-
- void moveHint(int targetIndex, int sourceIndex);
- String HINTS_LIST = "hintsList";
-
- /**
- * Return the ITextRange for the name element. If name element
- * does not exist return the ITextRange for the *Query annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the query element. If query element
- * does not exist return the ITextRange for the *Query annotation.
- */
- TextRange queryTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java
deleted file mode 100644
index 1131097180..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.QueryHint annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface QueryHintAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.QUERY_HINT;
-
- /**
- * Corresponds to the name element of the QueryHint annotation.
- * Returns null if the name valuePair does not exist in the annotation
- */
- String getName();
-
- /**
- * Corresponds to the name element of the QueryHint annotation.
- * Setting to null will remove the name valuePair
- */
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- /**
- * Corresponds to the value element of the QueryHint annotation.
- * Returns null if the value valuePair does not exist in the annotation
- */
- String getValue();
-
- /**
- * Corresponds to the value element of the QueryHint annotation.
- * Setting to null will remove the value valuePair
- */
- void setValue(String value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the QueryHint annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the value element. If the value element
- * does not exist return the ITextRange for the QueryHint annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java
deleted file mode 100644
index 56ff625ee0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface RelationshipMappingAnnotation extends JavaResourceNode
-{
- /**
- * Corresponds to the targetEntity element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Returns null if the targetEntity element does not exist in java.
- * Returns the portion of the targetEntity preceding the .class.
- * <p>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </p>
- * will return "Employee"
- **/
- String getTargetEntity();
-
- /**
- * Corresponds to the targetEntity of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Set to null to remove the targetEntity element.
- */
- void setTargetEntity(String targetEntity);
- String TARGET_ENTITY_PROPERTY = "targetEntityProperty";
-
- /**
- * Returns the qualified targetEntity name as it is resolved in the AST
- * <p>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </p>
- * will return "model.Employee" if there is an import for model.Employee
- * @return
- */
- String getFullyQualifiedTargetEntity();
- String FULLY_QUALFIEID_TARGET_ENTITY_PROPERTY = "fullyQualifiedTargetEntityProperty";
-
- /**
- * Corresponds to the fetch element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Returns null if the fetch element does not exist in java.
- */
- FetchType getFetch();
-
- /**
- * Corresponds to the fetch element of the relationship
- * annotations (ManyToMany, OneToMany, ManyToOne, OneToOne).
- * Set to null to remove the fetch element.
- */
- void setFetch(FetchType fetch);
- String FETCH_PROPERTY = "fetchProperty";
-
- boolean isCascadeAll();
- void setCascadeAll(boolean all);
- String CASCADE_ALL_PROPERTY = "cascadeAllProperty";
-
- boolean isCascadeMerge();
- void setCascadeMerge(boolean merge);
- String CASCADE_MERGE_PROPERTY = "cascadeMergeProperty";
-
- boolean isCascadePersist();
- void setCascadePersist(boolean persist);
- String CASCADE_PERSIST_PROPERTY = "cascadePersistProperty";
-
- boolean isCascadeRefresh();
- void setCascadeRefresh(boolean refresh);
- String CASCADE_REFRESH_PROPERTY = "cascadeRefreshProperty";
-
- boolean isCascadeRemove();
- void setCascadeRemove(boolean remove);
- String CASCADE_REMOVE_PROPERTY = "cascadeRemoveProperty";
-
-
- /**
- * Return the ITextRange for the targetEntity element. If the targetEntity element
- * does not exist return the ITextRange for the mapping annotation.
- */
- TextRange targetEntityTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the fetch element. If the fetch element
- * does not exist return the ITextRange for the mapping annotation.
- */
- TextRange fetchTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the cascade element. If the cascade element
- * does not exist return the ITextRange for the mapping annotation.
- */
- TextRange cascadeTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java
deleted file mode 100644
index 99ff95b8ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SecondaryTableAnnotation extends TableAnnotation
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLE;
-
- ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns();
-
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index);
-
- int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn);
-
- int pkJoinColumnsSize();
-
- PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index);
-
- void removePkJoinColumn(int index);
-
- void movePkJoinColumn(int targetIndex, int sourceIndex);
-
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumnsList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTables.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTables.java
deleted file mode 100644
index a1315b2ff8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTables.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SecondaryTables extends ContainerAnnotation<NestableSecondaryTable>
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLES;
-
- String SECONDARY_TABLES_LIST = "secondaryTablesList";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
deleted file mode 100644
index cf7d099f03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.SequenceGenerator annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SequenceGeneratorAnnotation extends GeneratorAnnotation
-{
- String ANNOTATION_NAME = JPA.SEQUENCE_GENERATOR;
-
- /**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Returns null if the sequenceName element does not exist in java. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
- */
- String getSequenceName();
-
- /**
- * Corresponds to the sequenceName element of the SequenceGenerator annotation.
- * Set to null to remove the sequenceName element. If no other memberValuePairs exist
- * the SequenceGenerator annotation will be removed as well.
- */
- void setSequenceName(String sequenceName);
- String SEQUENCE_NAME_PROPERTY = "sequenceNameProperty";
-
- /**
- * Return the ITextRange for the sequenceName element. If the sequenceName element
- * does not exist return the ITextRange for the SequenceGenerator annotation.
- */
- TextRange sequenceNameTextRange(CompilationUnit astRoot);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java
deleted file mode 100644
index 355a028aa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TableAnnotation extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.TABLE;
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "nameProperty";
-
- String getCatalog();
- void setCatalog(String catalog);
- String CATALOG_PROPERTY = "catalogProperty";
-
- String getSchema();
- void setSchema(String schema);
- String SCHEMA_PROPERTY = "schemaProperty";
-
- ListIterator<UniqueConstraint> uniqueConstraints();
-
- UniqueConstraint uniqueConstraintAt(int index);
-
- int indexOfUniqueConstraint(UniqueConstraint uniqueConstraint);
-
- int uniqueConstraintsSize();
-
- UniqueConstraint addUniqueConstraint(int index);
-
- void removeUniqueConstraint(int index);
-
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraintsList";
-
- /**
- * Return the ITextRange for the name element. If the name element
- * does not exist return the ITextRange for the *Table annotation.
- */
- TextRange nameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the catalog element. If the catalog element
- * does not exist return the ITextRange for the *Table annotation.
- */
- TextRange catalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the schema element. If the schema element
- * does not exist return the ITextRange for the *Table annotation.
- */
- TextRange schemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the name element.
- * Return false if the name element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the schema element.
- * Return false if the name element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return whether the specified postition touches the catalog element.
- * Return false if the name element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
deleted file mode 100644
index 8e23cb6cd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.TableGenerator annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TableGeneratorAnnotation extends GeneratorAnnotation
-{
-
- String ANNOTATION_NAME = JPA.TABLE_GENERATOR;
-
- /**
- * Corresponds to the table element of the TableGenerator annotation.
- * Returns null if the table element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getTable();
-
- /**
- * Corresponds to the table element of the TableGenerator annotation.
- * Set to null to remove the table element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setTable(String table);
- String TABLE_PROPERTY = "tableProperty";
-
- /**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Returns null if the catalog element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getCatalog();
-
- /**
- * Corresponds to the catalog element of the TableGenerator annotation.
- * Set to null to remove the catalog element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setCatalog(String catalog);
- String CATALOG_PROPERTY = "catalogProperty";
-
- /**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Returns null if the schema element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getSchema();
-
- /**
- * Corresponds to the schema element of the TableGenerator annotation.
- * Set to null to remove the schema element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setSchema(String schema);
- String SCHEMA_PROPERTY = "schemaProperty";
-
- /**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Returns null if the pkColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getPkColumnName();
-
- /**
- * Corresponds to the pkColumnName element of the TableGenerator annotation.
- * Set to null to remove the pkColumnName element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnName(String pkColumnName);
- String PK_COLUMN_NAME_PROPERTY = "pkColumnNameProperty";
-
- /**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Returns null if the valueColumnName element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getValueColumnName();
-
- /**
- * Corresponds to the valueColumnName element of the TableGenerator annotation.
- * Set to null to remove the valueColumnName element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setValueColumnName(String valueColumnName);
- String VALUE_COLUMN_NAME_PROPERTY = "valueColumnNameProperty";
-
- /**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Returns null if the pkColumnValue element does not exist in java. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- String getPkColumnValue();
-
- /**
- * Corresponds to the pkColumnValue element of the TableGenerator annotation.
- * Set to null to remove the pkColumnValue element. If no other memberValuePairs exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnValue(String pkColumnValue);
- String PK_COLUMN_VALUE_PROPERTY = "pkColumnValueProperty";
-
- ListIterator<UniqueConstraint> uniqueConstraints();
-
- UniqueConstraint uniqueConstraintAt(int index);
-
- int indexOfUniqueConstraint(UniqueConstraint uniqueConstraint);
-
- int uniqueConstraintsSize();
-
- UniqueConstraint addUniqueConstraint(int index);
-
- void removeUniqueConstraint(int index);
-
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraintsList";
-
- /**
- * Return the ITextRange for the table element. If the table element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange tableTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the catalog element. If the catalog element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange catalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the schema element. If the schema element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange schemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the pkColumnName element. If the pkColumnName element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange pkColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the valueColumnName element. If the valueColumnName element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange valueColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return the ITextRange for the pkColumnValue element. If the pkColumnValue element
- * does not exist return the ITextRange for the TableGenerator annotation.
- */
- TextRange pkColumnValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Temporal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Temporal.java
deleted file mode 100644
index 0f69bba444..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Temporal.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.TextRange;
-
-/**
- * Corresponds to the javax.persistence.Temporal annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Temporal extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.TEMPORAL;
-
- /**
- * Corresponds to the value element of the Temporal annotation.
- * Returns null if the value element does not exist in java.
- */
- TemporalType getValue();
-
- /**
- * Corresponds to the value element of the Temporal annotation.
- * Set to null to remove the value element.
- */
- void setValue(TemporalType value);
- String VALUE_PROPERTY = "valueProperty";
-
- /**
- * Return the ITextRange for the value element. If the value element
- * does not exist return the ITextRange for the Temporal annotation.
- */
- TextRange valueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java
deleted file mode 100644
index d658f4389c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public enum TemporalType {
-
- DATE,
- TIME,
- TIMESTAMP;
-
-
- public static TemporalType fromJavaAnnotationValue(Object javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- return null;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__DATE)) {
- return DATE;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIME)) {
- return TIME;
- }
- if (javaAnnotationValue.equals(JPA.TEMPORAL_TYPE__TIMESTAMP)) {
- return TIMESTAMP;
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(TemporalType temporalType) {
- if (temporalType == null) {
- return null;
- }
- switch (temporalType) {
- case DATE :
- return JPA.TEMPORAL_TYPE__DATE;
- case TIME :
- return JPA.TEMPORAL_TYPE__TIME;
- case TIMESTAMP :
- return JPA.TEMPORAL_TYPE__TIMESTAMP;
- default :
- throw new IllegalArgumentException("unknown temporal type: " + temporalType);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Transient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Transient.java
deleted file mode 100644
index 70e947f27d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Transient.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.Transient annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Transient extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.TRANSIENT;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraint.java
deleted file mode 100644
index 794f6527a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraint.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Corresponds to the javax.persistence.UniqueConstraint annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface UniqueConstraint extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.UNIQUE_CONSTRAINT;
-
- ListIterator<String> columnNames();
-
- int columnNamesSize();
-
- void addColumnName(String columnName);
-
- void removeColumnName(String columnName);
- String COLUMN_NAMES_LIST = "columnNamesList";
-
- /**
- * Return whether the specified postition touches the columnNames element.
- * Return false if the columnNames element does not exist.
- */
- boolean columnNamesTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Version.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Version.java
deleted file mode 100644
index 1d8170c140..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Version.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.java;
-
-/**
- * Corresponds to the javax.persistence.Version annotation
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Version extends JavaResourceNode
-{
- String ANNOTATION_NAME = JPA.VERSION;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
deleted file mode 100644
index 23c41312f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Abstract Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlAbstractColumn extends AbstractXmlNamedColumn implements XmlAbstractColumn
-{
- /**
- * The default value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected static final Boolean INSERTABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected Boolean insertable = INSERTABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected static final Boolean NULLABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected Boolean nullable = NULLABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected static final Boolean UNIQUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected Boolean unique = UNIQUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected static final Boolean UPDATABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected Boolean updatable = UPDATABLE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlAbstractColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_ABSTRACT_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insertable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insertable</em>' attribute.
- * @see #setInsertable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Insertable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getInsertable()
- {
- return insertable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn#getInsertable <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insertable</em>' attribute.
- * @see #getInsertable()
- * @generated
- */
- public void setInsertable(Boolean newInsertable)
- {
- Boolean oldInsertable = insertable;
- insertable = newInsertable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE, oldInsertable, insertable));
- }
-
- /**
- * Returns the value of the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Nullable</em>' attribute.
- * @see #setNullable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Nullable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getNullable()
- {
- return nullable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn#getNullable <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Nullable</em>' attribute.
- * @see #getNullable()
- * @generated
- */
- public void setNullable(Boolean newNullable)
- {
- Boolean oldNullable = nullable;
- nullable = newNullable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE, oldNullable, nullable));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUnique()
- {
- return unique;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- public void setUnique(Boolean newUnique)
- {
- Boolean oldUnique = unique;
- unique = newUnique;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE, oldUnique, unique));
- }
-
- /**
- * Returns the value of the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Updatable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Updatable</em>' attribute.
- * @see #setUpdatable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Updatable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUpdatable()
- {
- return updatable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn#getUpdatable <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Updatable</em>' attribute.
- * @see #getUpdatable()
- * @generated
- */
- public void setUpdatable(Boolean newUpdatable)
- {
- Boolean oldUpdatable = updatable;
- updatable = newUpdatable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE, oldUpdatable, updatable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE:
- return getInsertable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- return getNullable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- return getTable();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- return getUnique();
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE:
- return getUpdatable();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE:
- setInsertable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- setNullable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- setUnique((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE:
- setUpdatable((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE:
- setInsertable(INSERTABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- setNullable(NULLABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- setUnique(UNIQUE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE:
- setUpdatable(UPDATABLE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE:
- return INSERTABLE_EDEFAULT == null ? insertable != null : !INSERTABLE_EDEFAULT.equals(insertable);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE:
- return NULLABLE_EDEFAULT == null ? nullable != null : !NULLABLE_EDEFAULT.equals(nullable);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE:
- return UNIQUE_EDEFAULT == null ? unique != null : !UNIQUE_EDEFAULT.equals(unique);
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE:
- return UPDATABLE_EDEFAULT == null ? updatable != null : !UPDATABLE_EDEFAULT.equals(updatable);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAbstractColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE: return OrmPackage.XML_ABSTRACT_COLUMN__INSERTABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE: return OrmPackage.XML_ABSTRACT_COLUMN__NULLABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE: return OrmPackage.XML_ABSTRACT_COLUMN__TABLE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE: return OrmPackage.XML_ABSTRACT_COLUMN__UNIQUE;
- case OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE: return OrmPackage.XML_ABSTRACT_COLUMN__UPDATABLE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAbstractColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ABSTRACT_COLUMN__INSERTABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__NULLABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__TABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__TABLE;
- case OrmPackage.XML_ABSTRACT_COLUMN__UNIQUE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE;
- case OrmPackage.XML_ABSTRACT_COLUMN__UPDATABLE: return OrmPackage.ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (insertable: ");
- result.append(insertable);
- result.append(", nullable: ");
- result.append(nullable);
- result.append(", table: ");
- result.append(table);
- result.append(", unique: ");
- result.append(unique);
- result.append(", updatable: ");
- result.append(updatable);
- result.append(')');
- return result.toString();
- }
-
- public TextRange tableTextRange() {
- IDOMNode tableNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.TABLE);
- return (tableNode == null) ? validationTextRange() : buildTextRange(tableNode);
- }
-} // AbstractXmlAbstractColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
deleted file mode 100644
index b9510eb26d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Attribute Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlAttributeMapping extends AbstractJpaEObject implements XmlAttributeMapping
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlAttributeMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_ATTRIBUTE_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- public TextRange nameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode != null) ? this.buildTextRange(nameNode) : this.validationTextRange();
- }
-
-} // AbstractXmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
deleted file mode 100644
index 9bba6cb284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Base Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlBaseTable extends AbstractJpaEObject implements XmlBaseTable
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUniqueConstraints()
- * @generated
- * @ordered
- */
- protected EList<UniqueConstraint> uniqueConstraints;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlBaseTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_BASE_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_BASE_TABLE__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.UniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- public EList<UniqueConstraint> getUniqueConstraints()
- {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<UniqueConstraint>(UniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS);
- }
- return uniqueConstraints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS:
- return ((InternalEList<?>)getUniqueConstraints()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__NAME:
- return getName();
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- return getCatalog();
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- return getSchema();
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS:
- return getUniqueConstraints();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- getUniqueConstraints().addAll((Collection<? extends UniqueConstraint>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS:
- return uniqueConstraints != null && !uniqueConstraints.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", schema: ");
- result.append(schema);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange nameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode);
- }
-
- public TextRange catalogTextRange() {
- IDOMNode catalogNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.CATALOG);
- return (catalogNode == null) ? validationTextRange() : buildTextRange(catalogNode);
- }
-
- public TextRange schemaTextRange() {
- IDOMNode schemaNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.SCHEMA);
- return (schemaNode == null) ? validationTextRange() : buildTextRange(schemaNode);
- }
-
-} // AbstractXmlBaseTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
deleted file mode 100644
index 29a3d699f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Named Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlNamedColumn extends AbstractJpaEObject implements XmlNamedColumn
-{
- /**
- * The default value of the '{@link #getColumnDefinition() <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnDefinition()
- * @generated
- * @ordered
- */
- protected static final String COLUMN_DEFINITION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getColumnDefinition() <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnDefinition()
- * @generated
- * @ordered
- */
- protected String columnDefinition = COLUMN_DEFINITION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlNamedColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_NAMED_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Definition</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Definition</em>' attribute.
- * @see #setColumnDefinition(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn_ColumnDefinition()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getColumnDefinition()
- {
- return columnDefinition;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getColumnDefinition <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column Definition</em>' attribute.
- * @see #getColumnDefinition()
- * @generated
- */
- public void setColumnDefinition(String newColumnDefinition)
- {
- String oldColumnDefinition = columnDefinition;
- columnDefinition = newColumnDefinition;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION, oldColumnDefinition, columnDefinition));
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- return getColumnDefinition();
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- setColumnDefinition((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- setColumnDefinition(COLUMN_DEFINITION_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- return COLUMN_DEFINITION_EDEFAULT == null ? columnDefinition != null : !COLUMN_DEFINITION_EDEFAULT.equals(columnDefinition);
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnDefinition: ");
- result.append(columnDefinition);
- result.append(", name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- public TextRange nameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode == null) ? validationTextRange() : buildTextRange(nameNode);
- }
-
-} // AbstractXmlNamedColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
deleted file mode 100644
index 23f8a7d94c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Type Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess <em>Access</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @model kind="class" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public abstract class AbstractXmlTypeMapping extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMetadataComplete() <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMetadataComplete()
- * @generated
- * @ordered
- */
- protected static final Boolean METADATA_COMPLETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMetadataComplete() <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMetadataComplete()
- * @generated
- * @ordered
- */
- protected Boolean metadataComplete = METADATA_COMPLETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributes()
- * @generated
- * @ordered
- */
- protected Attributes attributes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlTypeMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_TYPE_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The default value is <code>"PROPERTY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping_Access()
- * @model default="PROPERTY"
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Metadata Complete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Metadata Complete</em>' attribute.
- * @see #setMetadataComplete(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping_MetadataComplete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMetadataComplete()
- {
- return metadataComplete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Metadata Complete</em>' attribute.
- * @see #getMetadataComplete()
- * @generated
- */
- public void setMetadataComplete(Boolean newMetadataComplete)
- {
- Boolean oldMetadataComplete = metadataComplete;
- metadataComplete = newMetadataComplete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE, oldMetadataComplete, metadataComplete));
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference.
- * @see #setAttributes(Attributes)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping_Attributes()
- * @model containment="true"
- * @generated
- */
- public Attributes getAttributes()
- {
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAttributes(Attributes newAttributes, NotificationChain msgs)
- {
- Attributes oldAttributes = attributes;
- attributes = newAttributes;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, oldAttributes, newAttributes);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes <em>Attributes</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attributes</em>' containment reference.
- * @see #getAttributes()
- * @generated
- */
- public void setAttributes(Attributes newAttributes)
- {
- if (newAttributes != attributes)
- {
- NotificationChain msgs = null;
- if (attributes != null)
- msgs = ((InternalEObject)attributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, null, msgs);
- if (newAttributes != null)
- msgs = ((InternalEObject)newAttributes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, null, msgs);
- msgs = basicSetAttributes(newAttributes, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, newAttributes, newAttributes));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return basicSetAttributes(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- return getClassName();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return getAccess();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- return getMetadataComplete();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- return getDescription();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return getAttributes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- setClassName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- setMetadataComplete((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- setAttributes((Attributes)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- setMetadataComplete(METADATA_COMPLETE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- setAttributes((Attributes)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- return METADATA_COMPLETE_EDEFAULT == null ? metadataComplete != null : !METADATA_COMPLETE_EDEFAULT.equals(metadataComplete);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return attributes != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(", access: ");
- result.append(access);
- result.append(", metadataComplete: ");
- result.append(metadataComplete);
- result.append(", description: ");
- result.append(description);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange classTextRange() {
- IDOMNode classNode = (IDOMNode) DOMUtilities.getChildAttributeNode(node, OrmXmlMapper.CLASS);
- if (classNode != null) {
- return buildTextRange(classNode);
- }
- return validationTextRange();
- }
-
- public TextRange attributesTextRange() {
- IDOMNode attributesNode = (IDOMNode) DOMUtilities.getNodeChild(node, OrmXmlMapper.ATTRIBUTES);
- if (attributesNode != null) {
- return buildTextRange(attributesNode);
- }
- return validationTextRange();
- }
-
-} // TypeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java
deleted file mode 100644
index aae4803e05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Access Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @model
- * @generated
- */
-public enum AccessType implements Enumerator
-{
- /**
- * The '<em><b>PROPERTY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PROPERTY_VALUE
- * @generated
- * @ordered
- */
- PROPERTY(0, "PROPERTY", "PROPERTY"),
-
- /**
- * The '<em><b>FIELD</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #FIELD_VALUE
- * @generated
- * @ordered
- */
- FIELD(1, "FIELD", "FIELD");
-
- /**
- * The '<em><b>PROPERTY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PROPERTY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PROPERTY
- * @model
- * @generated
- * @ordered
- */
- public static final int PROPERTY_VALUE = 0;
-
- /**
- * The '<em><b>FIELD</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>FIELD</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #FIELD
- * @model
- * @generated
- * @ordered
- */
- public static final int FIELD_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Access Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final AccessType[] VALUES_ARRAY =
- new AccessType[]
- {
- PROPERTY,
- FIELD,
- };
-
- /**
- * A public read-only list of all the '<em><b>Access Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<AccessType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- AccessType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- AccessType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType get(int value)
- {
- switch (value)
- {
- case PROPERTY_VALUE: return PROPERTY;
- case FIELD_VALUE: return FIELD;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private AccessType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java
deleted file mode 100644
index a3845c7342..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,608 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attributes</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getIds <em>Ids</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds <em>Embedded Ids</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getBasics <em>Basics</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getVersions <em>Versions</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes <em>Many To Ones</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys <em>One To Manys</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes <em>One To Ones</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys <em>Many To Manys</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds <em>Embeddeds</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getTransients <em>Transients</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class Attributes extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getIds() <em>Ids</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIds()
- * @generated
- * @ordered
- */
- protected EList<XmlId> ids;
-
- /**
- * The cached value of the '{@link #getEmbeddedIds() <em>Embedded Ids</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddedIds()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbeddedId> embeddedIds;
-
- /**
- * The cached value of the '{@link #getBasics() <em>Basics</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasics()
- * @generated
- * @ordered
- */
- protected EList<XmlBasic> basics;
-
- /**
- * The cached value of the '{@link #getVersions() <em>Versions</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersions()
- * @generated
- * @ordered
- */
- protected EList<XmlVersion> versions;
-
- /**
- * The cached value of the '{@link #getManyToOnes() <em>Many To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getManyToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlManyToOne> manyToOnes;
-
- /**
- * The cached value of the '{@link #getOneToManys() <em>One To Manys</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOneToManys()
- * @generated
- * @ordered
- */
- protected EList<XmlOneToMany> oneToManys;
-
- /**
- * The cached value of the '{@link #getOneToOnes() <em>One To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOneToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlOneToOne> oneToOnes;
-
- /**
- * The cached value of the '{@link #getManyToManys() <em>Many To Manys</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getManyToManys()
- * @generated
- * @ordered
- */
- protected EList<XmlManyToMany> manyToManys;
-
- /**
- * The cached value of the '{@link #getEmbeddeds() <em>Embeddeds</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddeds()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbedded> embeddeds;
-
- /**
- * The cached value of the '{@link #getTransients() <em>Transients</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransients()
- * @generated
- * @ordered
- */
- protected EList<XmlTransient> transients;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Attributes()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ATTRIBUTES;
- }
-
- /**
- * Returns the value of the '<em><b>Ids</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlId}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Ids</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Ids</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Ids()
- * @model containment="true"
- * @generated
- */
- public EList<XmlId> getIds()
- {
- if (ids == null)
- {
- ids = new EObjectContainmentEList<XmlId>(XmlId.class, this, OrmPackage.ATTRIBUTES__IDS);
- }
- return ids;
- }
-
- /**
- * Returns the value of the '<em><b>Embedded Ids</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embedded Ids</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Embedded Ids</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_EmbeddedIds()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbeddedId> getEmbeddedIds()
- {
- if (embeddedIds == null)
- {
- embeddedIds = new EObjectContainmentEList<XmlEmbeddedId>(XmlEmbeddedId.class, this, OrmPackage.ATTRIBUTES__EMBEDDED_IDS);
- }
- return embeddedIds;
- }
-
- /**
- * Returns the value of the '<em><b>Basics</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlBasic}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basics</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Basics</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Basics()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasic> getBasics()
- {
- if (basics == null)
- {
- basics = new EObjectContainmentEList<XmlBasic>(XmlBasic.class, this, OrmPackage.ATTRIBUTES__BASICS);
- }
- return basics;
- }
-
- /**
- * Returns the value of the '<em><b>Versions</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlVersion}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Versions</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Versions</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Versions()
- * @model containment="true"
- * @generated
- */
- public EList<XmlVersion> getVersions()
- {
- if (versions == null)
- {
- versions = new EObjectContainmentEList<XmlVersion>(XmlVersion.class, this, OrmPackage.ATTRIBUTES__VERSIONS);
- }
- return versions;
- }
-
- /**
- * Returns the value of the '<em><b>Many To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlManyToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Many To Ones</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Many To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_ManyToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlManyToOne> getManyToOnes()
- {
- if (manyToOnes == null)
- {
- manyToOnes = new EObjectContainmentEList<XmlManyToOne>(XmlManyToOne.class, this, OrmPackage.ATTRIBUTES__MANY_TO_ONES);
- }
- return manyToOnes;
- }
-
- /**
- * Returns the value of the '<em><b>One To Manys</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlOneToMany}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>One To Manys</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>One To Manys</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_OneToManys()
- * @model containment="true"
- * @generated
- */
- public EList<XmlOneToMany> getOneToManys()
- {
- if (oneToManys == null)
- {
- oneToManys = new EObjectContainmentEList<XmlOneToMany>(XmlOneToMany.class, this, OrmPackage.ATTRIBUTES__ONE_TO_MANYS);
- }
- return oneToManys;
- }
-
- /**
- * Returns the value of the '<em><b>One To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlOneToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>One To Ones</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>One To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_OneToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlOneToOne> getOneToOnes()
- {
- if (oneToOnes == null)
- {
- oneToOnes = new EObjectContainmentEList<XmlOneToOne>(XmlOneToOne.class, this, OrmPackage.ATTRIBUTES__ONE_TO_ONES);
- }
- return oneToOnes;
- }
-
- /**
- * Returns the value of the '<em><b>Many To Manys</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlManyToMany}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Many To Manys</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Many To Manys</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_ManyToManys()
- * @model containment="true"
- * @generated
- */
- public EList<XmlManyToMany> getManyToManys()
- {
- if (manyToManys == null)
- {
- manyToManys = new EObjectContainmentEList<XmlManyToMany>(XmlManyToMany.class, this, OrmPackage.ATTRIBUTES__MANY_TO_MANYS);
- }
- return manyToManys;
- }
-
- /**
- * Returns the value of the '<em><b>Embeddeds</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbedded}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embeddeds</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Embeddeds</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Embeddeds()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbedded> getEmbeddeds()
- {
- if (embeddeds == null)
- {
- embeddeds = new EObjectContainmentEList<XmlEmbedded>(XmlEmbedded.class, this, OrmPackage.ATTRIBUTES__EMBEDDEDS);
- }
- return embeddeds;
- }
-
- /**
- * Returns the value of the '<em><b>Transients</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlTransient}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transients</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Transients</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Transients()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTransient> getTransients()
- {
- if (transients == null)
- {
- transients = new EObjectContainmentEList<XmlTransient>(XmlTransient.class, this, OrmPackage.ATTRIBUTES__TRANSIENTS);
- }
- return transients;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__IDS:
- return ((InternalEList<?>)getIds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return ((InternalEList<?>)getEmbeddedIds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__BASICS:
- return ((InternalEList<?>)getBasics()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return ((InternalEList<?>)getVersions()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return ((InternalEList<?>)getManyToOnes()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return ((InternalEList<?>)getOneToManys()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return ((InternalEList<?>)getOneToOnes()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return ((InternalEList<?>)getManyToManys()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return ((InternalEList<?>)getEmbeddeds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return ((InternalEList<?>)getTransients()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__IDS:
- return getIds();
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return getEmbeddedIds();
- case OrmPackage.ATTRIBUTES__BASICS:
- return getBasics();
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return getVersions();
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return getManyToOnes();
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return getOneToManys();
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return getOneToOnes();
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return getManyToManys();
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return getEmbeddeds();
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return getTransients();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__IDS:
- getIds().clear();
- getIds().addAll((Collection<? extends XmlId>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- getEmbeddedIds().clear();
- getEmbeddedIds().addAll((Collection<? extends XmlEmbeddedId>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__BASICS:
- getBasics().clear();
- getBasics().addAll((Collection<? extends XmlBasic>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__VERSIONS:
- getVersions().clear();
- getVersions().addAll((Collection<? extends XmlVersion>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- getManyToOnes().clear();
- getManyToOnes().addAll((Collection<? extends XmlManyToOne>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- getOneToManys().clear();
- getOneToManys().addAll((Collection<? extends XmlOneToMany>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- getOneToOnes().clear();
- getOneToOnes().addAll((Collection<? extends XmlOneToOne>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- getManyToManys().clear();
- getManyToManys().addAll((Collection<? extends XmlManyToMany>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- getEmbeddeds().clear();
- getEmbeddeds().addAll((Collection<? extends XmlEmbedded>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- getTransients().clear();
- getTransients().addAll((Collection<? extends XmlTransient>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__IDS:
- getIds().clear();
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- getEmbeddedIds().clear();
- return;
- case OrmPackage.ATTRIBUTES__BASICS:
- getBasics().clear();
- return;
- case OrmPackage.ATTRIBUTES__VERSIONS:
- getVersions().clear();
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- getManyToOnes().clear();
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- getOneToManys().clear();
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- getOneToOnes().clear();
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- getManyToManys().clear();
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- getEmbeddeds().clear();
- return;
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- getTransients().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__IDS:
- return ids != null && !ids.isEmpty();
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return embeddedIds != null && !embeddedIds.isEmpty();
- case OrmPackage.ATTRIBUTES__BASICS:
- return basics != null && !basics.isEmpty();
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return versions != null && !versions.isEmpty();
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return manyToOnes != null && !manyToOnes.isEmpty();
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return oneToManys != null && !oneToManys.isEmpty();
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return oneToOnes != null && !oneToOnes.isEmpty();
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return manyToManys != null && !manyToManys.isEmpty();
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return embeddeds != null && !embeddeds.isEmpty();
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return transients != null && !transients.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} // Attributes
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java
deleted file mode 100644
index 3de53f776c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Cascade Type</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface CascadeType extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade All</em>' attribute.
- * @see #setCascadeAll(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadeAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade All</em>' attribute.
- * @see #isCascadeAll()
- * @generated
- */
- void setCascadeAll(boolean value);
-
- /**
- * Returns the value of the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Persist</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Persist</em>' attribute.
- * @see #setCascadePersist(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadePersist()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadePersist();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Persist</em>' attribute.
- * @see #isCascadePersist()
- * @generated
- */
- void setCascadePersist(boolean value);
-
- /**
- * Returns the value of the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Merge</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Merge</em>' attribute.
- * @see #setCascadeMerge(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeMerge()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadeMerge();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Merge</em>' attribute.
- * @see #isCascadeMerge()
- * @generated
- */
- void setCascadeMerge(boolean value);
-
- /**
- * Returns the value of the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Remove</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Remove</em>' attribute.
- * @see #setCascadeRemove(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRemove()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadeRemove();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Remove</em>' attribute.
- * @see #isCascadeRemove()
- * @generated
- */
- void setCascadeRemove(boolean value);
-
- /**
- * Returns the value of the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Refresh</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Refresh</em>' attribute.
- * @see #setCascadeRefresh(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRefresh()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadeRefresh();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Refresh</em>' attribute.
- * @see #isCascadeRefresh()
- * @generated
- */
- void setCascadeRefresh(boolean value);
-
-} // CascadeType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java
deleted file mode 100644
index e016287be0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeTypeImpl.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Cascade Type</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @model kind="class"
- * @generated
- */
-public class CascadeTypeImpl extends AbstractJpaEObject implements CascadeType
-{
- /**
- * The default value of the '{@link #isCascadeAll() <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeAll()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeAll() <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeAll()
- * @generated
- * @ordered
- */
- protected boolean cascadeAll = CASCADE_ALL_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_PERSIST_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected boolean cascadePersist = CASCADE_PERSIST_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeMerge() <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeMerge()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_MERGE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeMerge() <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeMerge()
- * @generated
- * @ordered
- */
- protected boolean cascadeMerge = CASCADE_MERGE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeRemove() <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRemove()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_REMOVE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeRemove() <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRemove()
- * @generated
- * @ordered
- */
- protected boolean cascadeRemove = CASCADE_REMOVE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeRefresh() <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRefresh()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_REFRESH_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeRefresh() <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRefresh()
- * @generated
- * @ordered
- */
- protected boolean cascadeRefresh = CASCADE_REFRESH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected CascadeTypeImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.CASCADE_TYPE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade All</em>' attribute.
- * @see #setCascadeAll(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeAll()
- {
- return cascadeAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl#isCascadeAll <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade All</em>' attribute.
- * @see #isCascadeAll()
- * @generated
- */
- public void setCascadeAll(boolean newCascadeAll)
- {
- boolean oldCascadeAll = cascadeAll;
- cascadeAll = newCascadeAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL, oldCascadeAll, cascadeAll));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Persist</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Persist</em>' attribute.
- * @see #setCascadePersist(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadePersist()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadePersist()
- {
- return cascadePersist;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl#isCascadePersist <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Persist</em>' attribute.
- * @see #isCascadePersist()
- * @generated
- */
- public void setCascadePersist(boolean newCascadePersist)
- {
- boolean oldCascadePersist = cascadePersist;
- cascadePersist = newCascadePersist;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST, oldCascadePersist, cascadePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Merge</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Merge</em>' attribute.
- * @see #setCascadeMerge(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeMerge()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeMerge()
- {
- return cascadeMerge;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl#isCascadeMerge <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Merge</em>' attribute.
- * @see #isCascadeMerge()
- * @generated
- */
- public void setCascadeMerge(boolean newCascadeMerge)
- {
- boolean oldCascadeMerge = cascadeMerge;
- cascadeMerge = newCascadeMerge;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE, oldCascadeMerge, cascadeMerge));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Remove</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Remove</em>' attribute.
- * @see #setCascadeRemove(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRemove()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeRemove()
- {
- return cascadeRemove;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl#isCascadeRemove <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Remove</em>' attribute.
- * @see #isCascadeRemove()
- * @generated
- */
- public void setCascadeRemove(boolean newCascadeRemove)
- {
- boolean oldCascadeRemove = cascadeRemove;
- cascadeRemove = newCascadeRemove;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE, oldCascadeRemove, cascadeRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Refresh</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Refresh</em>' attribute.
- * @see #setCascadeRefresh(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRefresh()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeRefresh()
- {
- return cascadeRefresh;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl#isCascadeRefresh <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Refresh</em>' attribute.
- * @see #isCascadeRefresh()
- * @generated
- */
- public void setCascadeRefresh(boolean newCascadeRefresh)
- {
- boolean oldCascadeRefresh = cascadeRefresh;
- cascadeRefresh = newCascadeRefresh;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH, oldCascadeRefresh, cascadeRefresh));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL:
- return isCascadeAll() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- return isCascadePersist() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- return isCascadeMerge() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- return isCascadeRemove() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- return isCascadeRefresh() ? Boolean.TRUE : Boolean.FALSE;
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL:
- setCascadeAll(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- setCascadePersist(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- setCascadeMerge(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- setCascadeRemove(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- setCascadeRefresh(((Boolean)newValue).booleanValue());
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL:
- setCascadeAll(CASCADE_ALL_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- setCascadePersist(CASCADE_PERSIST_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- setCascadeMerge(CASCADE_MERGE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- setCascadeRemove(CASCADE_REMOVE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- setCascadeRefresh(CASCADE_REFRESH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_ALL:
- return cascadeAll != CASCADE_ALL_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_PERSIST:
- return cascadePersist != CASCADE_PERSIST_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_MERGE:
- return cascadeMerge != CASCADE_MERGE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REMOVE:
- return cascadeRemove != CASCADE_REMOVE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE_IMPL__CASCADE_REFRESH:
- return cascadeRefresh != CASCADE_REFRESH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (cascadeAll: ");
- result.append(cascadeAll);
- result.append(", cascadePersist: ");
- result.append(cascadePersist);
- result.append(", cascadeMerge: ");
- result.append(cascadeMerge);
- result.append(", cascadeRemove: ");
- result.append(cascadeRemove);
- result.append(", cascadeRefresh: ");
- result.append(cascadeRefresh);
- result.append(')');
- return result.toString();
- }
-
-} // CascadeType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java
deleted file mode 100644
index 814febfcf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface ColumnMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- XmlColumn getColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- void setColumn(XmlColumn value);
-
-} // ColumnMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java
deleted file mode 100644
index 3650410064..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column Result</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.ColumnResult#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class ColumnResult extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ColumnResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.COLUMN_RESULT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.COLUMN_RESULT__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // ColumnResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java
deleted file mode 100644
index ce4a9a30b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Discriminator Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @model
- * @generated
- */
-public enum DiscriminatorType implements Enumerator
-{
- /**
- * The '<em><b>STRING</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #STRING_VALUE
- * @generated
- * @ordered
- */
- STRING(0, "STRING", "STRING"),
-
- /**
- * The '<em><b>CHAR</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHAR_VALUE
- * @generated
- * @ordered
- */
- CHAR(1, "CHAR", "CHAR"),
-
- /**
- * The '<em><b>INTEGER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INTEGER_VALUE
- * @generated
- * @ordered
- */
- INTEGER(2, "INTEGER", "INTEGER");
-
- /**
- * The '<em><b>STRING</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>STRING</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #STRING
- * @model
- * @generated
- * @ordered
- */
- public static final int STRING_VALUE = 0;
-
- /**
- * The '<em><b>CHAR</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHAR</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHAR
- * @model
- * @generated
- * @ordered
- */
- public static final int CHAR_VALUE = 1;
-
- /**
- * The '<em><b>INTEGER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INTEGER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INTEGER
- * @model
- * @generated
- * @ordered
- */
- public static final int INTEGER_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Discriminator Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final DiscriminatorType[] VALUES_ARRAY =
- new DiscriminatorType[]
- {
- STRING,
- CHAR,
- INTEGER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Discriminator Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<DiscriminatorType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DiscriminatorType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DiscriminatorType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType get(int value)
- {
- switch (value)
- {
- case STRING_VALUE: return STRING;
- case CHAR_VALUE: return CHAR;
- case INTEGER_VALUE: return INTEGER;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private DiscriminatorType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //DiscriminatorType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java
deleted file mode 100644
index b1c58f2959..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java
+++ /dev/null
@@ -1,799 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Listener</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad <em>Post Load</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityListener extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPrePersist() <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrePersist()
- * @generated
- * @ordered
- */
- protected PrePersist prePersist;
-
- /**
- * The cached value of the '{@link #getPostPersist() <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostPersist()
- * @generated
- * @ordered
- */
- protected PostPersist postPersist;
-
- /**
- * The cached value of the '{@link #getPreRemove() <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreRemove()
- * @generated
- * @ordered
- */
- protected PreRemove preRemove;
-
- /**
- * The cached value of the '{@link #getPostRemove() <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostRemove()
- * @generated
- * @ordered
- */
- protected PostRemove postRemove;
-
- /**
- * The cached value of the '{@link #getPreUpdate() <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreUpdate()
- * @generated
- * @ordered
- */
- protected PreUpdate preUpdate;
-
- /**
- * The cached value of the '{@link #getPostUpdate() <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostUpdate()
- * @generated
- * @ordered
- */
- protected PostUpdate postUpdate;
-
- /**
- * The cached value of the '{@link #getPostLoad() <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostLoad()
- * @generated
- * @ordered
- */
- protected PostLoad postLoad;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityListener()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_LISTENER;
- }
-
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PrePersist()
- * @model containment="true"
- * @generated
- */
- public PrePersist getPrePersist()
- {
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrePersist(PrePersist newPrePersist, NotificationChain msgs)
- {
- PrePersist oldPrePersist = prePersist;
- prePersist = newPrePersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_PERSIST, oldPrePersist, newPrePersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- public void setPrePersist(PrePersist newPrePersist)
- {
- if (newPrePersist != prePersist)
- {
- NotificationChain msgs = null;
- if (prePersist != null)
- msgs = ((InternalEObject)prePersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_PERSIST, newPrePersist, newPrePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PostPersist()
- * @model containment="true"
- * @generated
- */
- public PostPersist getPostPersist()
- {
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostPersist(PostPersist newPostPersist, NotificationChain msgs)
- {
- PostPersist oldPostPersist = postPersist;
- postPersist = newPostPersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_PERSIST, oldPostPersist, newPostPersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- public void setPostPersist(PostPersist newPostPersist)
- {
- if (newPostPersist != postPersist)
- {
- NotificationChain msgs = null;
- if (postPersist != null)
- msgs = ((InternalEObject)postPersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_PERSIST, newPostPersist, newPostPersist));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PreRemove()
- * @model containment="true"
- * @generated
- */
- public PreRemove getPreRemove()
- {
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreRemove(PreRemove newPreRemove, NotificationChain msgs)
- {
- PreRemove oldPreRemove = preRemove;
- preRemove = newPreRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_REMOVE, oldPreRemove, newPreRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- public void setPreRemove(PreRemove newPreRemove)
- {
- if (newPreRemove != preRemove)
- {
- NotificationChain msgs = null;
- if (preRemove != null)
- msgs = ((InternalEObject)preRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_REMOVE, newPreRemove, newPreRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PostRemove()
- * @model containment="true"
- * @generated
- */
- public PostRemove getPostRemove()
- {
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostRemove(PostRemove newPostRemove, NotificationChain msgs)
- {
- PostRemove oldPostRemove = postRemove;
- postRemove = newPostRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_REMOVE, oldPostRemove, newPostRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- public void setPostRemove(PostRemove newPostRemove)
- {
- if (newPostRemove != postRemove)
- {
- NotificationChain msgs = null;
- if (postRemove != null)
- msgs = ((InternalEObject)postRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_REMOVE, newPostRemove, newPostRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PreUpdate()
- * @model containment="true"
- * @generated
- */
- public PreUpdate getPreUpdate()
- {
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreUpdate(PreUpdate newPreUpdate, NotificationChain msgs)
- {
- PreUpdate oldPreUpdate = preUpdate;
- preUpdate = newPreUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_UPDATE, oldPreUpdate, newPreUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- public void setPreUpdate(PreUpdate newPreUpdate)
- {
- if (newPreUpdate != preUpdate)
- {
- NotificationChain msgs = null;
- if (preUpdate != null)
- msgs = ((InternalEObject)preUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_UPDATE, newPreUpdate, newPreUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PostUpdate()
- * @model containment="true"
- * @generated
- */
- public PostUpdate getPostUpdate()
- {
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostUpdate(PostUpdate newPostUpdate, NotificationChain msgs)
- {
- PostUpdate oldPostUpdate = postUpdate;
- postUpdate = newPostUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_UPDATE, oldPostUpdate, newPostUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- public void setPostUpdate(PostUpdate newPostUpdate)
- {
- if (newPostUpdate != postUpdate)
- {
- NotificationChain msgs = null;
- if (postUpdate != null)
- msgs = ((InternalEObject)postUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_UPDATE, newPostUpdate, newPostUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener_PostLoad()
- * @model containment="true"
- * @generated
- */
- public PostLoad getPostLoad()
- {
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostLoad(PostLoad newPostLoad, NotificationChain msgs)
- {
- PostLoad oldPostLoad = postLoad;
- postLoad = newPostLoad;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_LOAD, oldPostLoad, newPostLoad);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- public void setPostLoad(PostLoad newPostLoad)
- {
- if (newPostLoad != postLoad)
- {
- NotificationChain msgs = null;
- if (postLoad != null)
- msgs = ((InternalEObject)postLoad).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return basicSetPostLoad(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- return getClassName();
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return getPostLoad();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- setClassName((String)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- setPostLoad((PostLoad)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- setPostLoad((PostLoad)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return postLoad != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(')');
- return result.toString();
- }
-
-} // EntityListener
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java
deleted file mode 100644
index 5fd96f844a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Listeners</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityListeners#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityListeners extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EList<EntityListener> entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityListeners()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_LISTENERS;
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.EntityListener}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Listeners</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EList<EntityListener> getEntityListeners()
- {
- if (entityListeners == null)
- {
- entityListeners = new EObjectContainmentEList<EntityListener>(EntityListener.class, this, OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS);
- }
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return ((InternalEList<?>)getEntityListeners()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- getEntityListeners().clear();
- getEntityListeners().addAll((Collection<? extends EntityListener>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- getEntityListeners().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return entityListeners != null && !entityListeners.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} // EntityListeners
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java
deleted file mode 100644
index 8f7e2cb8d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Result</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults <em>Field Results</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityResult extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected static final String DISCRIMINATOR_COLUMN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected String discriminatorColumn = DISCRIMINATOR_COLUMN_EDEFAULT;
-
- /**
- * The default value of the '{@link #getEntityClass() <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityClass()
- * @generated
- * @ordered
- */
- protected static final String ENTITY_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEntityClass() <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityClass()
- * @generated
- * @ordered
- */
- protected String entityClass = ENTITY_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getFieldResults() <em>Field Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFieldResults()
- * @generated
- * @ordered
- */
- protected EList<FieldResult> fieldResults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_RESULT;
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Column</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Discriminator Column</em>' attribute.
- * @see #setDiscriminatorColumn(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_DiscriminatorColumn()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDiscriminatorColumn()
- {
- return discriminatorColumn;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Column</em>' attribute.
- * @see #getDiscriminatorColumn()
- * @generated
- */
- public void setDiscriminatorColumn(String newDiscriminatorColumn)
- {
- String oldDiscriminatorColumn = discriminatorColumn;
- discriminatorColumn = newDiscriminatorColumn;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, discriminatorColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Class</em>' attribute.
- * @see #setEntityClass(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_EntityClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getEntityClass()
- {
- return entityClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Class</em>' attribute.
- * @see #getEntityClass()
- * @generated
- */
- public void setEntityClass(String newEntityClass)
- {
- String oldEntityClass = entityClass;
- entityClass = newEntityClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_RESULT__ENTITY_CLASS, oldEntityClass, entityClass));
- }
-
- /**
- * Returns the value of the '<em><b>Field Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.FieldResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Field Results</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Field Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_FieldResults()
- * @model containment="true"
- * @generated
- */
- public EList<FieldResult> getFieldResults()
- {
- if (fieldResults == null)
- {
- fieldResults = new EObjectContainmentEList<FieldResult>(FieldResult.class, this, OrmPackage.ENTITY_RESULT__FIELD_RESULTS);
- }
- return fieldResults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return ((InternalEList<?>)getFieldResults()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- return getDiscriminatorColumn();
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- return getEntityClass();
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return getFieldResults();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((String)newValue);
- return;
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- setEntityClass((String)newValue);
- return;
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- getFieldResults().clear();
- getFieldResults().addAll((Collection<? extends FieldResult>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn(DISCRIMINATOR_COLUMN_EDEFAULT);
- return;
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- setEntityClass(ENTITY_CLASS_EDEFAULT);
- return;
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- getFieldResults().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- return DISCRIMINATOR_COLUMN_EDEFAULT == null ? discriminatorColumn != null : !DISCRIMINATOR_COLUMN_EDEFAULT.equals(discriminatorColumn);
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- return ENTITY_CLASS_EDEFAULT == null ? entityClass != null : !ENTITY_CLASS_EDEFAULT.equals(entityClass);
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return fieldResults != null && !fieldResults.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (discriminatorColumn: ");
- result.append(discriminatorColumn);
- result.append(", entityClass: ");
- result.append(entityClass);
- result.append(')');
- return result.toString();
- }
-
-} // EntityResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java
deleted file mode 100644
index 411b2ff4c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Enum Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @model
- * @generated
- */
-public enum EnumType implements Enumerator
-{
- /**
- * The '<em><b>ORDINAL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ORDINAL_VALUE
- * @generated
- * @ordered
- */
- ORDINAL(0, "ORDINAL", "ORDINAL"),
-
- /**
- * The '<em><b>STRING</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #STRING_VALUE
- * @generated
- * @ordered
- */
- STRING(1, "STRING", "STRING");
-
- /**
- * The '<em><b>ORDINAL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ORDINAL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ORDINAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ORDINAL_VALUE = 0;
-
- /**
- * The '<em><b>STRING</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>STRING</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #STRING
- * @model
- * @generated
- * @ordered
- */
- public static final int STRING_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Enum Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final EnumType[] VALUES_ARRAY =
- new EnumType[]
- {
- ORDINAL,
- STRING,
- };
-
- /**
- * A public read-only list of all the '<em><b>Enum Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<EnumType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- EnumType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- EnumType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType get(int value)
- {
- switch (value)
- {
- case ORDINAL_VALUE: return ORDINAL;
- case STRING_VALUE: return STRING;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EnumType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //EnumType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java
deleted file mode 100644
index 5c664a8aff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Event Method</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EventMethod extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getMethodName() <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethodName()
- * @generated
- * @ordered
- */
- protected static final String METHOD_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMethodName() <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethodName()
- * @generated
- * @ordered
- */
- protected String methodName = METHOD_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EventMethod()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.EVENT_METHOD;
- }
-
- /**
- * Returns the value of the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Method Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Method Name</em>' attribute.
- * @see #setMethodName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod_MethodName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getMethodName()
- {
- return methodName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Method Name</em>' attribute.
- * @see #getMethodName()
- * @generated
- */
- public void setMethodName(String newMethodName)
- {
- String oldMethodName = methodName;
- methodName = newMethodName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.EVENT_METHOD__METHOD_NAME, oldMethodName, methodName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- return getMethodName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- setMethodName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- setMethodName(METHOD_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- return METHOD_NAME_EDEFAULT == null ? methodName != null : !METHOD_NAME_EDEFAULT.equals(methodName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (methodName: ");
- result.append(methodName);
- result.append(')');
- return result.toString();
- }
-
-} // EventMethod
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java
deleted file mode 100644
index 54a7e7dccd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Fetch Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @model
- * @generated
- */
-public enum FetchType implements Enumerator
-{
- /**
- * The '<em><b>LAZY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #LAZY_VALUE
- * @generated
- * @ordered
- */
- LAZY(0, "LAZY", "LAZY"),
-
- /**
- * The '<em><b>EAGER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EAGER_VALUE
- * @generated
- * @ordered
- */
- EAGER(1, "EAGER", "EAGER");
-
- /**
- * The '<em><b>LAZY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>LAZY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #LAZY
- * @model
- * @generated
- * @ordered
- */
- public static final int LAZY_VALUE = 0;
-
- /**
- * The '<em><b>EAGER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EAGER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EAGER
- * @model
- * @generated
- * @ordered
- */
- public static final int EAGER_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final FetchType[] VALUES_ARRAY =
- new FetchType[]
- {
- LAZY,
- EAGER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<FetchType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- FetchType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- FetchType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType get(int value)
- {
- switch (value)
- {
- case LAZY_VALUE: return LAZY;
- case EAGER_VALUE: return EAGER;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private FetchType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //FetchType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java
deleted file mode 100644
index 9cca71e590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Field Result</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.FieldResult#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class FieldResult extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getColumn() <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected static final String COLUMN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected String column = COLUMN_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected FieldResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.FIELD_RESULT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.FIELD_RESULT__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' attribute.
- * @see #setColumn(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult_Column()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getColumn()
- {
- return column;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' attribute.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(String newColumn)
- {
- String oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.FIELD_RESULT__COLUMN, oldColumn, column));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- return getName();
- case OrmPackage.FIELD_RESULT__COLUMN:
- return getColumn();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.FIELD_RESULT__COLUMN:
- setColumn((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.FIELD_RESULT__COLUMN:
- setColumn(COLUMN_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.FIELD_RESULT__COLUMN:
- return COLUMN_EDEFAULT == null ? column != null : !COLUMN_EDEFAULT.equals(column);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", column: ");
- result.append(column);
- result.append(')');
- return result.toString();
- }
-
-} // FieldResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java
deleted file mode 100644
index 64941d6e89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Generation Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @model
- * @generated
- */
-public enum GenerationType implements Enumerator
-{
- /**
- * The '<em><b>TABLE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_VALUE
- * @generated
- * @ordered
- */
- TABLE(0, "TABLE", "TABLE"),
-
- /**
- * The '<em><b>SEQUENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEQUENCE_VALUE
- * @generated
- * @ordered
- */
- SEQUENCE(1, "SEQUENCE", "SEQUENCE"),
-
- /**
- * The '<em><b>IDENTITY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IDENTITY_VALUE
- * @generated
- * @ordered
- */
- IDENTITY(2, "IDENTITY", "IDENTITY"),
-
- /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(3, "AUTO", "AUTO");
-
- /**
- * The '<em><b>TABLE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_VALUE = 0;
-
- /**
- * The '<em><b>SEQUENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEQUENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEQUENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int SEQUENCE_VALUE = 1;
-
- /**
- * The '<em><b>IDENTITY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IDENTITY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IDENTITY
- * @model
- * @generated
- * @ordered
- */
- public static final int IDENTITY_VALUE = 2;
-
- /**
- * The '<em><b>AUTO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>AUTO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AUTO
- * @model
- * @generated
- * @ordered
- */
- public static final int AUTO_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Generation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final GenerationType[] VALUES_ARRAY =
- new GenerationType[]
- {
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Generation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<GenerationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- GenerationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- GenerationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType get(int value)
- {
- switch (value)
- {
- case TABLE_VALUE: return TABLE;
- case SEQUENCE_VALUE: return SEQUENCE;
- case IDENTITY_VALUE: return IDENTITY;
- case AUTO_VALUE: return AUTO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private GenerationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //GenerationType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/IdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/IdClass.java
deleted file mode 100644
index f641d507f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/IdClass.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Id Class</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.IdClass#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getIdClass()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class IdClass extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IdClass()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ID_CLASS;
- }
-
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getIdClass_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.IdClass#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ID_CLASS__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ID_CLASS__CLASS_NAME:
- return getClassName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ID_CLASS__CLASS_NAME:
- setClassName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ID_CLASS__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ID_CLASS__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(')');
- return result.toString();
- }
-
-} // IdClass
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java
deleted file mode 100644
index a57e43cbfb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Inheritance</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class Inheritance extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final InheritanceType STRATEGY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStrategy()
- * @generated
- * @ordered
- */
- protected InheritanceType strategy = STRATEGY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Inheritance()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.INHERITANCE;
- }
-
- /**
- * Returns the value of the '<em><b>Strategy</b></em>' attribute.
- * The default value is <code>"SINGLE_TABLE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.InheritanceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Strategy</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see #setStrategy(InheritanceType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance_Strategy()
- * @model default="SINGLE_TABLE"
- * @generated
- */
- public InheritanceType getStrategy()
- {
- return strategy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see #getStrategy()
- * @generated
- */
- public void setStrategy(InheritanceType newStrategy)
- {
- InheritanceType oldStrategy = strategy;
- strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.INHERITANCE__STRATEGY, oldStrategy, strategy));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- return getStrategy();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- setStrategy((InheritanceType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- setStrategy(STRATEGY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- return strategy != STRATEGY_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (strategy: ");
- result.append(strategy);
- result.append(')');
- return result.toString();
- }
-
-} // Inheritance
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java
deleted file mode 100644
index 4d4f250d22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Inheritance Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @model
- * @generated
- */
-public enum InheritanceType implements Enumerator
-{
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE_VALUE
- * @generated
- * @ordered
- */
- SINGLE_TABLE(0, "SINGLE_TABLE", "SINGLE_TABLE"), /**
- * The '<em><b>JOINED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JOINED_VALUE
- * @generated
- * @ordered
- */
- JOINED(1, "JOINED", "JOINED"),
-
- /**
- * The '<em><b>TABLE PER CLASS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_PER_CLASS_VALUE
- * @generated
- * @ordered
- */
- TABLE_PER_CLASS(2, "TABLE_PER_CLASS", "TABLE_PER_CLASS");
-
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SINGLE TABLE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE
- * @model
- * @generated
- * @ordered
- */
- public static final int SINGLE_TABLE_VALUE = 0;
-
- /**
- * The '<em><b>JOINED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JOINED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JOINED
- * @model
- * @generated
- * @ordered
- */
- public static final int JOINED_VALUE = 1;
-
- /**
- * The '<em><b>TABLE PER CLASS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE PER CLASS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE_PER_CLASS
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_PER_CLASS_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Inheritance Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final InheritanceType[] VALUES_ARRAY =
- new InheritanceType[]
- {
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS,
- };
-
- /**
- * A public read-only list of all the '<em><b>Inheritance Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<InheritanceType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- InheritanceType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- InheritanceType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType get(int value)
- {
- switch (value)
- {
- case SINGLE_TABLE_VALUE: return SINGLE_TABLE;
- case JOINED_VALUE: return JOINED;
- case TABLE_PER_CLASS_VALUE: return TABLE_PER_CLASS;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private InheritanceType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //InheritanceType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java
deleted file mode 100644
index 2426020bef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Lob</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getLob()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class Lob extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Lob()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.LOB;
- }
-
-} // Lob
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java
deleted file mode 100644
index 8c45c94d91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Map Key</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.MapKey#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface MapKey extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.MapKey#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // MapKey
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java
deleted file mode 100644
index 824ab2a552..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKeyImpl.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Map Key</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @model kind="class"
- * @generated
- */
-public class MapKeyImpl extends AbstractJpaEObject implements MapKey
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected MapKeyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.MAP_KEY_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.MapKeyImpl#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.MAP_KEY_IMPL__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY_IMPL__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY_IMPL__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // MapKey
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmArtifactEdit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmArtifactEdit.java
deleted file mode 100644
index f0564917f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmArtifactEdit.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.common.JpaArtifactEdit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class OrmArtifactEdit extends JpaArtifactEdit
-{
- /**
- * @param aProject
- * @return an orm artifact for the project aProject.
- * Opened only for read access (no write)
- */
- public static OrmArtifactEdit getArtifactEditForRead(IProject aProject) {
- OrmArtifactEdit artifactEdit = null;
- try {
- artifactEdit = new OrmArtifactEdit(aProject, true);
- }
- catch (IllegalArgumentException iae) {
- // suppress illegal argument exception
- JptCorePlugin.log(iae);
- }
- return artifactEdit;
- }
-
- /**
- * @param aProject
- * @return an orm artifact for the project aProject.
- * Opened for both write and read access
- */
- public static OrmArtifactEdit getArtifactEditForWrite(IProject aProject) {
- OrmArtifactEdit artifactEdit = null;
- try {
- artifactEdit = new OrmArtifactEdit(aProject, false);
- }
- catch (IllegalArgumentException iae) {
- // suppress illegal argument exception
- JptCorePlugin.log(iae);
- }
- return artifactEdit;
- }
-
-
- public OrmArtifactEdit(IProject aProject, boolean toAccessAsReadOnly)
- throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly);
- }
-
-
- @Override
- public OrmResource getResource(IFile file) {
- // This *seems* to do the same basic thing as below, but circumvents the
- // URI munging that ArtifactEditModel does (see bug 209093)
- try {
- OrmResource resource =
- (OrmResource) getArtifactEditModel().createResource(URI.createPlatformResourceURI(file.getFullPath().toString()));
- if (! resource.isLoaded()) {
- resource.load(getArtifactEditModel().getResourceSet().getLoadOptions());
- }
- return resource;
- }
- catch (ClassCastException cce) {
- return null;
- }
- catch (IOException ioe) {
- JptCorePlugin.log(ioe);
- return null;
- }
- }
-
- @Override
- public OrmResource getResource(String fileURI) {
- try {
- return (OrmResource) getArtifactEditModel().getResource(URI.createURI(fileURI));
- }
- catch (ClassCastException cce) {
- return null;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java
deleted file mode 100644
index b95617e455..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java
+++ /dev/null
@@ -1,1047 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage
- * @generated
- */
-public class OrmFactory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrmFactory init()
- {
- try
- {
- OrmFactory theOrmFactory = (OrmFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.orm.xmi");
- if (theOrmFactory != null)
- {
- return theOrmFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new OrmFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case OrmPackage.XML_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case OrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case OrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case OrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case OrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case OrmPackage.XML_ID_IMPL: return (EObject)createXmlIdImpl();
- case OrmPackage.XML_EMBEDDED_ID_IMPL: return (EObject)createXmlEmbeddedIdImpl();
- case OrmPackage.XML_BASIC_IMPL: return (EObject)createXmlBasicImpl();
- case OrmPackage.XML_VERSION_IMPL: return (EObject)createXmlVersionImpl();
- case OrmPackage.XML_MANY_TO_ONE_IMPL: return (EObject)createXmlManyToOneImpl();
- case OrmPackage.XML_ONE_TO_MANY_IMPL: return (EObject)createXmlOneToManyImpl();
- case OrmPackage.XML_ONE_TO_ONE_IMPL: return (EObject)createXmlOneToOneImpl();
- case OrmPackage.XML_MANY_TO_MANY_IMPL: return (EObject)createXmlManyToManyImpl();
- case OrmPackage.XML_EMBEDDED_IMPL: return (EObject)createXmlEmbeddedImpl();
- case OrmPackage.XML_TRANSIENT_IMPL: return (EObject)createXmlTransientImpl();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE: return (EObject)createXmlAssociationOverride();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL: return (EObject)createXmlAttributeOverrideImpl();
- case OrmPackage.CASCADE_TYPE_IMPL: return (EObject)createCascadeTypeImpl();
- case OrmPackage.XML_COLUMN_IMPL: return (EObject)createXmlColumnImpl();
- case OrmPackage.COLUMN_RESULT: return (EObject)createColumnResult();
- case OrmPackage.XML_DISCRIMINATOR_COLUMN: return (EObject)createXmlDiscriminatorColumn();
- case OrmPackage.ENTITY_LISTENERS: return (EObject)createEntityListeners();
- case OrmPackage.ENTITY_LISTENER: return (EObject)createEntityListener();
- case OrmPackage.ENTITY_RESULT: return (EObject)createEntityResult();
- case OrmPackage.EVENT_METHOD: return (EObject)createEventMethod();
- case OrmPackage.FIELD_RESULT: return (EObject)createFieldResult();
- case OrmPackage.XML_GENERATED_VALUE_IMPL: return (EObject)createXmlGeneratedValueImpl();
- case OrmPackage.ID_CLASS: return (EObject)createIdClass();
- case OrmPackage.INHERITANCE: return (EObject)createInheritance();
- case OrmPackage.XML_JOIN_COLUMN_IMPL: return (EObject)createXmlJoinColumnImpl();
- case OrmPackage.XML_JOIN_TABLE_IMPL: return (EObject)createXmlJoinTableImpl();
- case OrmPackage.LOB: return (EObject)createLob();
- case OrmPackage.MAP_KEY_IMPL: return (EObject)createMapKeyImpl();
- case OrmPackage.XML_NAMED_NATIVE_QUERY: return (EObject)createXmlNamedNativeQuery();
- case OrmPackage.XML_NAMED_QUERY: return (EObject)createXmlNamedQuery();
- case OrmPackage.POST_LOAD: return (EObject)createPostLoad();
- case OrmPackage.POST_PERSIST: return (EObject)createPostPersist();
- case OrmPackage.POST_REMOVE: return (EObject)createPostRemove();
- case OrmPackage.POST_UPDATE: return (EObject)createPostUpdate();
- case OrmPackage.PRE_PERSIST: return (EObject)createPrePersist();
- case OrmPackage.PRE_REMOVE: return (EObject)createPreRemove();
- case OrmPackage.PRE_UPDATE: return (EObject)createPreUpdate();
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN: return (EObject)createXmlPrimaryKeyJoinColumn();
- case OrmPackage.XML_QUERY_HINT: return (EObject)createXmlQueryHint();
- case OrmPackage.XML_TABLE: return (EObject)createXmlTable();
- case OrmPackage.XML_SECONDARY_TABLE_IMPL: return (EObject)createXmlSecondaryTableImpl();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL: return (EObject)createXmlSequenceGeneratorImpl();
- case OrmPackage.SQL_RESULT_SET_MAPPING: return (EObject)createSqlResultSetMapping();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL: return (EObject)createXmlTableGeneratorImpl();
- case OrmPackage.UNIQUE_CONSTRAINT: return (EObject)createUniqueConstraint();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case OrmPackage.ACCESS_TYPE:
- return createAccessTypeFromString(eDataType, initialValue);
- case OrmPackage.DISCRIMINATOR_TYPE:
- return createDiscriminatorTypeFromString(eDataType, initialValue);
- case OrmPackage.ENUM_TYPE:
- return createEnumTypeFromString(eDataType, initialValue);
- case OrmPackage.FETCH_TYPE:
- return createFetchTypeFromString(eDataType, initialValue);
- case OrmPackage.GENERATION_TYPE:
- return createGenerationTypeFromString(eDataType, initialValue);
- case OrmPackage.INHERITANCE_TYPE:
- return createInheritanceTypeFromString(eDataType, initialValue);
- case OrmPackage.TEMPORAL_TYPE:
- return createTemporalTypeFromString(eDataType, initialValue);
- case OrmPackage.DISCRIMINATOR_VALUE:
- return createDiscriminatorValueFromString(eDataType, initialValue);
- case OrmPackage.ENUMERATED:
- return createEnumeratedFromString(eDataType, initialValue);
- case OrmPackage.ORDER_BY:
- return createOrderByFromString(eDataType, initialValue);
- case OrmPackage.VERSION_TYPE:
- return createVersionTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case OrmPackage.ACCESS_TYPE:
- return convertAccessTypeToString(eDataType, instanceValue);
- case OrmPackage.DISCRIMINATOR_TYPE:
- return convertDiscriminatorTypeToString(eDataType, instanceValue);
- case OrmPackage.ENUM_TYPE:
- return convertEnumTypeToString(eDataType, instanceValue);
- case OrmPackage.FETCH_TYPE:
- return convertFetchTypeToString(eDataType, instanceValue);
- case OrmPackage.GENERATION_TYPE:
- return convertGenerationTypeToString(eDataType, instanceValue);
- case OrmPackage.INHERITANCE_TYPE:
- return convertInheritanceTypeToString(eDataType, instanceValue);
- case OrmPackage.TEMPORAL_TYPE:
- return convertTemporalTypeToString(eDataType, instanceValue);
- case OrmPackage.DISCRIMINATOR_VALUE:
- return convertDiscriminatorValueToString(eDataType, instanceValue);
- case OrmPackage.ENUMERATED:
- return convertEnumeratedToString(eDataType, instanceValue);
- case OrmPackage.ORDER_BY:
- return convertOrderByToString(eDataType, instanceValue);
- case OrmPackage.VERSION_TYPE:
- return convertVersionTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitMetadata createXmlPersistenceUnitMetadata()
- {
- XmlPersistenceUnitMetadata xmlPersistenceUnitMetadata = new XmlPersistenceUnitMetadata();
- return xmlPersistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitDefaults createXmlPersistenceUnitDefaults()
- {
- XmlPersistenceUnitDefaults xmlPersistenceUnitDefaults = new XmlPersistenceUnitDefaults();
- return xmlPersistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntity createXmlEntity()
- {
- XmlEntity xmlEntity = new XmlEntity();
- return xmlEntity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddable createXmlEmbeddable()
- {
- XmlEmbeddable xmlEmbeddable = new XmlEmbeddable();
- return xmlEmbeddable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Attributes createAttributes()
- {
- Attributes attributes = new Attributes();
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIdImpl createXmlIdImpl()
- {
- XmlIdImpl xmlIdImpl = new XmlIdImpl();
- return xmlIdImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedIdImpl createXmlEmbeddedIdImpl()
- {
- XmlEmbeddedIdImpl xmlEmbeddedIdImpl = new XmlEmbeddedIdImpl();
- return xmlEmbeddedIdImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicImpl createXmlBasicImpl()
- {
- XmlBasicImpl xmlBasicImpl = new XmlBasicImpl();
- return xmlBasicImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersionImpl createXmlVersionImpl()
- {
- XmlVersionImpl xmlVersionImpl = new XmlVersionImpl();
- return xmlVersionImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToOneImpl createXmlManyToOneImpl()
- {
- XmlManyToOneImpl xmlManyToOneImpl = new XmlManyToOneImpl();
- return xmlManyToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToManyImpl createXmlOneToManyImpl()
- {
- XmlOneToManyImpl xmlOneToManyImpl = new XmlOneToManyImpl();
- return xmlOneToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToOneImpl createXmlOneToOneImpl()
- {
- XmlOneToOneImpl xmlOneToOneImpl = new XmlOneToOneImpl();
- return xmlOneToOneImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToManyImpl createXmlManyToManyImpl()
- {
- XmlManyToManyImpl xmlManyToManyImpl = new XmlManyToManyImpl();
- return xmlManyToManyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedImpl createXmlEmbeddedImpl()
- {
- XmlEmbeddedImpl xmlEmbeddedImpl = new XmlEmbeddedImpl();
- return xmlEmbeddedImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransientImpl createXmlTransientImpl()
- {
- XmlTransientImpl xmlTransientImpl = new XmlTransientImpl();
- return xmlTransientImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAssociationOverride createXmlAssociationOverride()
- {
- XmlAssociationOverride xmlAssociationOverride = new XmlAssociationOverride();
- return xmlAssociationOverride;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAttributeOverrideImpl createXmlAttributeOverrideImpl()
- {
- XmlAttributeOverrideImpl xmlAttributeOverrideImpl = new XmlAttributeOverrideImpl();
- return xmlAttributeOverrideImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CascadeTypeImpl createCascadeTypeImpl()
- {
- CascadeTypeImpl cascadeTypeImpl = new CascadeTypeImpl();
- return cascadeTypeImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlColumnImpl createXmlColumnImpl()
- {
- XmlColumnImpl xmlColumnImpl = new XmlColumnImpl();
- return xmlColumnImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ColumnResult createColumnResult()
- {
- ColumnResult columnResult = new ColumnResult();
- return columnResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlDiscriminatorColumn createXmlDiscriminatorColumn()
- {
- XmlDiscriminatorColumn xmlDiscriminatorColumn = new XmlDiscriminatorColumn();
- return xmlDiscriminatorColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityListeners createEntityListeners()
- {
- EntityListeners entityListeners = new EntityListeners();
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityListener createEntityListener()
- {
- EntityListener entityListener = new EntityListener();
- return entityListener;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityResult createEntityResult()
- {
- EntityResult entityResult = new EntityResult();
- return entityResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public FieldResult createFieldResult()
- {
- FieldResult fieldResult = new FieldResult();
- return fieldResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlGeneratedValueImpl createXmlGeneratedValueImpl()
- {
- XmlGeneratedValueImpl xmlGeneratedValueImpl = new XmlGeneratedValueImpl();
- return xmlGeneratedValueImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IdClass createIdClass()
- {
- IdClass idClass = new IdClass();
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Inheritance createInheritance()
- {
- Inheritance inheritance = new Inheritance();
- return inheritance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinColumnImpl createXmlJoinColumnImpl()
- {
- XmlJoinColumnImpl xmlJoinColumnImpl = new XmlJoinColumnImpl();
- return xmlJoinColumnImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinTableImpl createXmlJoinTableImpl()
- {
- XmlJoinTableImpl xmlJoinTableImpl = new XmlJoinTableImpl();
- return xmlJoinTableImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Lob createLob()
- {
- Lob lob = new Lob();
- return lob;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MapKeyImpl createMapKeyImpl()
- {
- MapKeyImpl mapKeyImpl = new MapKeyImpl();
- return mapKeyImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedNativeQuery createXmlNamedNativeQuery()
- {
- XmlNamedNativeQuery xmlNamedNativeQuery = new XmlNamedNativeQuery();
- return xmlNamedNativeQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedQuery createXmlNamedQuery()
- {
- XmlNamedQuery xmlNamedQuery = new XmlNamedQuery();
- return xmlNamedQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EventMethod createEventMethod()
- {
- EventMethod eventMethod = new EventMethod();
- return eventMethod;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostLoad createPostLoad()
- {
- PostLoad postLoad = new PostLoad();
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostPersist createPostPersist()
- {
- PostPersist postPersist = new PostPersist();
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostRemove createPostRemove()
- {
- PostRemove postRemove = new PostRemove();
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostUpdate createPostUpdate()
- {
- PostUpdate postUpdate = new PostUpdate();
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PrePersist createPrePersist()
- {
- PrePersist prePersist = new PrePersist();
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PreRemove createPreRemove()
- {
- PreRemove preRemove = new PreRemove();
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PreUpdate createPreUpdate()
- {
- PreUpdate preUpdate = new PreUpdate();
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPrimaryKeyJoinColumn createXmlPrimaryKeyJoinColumn()
- {
- XmlPrimaryKeyJoinColumn xmlPrimaryKeyJoinColumn = new XmlPrimaryKeyJoinColumn();
- return xmlPrimaryKeyJoinColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlQueryHint createXmlQueryHint()
- {
- XmlQueryHint xmlQueryHint = new XmlQueryHint();
- return xmlQueryHint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTable createXmlTable()
- {
- XmlTable xmlTable = new XmlTable();
- return xmlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSecondaryTableImpl createXmlSecondaryTableImpl()
- {
- XmlSecondaryTableImpl xmlSecondaryTableImpl = new XmlSecondaryTableImpl();
- return xmlSecondaryTableImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSequenceGeneratorImpl createXmlSequenceGeneratorImpl()
- {
- XmlSequenceGeneratorImpl xmlSequenceGeneratorImpl = new XmlSequenceGeneratorImpl();
- return xmlSequenceGeneratorImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SqlResultSetMapping createSqlResultSetMapping()
- {
- SqlResultSetMapping sqlResultSetMapping = new SqlResultSetMapping();
- return sqlResultSetMapping;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTableGeneratorImpl createXmlTableGeneratorImpl()
- {
- XmlTableGeneratorImpl xmlTableGeneratorImpl = new XmlTableGeneratorImpl();
- return xmlTableGeneratorImpl;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public UniqueConstraint createUniqueConstraint()
- {
- UniqueConstraint uniqueConstraint = new UniqueConstraint();
- return uniqueConstraint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AccessType createAccessTypeFromString(EDataType eDataType, String initialValue)
- {
- AccessType result = AccessType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertAccessTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DiscriminatorType createDiscriminatorTypeFromString(EDataType eDataType, String initialValue)
- {
- DiscriminatorType result = DiscriminatorType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertDiscriminatorTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EnumType createEnumTypeFromString(EDataType eDataType, String initialValue)
- {
- EnumType result = EnumType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertEnumTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public FetchType createFetchTypeFromString(EDataType eDataType, String initialValue)
- {
- FetchType result = FetchType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertFetchTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public GenerationType createGenerationTypeFromString(EDataType eDataType, String initialValue)
- {
- GenerationType result = GenerationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertGenerationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public InheritanceType createInheritanceTypeFromString(EDataType eDataType, String initialValue)
- {
- InheritanceType result = InheritanceType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertInheritanceTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TemporalType createTemporalTypeFromString(EDataType eDataType, String initialValue)
- {
- TemporalType result = TemporalType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertTemporalTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createDiscriminatorValueFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertDiscriminatorValueToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Enumerator createEnumeratedFromString(EDataType eDataType, String initialValue)
- {
- return (Enumerator)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertEnumeratedToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createOrderByFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertOrderByToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createVersionTypeFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertVersionTypeToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmPackage getOrmPackage()
- {
- return (OrmPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static OrmPackage getPackage()
- {
- return OrmPackage.eINSTANCE;
- }
-
-} //OrmFactory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java
deleted file mode 100644
index 0217cc0121..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java
+++ /dev/null
@@ -1,13447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmFactory
- * @model kind="package"
- * @generated
- */
-public class OrmPackage extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "orm";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.orm.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.orm";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmPackage eINSTANCE = org.eclipse.jpt.core.resource.orm.OrmPackage.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS = 0;
-
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__VERSION = 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__DESCRIPTION = 1;
-
- /**
- * The feature id for the '<em><b>Persistence Unit Metadata</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = 2;
-
- /**
- * The feature id for the '<em><b>Package</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PACKAGE = 3;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SCHEMA = 4;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__CATALOG = 5;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ACCESS = 6;
-
- /**
- * The feature id for the '<em><b>Sequence Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS = 7;
-
- /**
- * The feature id for the '<em><b>Table Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TABLE_GENERATORS = 8;
-
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_QUERIES = 9;
-
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES = 10;
-
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS = 11;
-
- /**
- * The feature id for the '<em><b>Mapped Superclasses</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES = 12;
-
- /**
- * The feature id for the '<em><b>Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ENTITIES = 13;
-
- /**
- * The feature id for the '<em><b>Embeddables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__EMBEDDABLES = 14;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_FEATURE_COUNT = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA = 1;
-
- /**
- * The feature id for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = 0;
-
- /**
- * The feature id for the '<em><b>Persistence Unit Defaults</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Metadata</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 2;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA = 0;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG = 1;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS = 2;
-
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = 3;
-
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS = 4;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING = 3;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME = 0;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING__ACCESS = 1;
-
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE = 2;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION = 3;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES = 4;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Type Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 4;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CLASS_NAME = ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ACCESS = ABSTRACT_XML_TYPE_MAPPING__ACCESS;
-
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__METADATA_COMPLETE = ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__DESCRIPTION = ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ATTRIBUTES = ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ID_CLASS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRE_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__POST_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRE_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__POST_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRE_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__POST_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__POST_LOAD = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @generated
- */
- public static final int XML_ENTITY = 5;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLASS_NAME = ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ACCESS = ABSTRACT_XML_TYPE_MAPPING__ACCESS;
-
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__METADATA_COMPLETE = ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DESCRIPTION = ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTES = ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAME = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Secondary Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SECONDARY_TABLES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ID_CLASS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Inheritance</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INHERITANCE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Discriminator Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_VALUE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Discriminator Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SEQUENCE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SQL_RESULT_SET_MAPPINGS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 13;
-
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 14;
-
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ENTITY_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 15;
-
- /**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 16;
-
- /**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 17;
-
- /**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 18;
-
- /**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 19;
-
- /**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 20;
-
- /**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 21;
-
- /**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_LOAD = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 22;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 23;
-
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 24;
-
- /**
- * The number of structural features of the '<em>Xml Entity</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_FEATURE_COUNT = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 25;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final int XML_EMBEDDABLE = 6;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CLASS_NAME = ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ACCESS = ABSTRACT_XML_TYPE_MAPPING__ACCESS;
-
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__METADATA_COMPLETE = ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__DESCRIPTION = ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ATTRIBUTES = ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_FEATURE_COUNT = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Attributes
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @generated
- */
- public static final int ATTRIBUTES = 7;
-
- /**
- * The feature id for the '<em><b>Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__IDS = 0;
-
- /**
- * The feature id for the '<em><b>Embedded Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDED_IDS = 1;
-
- /**
- * The feature id for the '<em><b>Basics</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASICS = 2;
-
- /**
- * The feature id for the '<em><b>Versions</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__VERSIONS = 3;
-
- /**
- * The feature id for the '<em><b>Many To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_ONES = 4;
-
- /**
- * The feature id for the '<em><b>One To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_MANYS = 5;
-
- /**
- * The feature id for the '<em><b>One To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_ONES = 6;
-
- /**
- * The feature id for the '<em><b>Many To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_MANYS = 7;
-
- /**
- * The feature id for the '<em><b>Embeddeds</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDEDS = 8;
-
- /**
- * The feature id for the '<em><b>Transients</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__TRANSIENTS = 9;
-
- /**
- * The number of structural features of the '<em>Attributes</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES_FEATURE_COUNT = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING = 9;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @generated
- */
- public static final int COLUMN_MAPPING = 10;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_MAPPING__COLUMN = 0;
-
- /**
- * The number of structural features of the '<em>Column Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_MAPPING_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @generated
- */
- public static final int XML_RELATIONSHIP_MAPPING = 11;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__FETCH = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING__CASCADE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @generated
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING = 12;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__NAME = XML_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__FETCH = XML_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Multi Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @generated
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING = 13;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__NAME = XML_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__FETCH = XML_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE = XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Single Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 14;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__GENERATED_VALUE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TABLE_GENERATOR = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__SEQUENCE_GENERATOR = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final int XML_ID_IMPL = 15;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__COLUMN = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__GENERATED_VALUE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__TEMPORAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__TABLE_GENERATOR = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL__SEQUENCE_GENERATOR = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Id Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final int XML_EMBEDDED_ID = 16;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedIdImpl()
- * @generated
- */
- public static final int XML_EMBEDDED_ID_IMPL = 17;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Id Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 18;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__FETCH = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__OPTIONAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__LOB = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ENUMERATED = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Basic</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final int XML_BASIC_IMPL = 19;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__COLUMN = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__LOB = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__TEMPORAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL__ENUMERATED = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Basic Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 20;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__COLUMN = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__TEMPORAL = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Version</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final int XML_VERSION_IMPL = 21;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL__COLUMN = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL__TEMPORAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Version Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final int XML_MANY_TO_ONE = 22;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__NAME = XML_SINGLE_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__FETCH = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_TABLE = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__OPTIONAL = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
-
- /**
- * The number of structural features of the '<em>Xml Many To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_FEATURE_COUNT = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_IMPL = 23;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__TARGET_ENTITY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Many To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 24;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__NAME = XML_MULTI_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
-
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY = XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_COLUMNS = XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml One To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_IMPL = 25;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__TARGET_ENTITY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__ORDER_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__MAP_KEY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The number of structural features of the '<em>Xml One To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final int XML_ONE_TO_ONE = 26;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__NAME = XML_SINGLE_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__FETCH = XML_SINGLE_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_TABLE = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__OPTIONAL = XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPPED_BY = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_FEATURE_COUNT = XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_IMPL = 27;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__TARGET_ENTITY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__OPTIONAL = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The number of structural features of the '<em>Xml One To One Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 28;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__NAME = XML_MULTI_RELATIONSHIP_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING__FETCH;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING__CASCADE;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
-
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY = XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_IMPL = 29;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__TARGET_ENTITY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__JOIN_TABLE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__MAPPED_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__ORDER_BY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL__MAP_KEY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final int XML_EMBEDDED = 30;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ATTRIBUTE_OVERRIDES = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedImpl()
- * @generated
- */
- public static final int XML_EMBEDDED_IMPL = 31;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embedded Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 32;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Transient</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransientImpl <em>Xml Transient Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransientImpl()
- * @generated
- */
- public static final int XML_TRANSIENT_IMPL = 33;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_IMPL__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Transient Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_IMPL_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @generated
- */
- public static final int XML_ASSOCIATION_OVERRIDE = 34;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Xml Association Override</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE = 35;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE__COLUMN = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL = 36;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN = XML_ATTRIBUTE_OVERRIDE__COLUMN;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL__NAME = XML_ATTRIBUTE_OVERRIDE__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_IMPL_FEATURE_COUNT = XML_ATTRIBUTE_OVERRIDE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @generated
- */
- public static final int CASCADE_TYPE = 37;
-
- /**
- * The feature id for the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_ALL = 0;
-
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_PERSIST = 1;
-
- /**
- * The feature id for the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_MERGE = 2;
-
- /**
- * The feature id for the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_REMOVE = 3;
-
- /**
- * The feature id for the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_REFRESH = 4;
-
- /**
- * The number of structural features of the '<em>Cascade Type</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_FEATURE_COUNT = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl <em>Cascade Type Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @generated
- */
- public static final int CASCADE_TYPE_IMPL = 38;
-
- /**
- * The feature id for the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL__CASCADE_ALL = CASCADE_TYPE__CASCADE_ALL;
-
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL__CASCADE_PERSIST = CASCADE_TYPE__CASCADE_PERSIST;
-
- /**
- * The feature id for the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL__CASCADE_MERGE = CASCADE_TYPE__CASCADE_MERGE;
-
- /**
- * The feature id for the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL__CASCADE_REMOVE = CASCADE_TYPE__CASCADE_REMOVE;
-
- /**
- * The feature id for the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL__CASCADE_REFRESH = CASCADE_TYPE__CASCADE_REFRESH;
-
- /**
- * The number of structural features of the '<em>Cascade Type Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_IMPL_FEATURE_COUNT = CASCADE_TYPE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @generated
- */
- public static final int XML_NAMED_COLUMN = 39;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_COLUMN__COLUMN_DEFINITION = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_COLUMN__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Xml Named Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_COLUMN_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @generated
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN = 40;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION = XML_NAMED_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN__NAME = XML_NAMED_COLUMN__NAME;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Named Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT = XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @generated
- */
- public static final int XML_ABSTRACT_COLUMN = 41;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__COLUMN_DEFINITION = XML_NAMED_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__NAME = XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__INSERTABLE = XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__NULLABLE = XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__TABLE = XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__UNIQUE = XML_NAMED_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN__UPDATABLE = XML_NAMED_COLUMN_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Abstract Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ABSTRACT_COLUMN_FEATURE_COUNT = XML_NAMED_COLUMN_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @generated
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN = 42;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__TABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Abstract Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @generated
- */
- public static final int XML_COLUMN = 43;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__COLUMN_DEFINITION = XML_ABSTRACT_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__NAME = XML_ABSTRACT_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__INSERTABLE = XML_ABSTRACT_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__NULLABLE = XML_ABSTRACT_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__TABLE = XML_ABSTRACT_COLUMN__TABLE;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__UNIQUE = XML_ABSTRACT_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__UPDATABLE = XML_ABSTRACT_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__LENGTH = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__PRECISION = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__SCALE = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_FEATURE_COUNT = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl <em>Xml Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @generated
- */
- public static final int XML_COLUMN_IMPL = 44;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__COLUMN_DEFINITION = ABSTRACT_XML_ABSTRACT_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__NAME = ABSTRACT_XML_ABSTRACT_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__INSERTABLE = ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__NULLABLE = ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__TABLE = ABSTRACT_XML_ABSTRACT_COLUMN__TABLE;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__UNIQUE = ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__UPDATABLE = ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__LENGTH = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__PRECISION = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL__SCALE = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Column Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_IMPL_FEATURE_COUNT = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @generated
- */
- public static final int COLUMN_RESULT = 45;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_RESULT__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Column Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_RESULT_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @generated
- */
- public static final int XML_DISCRIMINATOR_COLUMN = 46;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Discriminator Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Discriminator Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @generated
- */
- public static final int ENTITY_LISTENERS = 47;
-
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENERS__ENTITY_LISTENERS = 0;
-
- /**
- * The number of structural features of the '<em>Entity Listeners</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENERS_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @generated
- */
- public static final int ENTITY_LISTENER = 48;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__CLASS_NAME = 0;
-
- /**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__PRE_PERSIST = 1;
-
- /**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__POST_PERSIST = 2;
-
- /**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__PRE_REMOVE = 3;
-
- /**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__POST_REMOVE = 4;
-
- /**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__PRE_UPDATE = 5;
-
- /**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__POST_UPDATE = 6;
-
- /**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__POST_LOAD = 7;
-
- /**
- * The number of structural features of the '<em>Entity Listener</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER_FEATURE_COUNT = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @generated
- */
- public static final int ENTITY_RESULT = 49;
-
- /**
- * The feature id for the '<em><b>Discriminator Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__DISCRIMINATOR_COLUMN = 0;
-
- /**
- * The feature id for the '<em><b>Entity Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__ENTITY_CLASS = 1;
-
- /**
- * The feature id for the '<em><b>Field Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__FIELD_RESULTS = 2;
-
- /**
- * The number of structural features of the '<em>Entity Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @generated
- */
- public static final int FIELD_RESULT = 51;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.IdClass <em>Id Class</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.IdClass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getIdClass()
- * @generated
- */
- public static final int ID_CLASS = 54;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @generated
- */
- public static final int INHERITANCE = 55;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getLob()
- * @generated
- */
- public static final int LOB = 60;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @generated
- */
- public static final int MAP_KEY = 61;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @generated
- */
- public static final int EVENT_METHOD = 50;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int EVENT_METHOD__METHOD_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Event Method</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int EVENT_METHOD_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int FIELD_RESULT__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int FIELD_RESULT__COLUMN = 1;
-
- /**
- * The number of structural features of the '<em>Field Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int FIELD_RESULT_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @generated
- */
- public static final int XML_GENERATED_VALUE = 52;
-
- /**
- * The feature id for the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE__GENERATOR = 0;
-
- /**
- * The feature id for the '<em><b>Strategy</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE__STRATEGY = 1;
-
- /**
- * The number of structural features of the '<em>Xml Generated Value</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @generated
- */
- public static final int XML_GENERATED_VALUE_IMPL = 53;
-
- /**
- * The feature id for the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_IMPL__GENERATOR = XML_GENERATED_VALUE__GENERATOR;
-
- /**
- * The feature id for the '<em><b>Strategy</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_IMPL__STRATEGY = XML_GENERATED_VALUE__STRATEGY;
-
- /**
- * The number of structural features of the '<em>Xml Generated Value Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_IMPL_FEATURE_COUNT = XML_GENERATED_VALUE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ID_CLASS__CLASS_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Id Class</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ID_CLASS_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Strategy</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int INHERITANCE__STRATEGY = 0;
-
- /**
- * The number of structural features of the '<em>Inheritance</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int INHERITANCE_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @generated
- */
- public static final int XML_JOIN_COLUMN = 56;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__COLUMN_DEFINITION = XML_ABSTRACT_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__NAME = XML_ABSTRACT_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__INSERTABLE = XML_ABSTRACT_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__NULLABLE = XML_ABSTRACT_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__TABLE = XML_ABSTRACT_COLUMN__TABLE;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__UNIQUE = XML_ABSTRACT_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__UPDATABLE = XML_ABSTRACT_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_FEATURE_COUNT = XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @generated
- */
- public static final int XML_JOIN_COLUMN_IMPL = 57;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__COLUMN_DEFINITION = ABSTRACT_XML_ABSTRACT_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__NAME = ABSTRACT_XML_ABSTRACT_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__INSERTABLE = ABSTRACT_XML_ABSTRACT_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__NULLABLE = ABSTRACT_XML_ABSTRACT_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__TABLE = ABSTRACT_XML_ABSTRACT_COLUMN__TABLE;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__UNIQUE = ABSTRACT_XML_ABSTRACT_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__UPDATABLE = ABSTRACT_XML_ABSTRACT_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Column Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_IMPL_FEATURE_COUNT = ABSTRACT_XML_ABSTRACT_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @generated
- */
- public static final int XML_BASE_TABLE = 76;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE__CATALOG = 1;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE__SCHEMA = 2;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE__UNIQUE_CONSTRAINTS = 3;
-
- /**
- * The number of structural features of the '<em>Xml Base Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASE_TABLE_FEATURE_COUNT = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final int XML_JOIN_TABLE = 58;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__NAME = XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__CATALOG = XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__SCHEMA = XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__UNIQUE_CONSTRAINTS = XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__JOIN_COLUMNS = XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Join Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_FEATURE_COUNT = XML_BASE_TABLE_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @generated
- */
- public static final int ABSTRACT_XML_BASE_TABLE = 75;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE__NAME = XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE__CATALOG = XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE__SCHEMA = XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS = XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Base Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT = XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl <em>Xml Join Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @generated
- */
- public static final int XML_JOIN_TABLE_IMPL = 59;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__NAME = ABSTRACT_XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__CATALOG = ABSTRACT_XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__SCHEMA = ABSTRACT_XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__UNIQUE_CONSTRAINTS = ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Join Table Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_IMPL_FEATURE_COUNT = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Lob</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int LOB_FEATURE_COUNT = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Map Key</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.MapKeyImpl <em>Map Key Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @generated
- */
- public static final int MAP_KEY_IMPL = 62;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY_IMPL__NAME = MAP_KEY__NAME;
-
- /**
- * The number of structural features of the '<em>Map Key Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY_IMPL_FEATURE_COUNT = MAP_KEY_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @generated
- */
- public static final int XML_QUERY = 63;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY__QUERY = 1;
-
- /**
- * The feature id for the '<em><b>Hints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY__HINTS = 2;
-
- /**
- * The number of structural features of the '<em>Xml Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @generated
- */
- public static final int XML_NAMED_NATIVE_QUERY = 64;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__NAME = XML_QUERY__NAME;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__QUERY = XML_QUERY__QUERY;
-
- /**
- * The feature id for the '<em><b>Hints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__HINTS = XML_QUERY__HINTS;
-
- /**
- * The feature id for the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__RESULT_CLASS = XML_QUERY_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = XML_QUERY_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Named Native Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY_FEATURE_COUNT = XML_QUERY_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @generated
- */
- public static final int XML_NAMED_QUERY = 65;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY__NAME = XML_QUERY__NAME;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY__QUERY = XML_QUERY__QUERY;
-
- /**
- * The feature id for the '<em><b>Hints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY__HINTS = XML_QUERY__HINTS;
-
- /**
- * The number of structural features of the '<em>Xml Named Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY_FEATURE_COUNT = XML_QUERY_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostLoad()
- * @generated
- */
- public static final int POST_LOAD = 66;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_LOAD__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Load</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_LOAD_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostPersist()
- * @generated
- */
- public static final int POST_PERSIST = 67;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_PERSIST__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Persist</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_PERSIST_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostRemove()
- * @generated
- */
- public static final int POST_REMOVE = 68;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_REMOVE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Remove</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_REMOVE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostUpdate()
- * @generated
- */
- public static final int POST_UPDATE = 69;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_UPDATE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Update</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_UPDATE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPrePersist()
- * @generated
- */
- public static final int PRE_PERSIST = 70;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_PERSIST__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Persist</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_PERSIST_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreRemove()
- * @generated
- */
- public static final int PRE_REMOVE = 71;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_REMOVE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Remove</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_REMOVE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreUpdate()
- * @generated
- */
- public static final int PRE_UPDATE = 72;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_UPDATE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Update</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_UPDATE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 73;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key Join Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @generated
- */
- public static final int XML_QUERY_HINT = 74;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_HINT__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_HINT__VALUE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Query Hint</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_HINT_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTable()
- * @generated
- */
- public static final int XML_TABLE = 77;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__NAME = ABSTRACT_XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__CATALOG = ABSTRACT_XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__SCHEMA = ABSTRACT_XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The number of structural features of the '<em>Xml Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_FEATURE_COUNT = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE = 78;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__NAME = XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__CATALOG = XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__SCHEMA = XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Secondary Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_FEATURE_COUNT = XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE_IMPL = 79;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL__NAME = ABSTRACT_XML_BASE_TABLE__NAME;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL__CATALOG = ABSTRACT_XML_BASE_TABLE__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL__SCHEMA = ABSTRACT_XML_BASE_TABLE__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL__UNIQUE_CONSTRAINTS = ABSTRACT_XML_BASE_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Secondary Table Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_IMPL_FEATURE_COUNT = ABSTRACT_XML_BASE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @generated
- */
- public static final int XML_GENERATOR = 80;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR__INITIAL_VALUE = 1;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR__ALLOCATION_SIZE = 2;
-
- /**
- * The number of structural features of the '<em>Xml Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR = 81;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__NAME = XML_GENERATOR__NAME;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__INITIAL_VALUE = XML_GENERATOR__INITIAL_VALUE;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE = XML_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__SEQUENCE_NAME = XML_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Sequence Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL = 82;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL__NAME = XML_SEQUENCE_GENERATOR__NAME;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE = XML_SEQUENCE_GENERATOR__INITIAL_VALUE;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE = XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME = XML_SEQUENCE_GENERATOR__SEQUENCE_NAME;
-
- /**
- * The number of structural features of the '<em>Xml Sequence Generator Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_IMPL_FEATURE_COUNT = XML_SEQUENCE_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @generated
- */
- public static final int SQL_RESULT_SET_MAPPING = 83;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Entity Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__ENTITY_RESULTS = 1;
-
- /**
- * The feature id for the '<em><b>Column Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__COLUMN_RESULTS = 2;
-
- /**
- * The number of structural features of the '<em>Sql Result Set Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING_FEATURE_COUNT = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR = 84;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__NAME = XML_GENERATOR__NAME;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__INITIAL_VALUE = XML_GENERATOR__INITIAL_VALUE;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__ALLOCATION_SIZE = XML_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__TABLE = XML_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__CATALOG = XML_GENERATOR_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__SCHEMA = XML_GENERATOR_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = XML_GENERATOR_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_VALUE = XML_GENERATOR_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = XML_GENERATOR_FEATURE_COUNT + 6;
-
- /**
- * The number of structural features of the '<em>Xml Table Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR_IMPL = 85;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__NAME = XML_TABLE_GENERATOR__NAME;
-
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE = XML_TABLE_GENERATOR__INITIAL_VALUE;
-
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE = XML_TABLE_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__TABLE = XML_TABLE_GENERATOR__TABLE;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__CATALOG = XML_TABLE_GENERATOR__CATALOG;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__SCHEMA = XML_TABLE_GENERATOR__SCHEMA;
-
- /**
- * The feature id for the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME = XML_TABLE_GENERATOR__PK_COLUMN_NAME;
-
- /**
- * The feature id for the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME = XML_TABLE_GENERATOR__VALUE_COLUMN_NAME;
-
- /**
- * The feature id for the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE = XML_TABLE_GENERATOR__PK_COLUMN_VALUE;
-
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS = XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
-
- /**
- * The number of structural features of the '<em>Xml Table Generator Impl</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_IMPL_FEATURE_COUNT = XML_TABLE_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.UniqueConstraint <em>Unique Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.UniqueConstraint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getUniqueConstraint()
- * @generated
- */
- public static final int UNIQUE_CONSTRAINT = 86;
-
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int UNIQUE_CONSTRAINT__COLUMN_NAMES = 0;
-
- /**
- * The number of structural features of the '<em>Unique Constraint</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int UNIQUE_CONSTRAINT_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @generated
- */
- public static final int ACCESS_TYPE = 87;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @generated
- */
- public static final int DISCRIMINATOR_TYPE = 88;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @generated
- */
- public static final int ENUM_TYPE = 89;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @generated
- */
- public static final int FETCH_TYPE = 90;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @generated
- */
- public static final int GENERATION_TYPE = 91;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @generated
- */
- public static final int INHERITANCE_TYPE = 92;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @generated
- */
- public static final int TEMPORAL_TYPE = 93;
-
- /**
- * The meta object id for the '<em>Discriminator Value</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorValue()
- * @generated
- */
- public static final int DISCRIMINATOR_VALUE = 94;
-
- /**
- * The meta object id for the '<em>Enumerated</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumerated()
- * @generated
- */
- public static final int ENUMERATED = 95;
-
- /**
- * The meta object id for the '<em>Order By</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getOrderBy()
- * @generated
- */
- public static final int ORDER_BY = 96;
-
- /**
- * The meta object id for the '<em>Version Type</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getVersionType()
- * @generated
- */
- public static final int VERSION_TYPE = 97;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitMetadataEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaultsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlTypeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultiRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSingleRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass cascadeTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass cascadeTypeImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlNamedColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAbstractColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlAbstractColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlColumnImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlDiscriminatorColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityListenersEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityListenerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass fieldResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratedValueEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratedValueImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass idClassEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass inheritanceEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinColumnImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass lobEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass mapKeyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass mapKeyImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedNativeQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass eventMethodEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postLoadEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postPersistEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postRemoveEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postUpdateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass prePersistEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass preRemoveEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass preUpdateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKeyJoinColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryHintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlBaseTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBaseTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGeneratorImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass sqlResultSetMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorImplEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass uniqueConstraintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum accessTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum discriminatorTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum enumTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum fetchTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum generationTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum inheritanceTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum temporalTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType discriminatorValueEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType enumeratedEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType orderByEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType versionTypeEDataType = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private OrmPackage()
- {
- super(eNS_URI, OrmFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static OrmPackage init()
- {
- if (isInited) return (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Obtain or create and register package
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new OrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE);
-
- // Create package meta-data objects
- theOrmPackage.createPackageContents();
- thePersistencePackage.createPackageContents();
-
- // Initialize created meta-data
- theOrmPackage.initializePackageContents();
- thePersistencePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theOrmPackage.freeze();
-
- return theOrmPackage;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings
- * @generated
- */
- public EClass getXmlEntityMappings()
- {
- return xmlEntityMappingsEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Version</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Version()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Description()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Persistence Unit Metadata</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_PersistenceUnitMetadata()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Package</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Package()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Schema()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Catalog()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess <em>Access</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Access</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Access()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators <em>Sequence Generators</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sequence Generators</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_SequenceGenerators()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators <em>Table Generators</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Table Generators</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_TableGenerators()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedQueries <em>Named Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedQueries()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_NamedQueries()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedNativeQueries <em>Named Native Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Native Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedNativeQueries()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_NamedNativeQueries()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sql Result Set Mappings</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSqlResultSetMappings()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_SqlResultSetMappings()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(11);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses <em>Mapped Superclasses</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Mapped Superclasses</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_MappedSuperclasses()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(12);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities <em>Entities</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entities</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_Entities()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(13);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables <em>Embeddables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embeddables</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_Embeddables()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(14);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Metadata</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata()
- {
- return xmlPersistenceUnitMetadataEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Xml Mapping Metadata Complete</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete()
- {
- return (EAttribute)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Persistence Unit Defaults</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EReference getXmlPersistenceUnitMetadata_PersistenceUnitDefaults()
- {
- return (EReference)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults()
- {
- return xmlPersistenceUnitDefaultsEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Schema()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Catalog()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getAccess <em>Access</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Access</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getAccess()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Access()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_CascadePersist()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EReference getXmlPersistenceUnitDefaults_EntityListeners()
- {
- return (EReference)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Type Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @generated
- */
- public EClass getAbstractXmlTypeMapping()
- {
- return abstractXmlTypeMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getClassName()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_ClassName()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess <em>Access</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Access</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_Access()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Metadata Complete</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_MetadataComplete()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EAttribute getAbstractXmlTypeMapping_Description()
- {
- return (EAttribute)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Attributes</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes()
- * @see #getAbstractXmlTypeMapping()
- * @generated
- */
- public EReference getAbstractXmlTypeMapping_Attributes()
- {
- return (EReference)abstractXmlTypeMappingEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass()
- {
- return xmlMappedSuperclassEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getIdClass <em>Id Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Id Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getIdClass()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_IdClass()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_EntityListeners()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPrePersist()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PrePersist()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostPersist()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostPersist()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreRemove()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PreRemove()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostRemove()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostRemove()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreUpdate()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PreUpdate()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostUpdate()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostUpdate()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostLoad()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_PostLoad()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEntity <em>Xml Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity
- * @generated
- */
- public EClass getXmlEntity()
- {
- return xmlEntityEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getName()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_Name()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getTable()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_Table()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables <em>Secondary Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Secondary Tables</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SecondaryTables()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getIdClass <em>Id Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Id Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getIdClass()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_IdClass()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Inheritance</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_Inheritance()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_DiscriminatorValue()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_DiscriminatorColumn()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSequenceGenerator <em>Sequence Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Sequence Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getSequenceGenerator()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SequenceGenerator()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTableGenerator <em>Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Table Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getTableGenerator()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_TableGenerator()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedQueries <em>Named Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedQueries()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_NamedQueries()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedNativeQueries <em>Named Native Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Native Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedNativeQueries()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_NamedNativeQueries()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(11);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sql Result Set Mappings</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getSqlResultSetMappings()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SqlResultSetMappings()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(12);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(13);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(14);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_EntityListeners()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(15);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PrePersist()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(16);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostPersist()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(17);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PreRemove()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(18);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostRemove()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(19);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PreUpdate()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(20);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostUpdate()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(21);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PostLoad()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(22);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAttributeOverrides <em>Attribute Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attribute Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getAttributeOverrides()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_AttributeOverrides()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(23);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAssociationOverrides <em>Association Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Association Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getAssociationOverrides()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_AssociationOverrides()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(24);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddable
- * @generated
- */
- public EClass getXmlEmbeddable()
- {
- return xmlEmbeddableEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.Attributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Attributes</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes
- * @generated
- */
- public EClass getAttributes()
- {
- return attributesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getIds <em>Ids</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Ids</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getIds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Ids()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds <em>Embedded Ids</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embedded Ids</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_EmbeddedIds()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getBasics <em>Basics</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basics</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getBasics()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Basics()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getVersions <em>Versions</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Versions</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getVersions()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Versions()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes <em>Many To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Many To Ones</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_ManyToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys <em>One To Manys</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>One To Manys</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_OneToManys()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes <em>One To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>One To Ones</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_OneToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys <em>Many To Manys</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Many To Manys</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_ManyToManys()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds <em>Embeddeds</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embeddeds</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Embeddeds()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getTransients <em>Transients</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Transients</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getTransients()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Transients()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping
- * @generated
- */
- public EClass getXmlAttributeMapping()
- {
- return xmlAttributeMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName()
- * @see #getXmlAttributeMapping()
- * @generated
- */
- public EAttribute getXmlAttributeMapping_Name()
- {
- return (EAttribute)xmlAttributeMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Attribute Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @generated
- */
- public EClass getAbstractXmlAttributeMapping()
- {
- return abstractXmlAttributeMappingEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Column Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @generated
- */
- public EClass getColumnMapping()
- {
- return columnMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn()
- * @see #getColumnMapping()
- * @generated
- */
- public EReference getColumnMapping_Column()
- {
- return (EReference)columnMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @generated
- */
- public EClass getXmlRelationshipMapping()
- {
- return xmlRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Target Entity</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getTargetEntity()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlRelationshipMapping_TargetEntity()
- {
- return (EAttribute)xmlRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getFetch <em>Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Fetch</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getFetch()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlRelationshipMapping_Fetch()
- {
- return (EAttribute)xmlRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getJoinTable <em>Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Join Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getJoinTable()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EReference getXmlRelationshipMapping_JoinTable()
- {
- return (EReference)xmlRelationshipMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getCascade <em>Cascade</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cascade</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getCascade()
- * @see #getXmlRelationshipMapping()
- * @generated
- */
- public EReference getXmlRelationshipMapping_Cascade()
- {
- return (EReference)xmlRelationshipMappingEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multi Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @generated
- */
- public EClass getXmlMultiRelationshipMapping()
- {
- return xmlMultiRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMappedBy <em>Mapped By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mapped By</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMappedBy()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_MappedBy()
- {
- return (EAttribute)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getOrderBy <em>Order By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Order By</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getOrderBy()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_OrderBy()
- {
- return (EAttribute)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMapKey()
- * @see #getXmlMultiRelationshipMapping()
- * @generated
- */
- public EReference getXmlMultiRelationshipMapping_MapKey()
- {
- return (EReference)xmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Single Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @generated
- */
- public EClass getXmlSingleRelationshipMapping()
- {
- return xmlSingleRelationshipMappingEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getOptional <em>Optional</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Optional</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getOptional()
- * @see #getXmlSingleRelationshipMapping()
- * @generated
- */
- public EAttribute getXmlSingleRelationshipMapping_Optional()
- {
- return (EAttribute)xmlSingleRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getJoinColumns()
- * @see #getXmlSingleRelationshipMapping()
- * @generated
- */
- public EReference getXmlSingleRelationshipMapping_JoinColumns()
- {
- return (EReference)xmlSingleRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlId <em>Xml Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlId
- * @generated
- */
- public EClass getXmlId()
- {
- return xmlIdEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#getGeneratedValue <em>Generated Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Generated Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlId#getGeneratedValue()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_GeneratedValue()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlId#getTemporal <em>Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlId#getTemporal()
- * @see #getXmlId()
- * @generated
- */
- public EAttribute getXmlId_Temporal()
- {
- return (EAttribute)xmlIdEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#getTableGenerator <em>Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Table Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlId#getTableGenerator()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_TableGenerator()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#getSequenceGenerator <em>Sequence Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Sequence Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlId#getSequenceGenerator()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_SequenceGenerator()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @generated
- */
- public EClass getXmlIdImpl()
- {
- return xmlIdImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId
- * @generated
- */
- public EClass getXmlEmbeddedId()
- {
- return xmlEmbeddedIdEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId#getAttributeOverrides <em>Attribute Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attribute Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId#getAttributeOverrides()
- * @see #getXmlEmbeddedId()
- * @generated
- */
- public EReference getXmlEmbeddedId_AttributeOverrides()
- {
- return (EReference)xmlEmbeddedIdEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @generated
- */
- public EClass getXmlEmbeddedIdImpl()
- {
- return xmlEmbeddedIdImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlBasic <em>Xml Basic</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic
- * @generated
- */
- public EClass getXmlBasic()
- {
- return xmlBasicEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Fetch</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Fetch()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Optional</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Optional()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#isLob <em>Lob</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Lob</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#isLob()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Lob()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getTemporal <em>Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getTemporal()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Temporal()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getEnumerated <em>Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Enumerated</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getEnumerated()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Enumerated()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl <em>Xml Basic Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @generated
- */
- public EClass getXmlBasicImpl()
- {
- return xmlBasicImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlVersion <em>Xml Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion
- * @generated
- */
- public EClass getXmlVersion()
- {
- return xmlVersionEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getTemporal <em>Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion#getTemporal()
- * @see #getXmlVersion()
- * @generated
- */
- public EAttribute getXmlVersion_Temporal()
- {
- return (EAttribute)xmlVersionEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @generated
- */
- public EClass getXmlVersionImpl()
- {
- return xmlVersionImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOne
- * @generated
- */
- public EClass getXmlManyToOne()
- {
- return xmlManyToOneEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl <em>Xml Many To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @generated
- */
- public EClass getXmlManyToOneImpl()
- {
- return xmlManyToOneImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany
- * @generated
- */
- public EClass getXmlOneToMany()
- {
- return xmlOneToManyEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany#getJoinColumns()
- * @see #getXmlOneToMany()
- * @generated
- */
- public EReference getXmlOneToMany_JoinColumns()
- {
- return (EReference)xmlOneToManyEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @generated
- */
- public EClass getXmlOneToManyImpl()
- {
- return xmlOneToManyImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne
- * @generated
- */
- public EClass getXmlOneToOne()
- {
- return xmlOneToOneEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getMappedBy <em>Mapped By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mapped By</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne#getMappedBy()
- * @see #getXmlOneToOne()
- * @generated
- */
- public EAttribute getXmlOneToOne_MappedBy()
- {
- return (EAttribute)xmlOneToOneEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns()
- * @see #getXmlOneToOne()
- * @generated
- */
- public EReference getXmlOneToOne_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlOneToOneEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @generated
- */
- public EClass getXmlOneToOneImpl()
- {
- return xmlOneToOneImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToMany
- * @generated
- */
- public EClass getXmlManyToMany()
- {
- return xmlManyToManyEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @generated
- */
- public EClass getXmlManyToManyImpl()
- {
- return xmlManyToManyImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded
- * @generated
- */
- public EClass getXmlEmbedded()
- {
- return xmlEmbeddedEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded#getAttributeOverrides <em>Attribute Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attribute Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded#getAttributeOverrides()
- * @see #getXmlEmbedded()
- * @generated
- */
- public EReference getXmlEmbedded_AttributeOverrides()
- {
- return (EReference)xmlEmbeddedEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @generated
- */
- public EClass getXmlEmbeddedImpl()
- {
- return xmlEmbeddedImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTransient <em>Xml Transient</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transient</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTransient
- * @generated
- */
- public EClass getXmlTransient()
- {
- return xmlTransientEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTransientImpl <em>Xml Transient Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transient Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @generated
- */
- public EClass getXmlTransientImpl()
- {
- return xmlTransientImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Association Override</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @generated
- */
- public EClass getXmlAssociationOverride()
- {
- return xmlAssociationOverrideEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getJoinColumns()
- * @see #getXmlAssociationOverride()
- * @generated
- */
- public EReference getXmlAssociationOverride_JoinColumns()
- {
- return (EReference)xmlAssociationOverrideEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getName()
- * @see #getXmlAssociationOverride()
- * @generated
- */
- public EAttribute getXmlAssociationOverride_Name()
- {
- return (EAttribute)xmlAssociationOverrideEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @generated
- */
- public EClass getXmlAttributeOverride()
- {
- return xmlAttributeOverrideEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn()
- * @see #getXmlAttributeOverride()
- * @generated
- */
- public EReference getXmlAttributeOverride_Column()
- {
- return (EReference)xmlAttributeOverrideEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getName()
- * @see #getXmlAttributeOverride()
- * @generated
- */
- public EAttribute getXmlAttributeOverride_Name()
- {
- return (EAttribute)xmlAttributeOverrideEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @generated
- */
- public EClass getXmlAttributeOverrideImpl()
- {
- return xmlAttributeOverrideImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Cascade Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @generated
- */
- public EClass getCascadeType()
- {
- return cascadeTypeEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade All</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeAll()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadePersist()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Merge</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeMerge()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeRemove()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Refresh</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeRefresh()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl <em>Cascade Type Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Cascade Type Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @generated
- */
- public EClass getCascadeTypeImpl()
- {
- return cascadeTypeImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @generated
- */
- public EClass getXmlNamedColumn()
- {
- return xmlNamedColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getColumnDefinition <em>Column Definition</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Column Definition</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getColumnDefinition()
- * @see #getXmlNamedColumn()
- * @generated
- */
- public EAttribute getXmlNamedColumn_ColumnDefinition()
- {
- return (EAttribute)xmlNamedColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getName()
- * @see #getXmlNamedColumn()
- * @generated
- */
- public EAttribute getXmlNamedColumn_Name()
- {
- return (EAttribute)xmlNamedColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Named Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @generated
- */
- public EClass getAbstractXmlNamedColumn()
- {
- return abstractXmlNamedColumnEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Abstract Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @generated
- */
- public EClass getXmlAbstractColumn()
- {
- return xmlAbstractColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getInsertable <em>Insertable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Insertable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getInsertable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Insertable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getNullable <em>Nullable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Nullable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getNullable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Nullable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Table()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique <em>Unique</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Unique</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Unique()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUpdatable <em>Updatable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Updatable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUpdatable()
- * @see #getXmlAbstractColumn()
- * @generated
- */
- public EAttribute getXmlAbstractColumn_Updatable()
- {
- return (EAttribute)xmlAbstractColumnEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Abstract Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @generated
- */
- public EClass getAbstractXmlAbstractColumn()
- {
- return abstractXmlAbstractColumnEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @generated
- */
- public EClass getXmlColumn()
- {
- return xmlColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Length</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getLength()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Length()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Precision</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Precision()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Scale</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getScale()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Scale()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl <em>Xml Column Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Column Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @generated
- */
- public EClass getXmlColumnImpl()
- {
- return xmlColumnImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Column Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @generated
- */
- public EClass getColumnResult()
- {
- return columnResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.ColumnResult#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult#getName()
- * @see #getColumnResult()
- * @generated
- */
- public EAttribute getColumnResult_Name()
- {
- return (EAttribute)columnResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @generated
- */
- public EClass getXmlDiscriminatorColumn()
- {
- return xmlDiscriminatorColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType()
- * @see #getXmlDiscriminatorColumn()
- * @generated
- */
- public EAttribute getXmlDiscriminatorColumn_DiscriminatorType()
- {
- return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Length</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength()
- * @see #getXmlDiscriminatorColumn()
- * @generated
- */
- public EAttribute getXmlDiscriminatorColumn_Length()
- {
- return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @generated
- */
- public EClass getEntityListeners()
- {
- return entityListenersEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.EntityListeners#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners#getEntityListeners()
- * @see #getEntityListeners()
- * @generated
- */
- public EReference getEntityListeners_EntityListeners()
- {
- return (EReference)entityListenersEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Listener</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @generated
- */
- public EClass getEntityListener()
- {
- return entityListenerEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getClassName()
- * @see #getEntityListener()
- * @generated
- */
- public EAttribute getEntityListener_ClassName()
- {
- return (EAttribute)entityListenerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PrePersist()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostPersist()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PreRemove()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostRemove()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PreUpdate()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostUpdate()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad()
- * @see #getEntityListener()
- * @generated
- */
- public EReference getEntityListener_PostLoad()
- {
- return (EReference)entityListenerEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @generated
- */
- public EClass getEntityResult()
- {
- return entityResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn()
- * @see #getEntityResult()
- * @generated
- */
- public EAttribute getEntityResult_DiscriminatorColumn()
- {
- return (EAttribute)entityResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Entity Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass()
- * @see #getEntityResult()
- * @generated
- */
- public EAttribute getEntityResult_EntityClass()
- {
- return (EAttribute)entityResultEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults <em>Field Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Field Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults()
- * @see #getEntityResult()
- * @generated
- */
- public EReference getEntityResult_FieldResults()
- {
- return (EReference)entityResultEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Field Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @generated
- */
- public EClass getFieldResult()
- {
- return fieldResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult#getName()
- * @see #getFieldResult()
- * @generated
- */
- public EAttribute getFieldResult_Name()
- {
- return (EAttribute)fieldResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult#getColumn()
- * @see #getFieldResult()
- * @generated
- */
- public EAttribute getFieldResult_Column()
- {
- return (EAttribute)fieldResultEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generated Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @generated
- */
- public EClass getXmlGeneratedValue()
- {
- return xmlGeneratedValueEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator()
- * @see #getXmlGeneratedValue()
- * @generated
- */
- public EAttribute getXmlGeneratedValue_Generator()
- {
- return (EAttribute)xmlGeneratedValueEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Strategy</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy()
- * @see #getXmlGeneratedValue()
- * @generated
- */
- public EAttribute getXmlGeneratedValue_Strategy()
- {
- return (EAttribute)xmlGeneratedValueEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generated Value Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @generated
- */
- public EClass getXmlGeneratedValueImpl()
- {
- return xmlGeneratedValueImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.IdClass <em>Id Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Id Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.IdClass
- * @generated
- */
- public EClass getIdClass()
- {
- return idClassEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.IdClass#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.IdClass#getClassName()
- * @see #getIdClass()
- * @generated
- */
- public EAttribute getIdClass_ClassName()
- {
- return (EAttribute)idClassEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Inheritance</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @generated
- */
- public EClass getInheritance()
- {
- return inheritanceEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Strategy</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy()
- * @see #getInheritance()
- * @generated
- */
- public EAttribute getInheritance_Strategy()
- {
- return (EAttribute)inheritanceEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @generated
- */
- public EClass getXmlJoinColumn()
- {
- return xmlJoinColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Referenced Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName()
- * @see #getXmlJoinColumn()
- * @generated
- */
- public EAttribute getXmlJoinColumn_ReferencedColumnName()
- {
- return (EAttribute)xmlJoinColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Column Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @generated
- */
- public EClass getXmlJoinColumnImpl()
- {
- return xmlJoinColumnImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable
- * @generated
- */
- public EClass getXmlJoinTable()
- {
- return xmlJoinTableEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable#getJoinColumns()
- * @see #getXmlJoinTable()
- * @generated
- */
- public EReference getXmlJoinTable_JoinColumns()
- {
- return (EReference)xmlJoinTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns <em>Inverse Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Inverse Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns()
- * @see #getXmlJoinTable()
- * @generated
- */
- public EReference getXmlJoinTable_InverseJoinColumns()
- {
- return (EReference)xmlJoinTableEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl <em>Xml Join Table Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @generated
- */
- public EClass getXmlJoinTableImpl()
- {
- return xmlJoinTableImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Lob</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @generated
- */
- public EClass getLob()
- {
- return lobEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Map Key</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @generated
- */
- public EClass getMapKey()
- {
- return mapKeyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.MapKey#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKey#getName()
- * @see #getMapKey()
- * @generated
- */
- public EAttribute getMapKey_Name()
- {
- return (EAttribute)mapKeyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.MapKeyImpl <em>Map Key Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Map Key Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @generated
- */
- public EClass getMapKeyImpl()
- {
- return mapKeyImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @generated
- */
- public EClass getXmlQuery()
- {
- return xmlQueryEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery#getName()
- * @see #getXmlQuery()
- * @generated
- */
- public EAttribute getXmlQuery_Name()
- {
- return (EAttribute)xmlQueryEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery()
- * @see #getXmlQuery()
- * @generated
- */
- public EAttribute getXmlQuery_Query()
- {
- return (EAttribute)xmlQueryEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getHints <em>Hints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Hints</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery#getHints()
- * @see #getXmlQuery()
- * @generated
- */
- public EReference getXmlQuery_Hints()
- {
- return (EReference)xmlQueryEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Native Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @generated
- */
- public EClass getXmlNamedNativeQuery()
- {
- return xmlNamedNativeQueryEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultClass <em>Result Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultClass()
- * @see #getXmlNamedNativeQuery()
- * @generated
- */
- public EAttribute getXmlNamedNativeQuery_ResultClass()
- {
- return (EAttribute)xmlNamedNativeQueryEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping <em>Result Set Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Set Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping()
- * @see #getXmlNamedNativeQuery()
- * @generated
- */
- public EAttribute getXmlNamedNativeQuery_ResultSetMapping()
- {
- return (EAttribute)xmlNamedNativeQueryEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @generated
- */
- public EClass getXmlNamedQuery()
- {
- return xmlNamedQueryEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Event Method</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @generated
- */
- public EClass getEventMethod()
- {
- return eventMethodEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Method Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName()
- * @see #getEventMethod()
- * @generated
- */
- public EAttribute getEventMethod_MethodName()
- {
- return (EAttribute)eventMethodEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @generated
- */
- public EClass getPostLoad()
- {
- return postLoadEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @generated
- */
- public EClass getPostPersist()
- {
- return postPersistEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @generated
- */
- public EClass getPostRemove()
- {
- return postRemoveEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @generated
- */
- public EClass getPostUpdate()
- {
- return postUpdateEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @generated
- */
- public EClass getPrePersist()
- {
- return prePersistEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @generated
- */
- public EClass getPreRemove()
- {
- return preRemoveEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @generated
- */
- public EClass getPreUpdate()
- {
- return preUpdateEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key Join Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @generated
- */
- public EClass getXmlPrimaryKeyJoinColumn()
- {
- return xmlPrimaryKeyJoinColumnEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Referenced Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName()
- * @see #getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public EAttribute getXmlPrimaryKeyJoinColumn_ReferencedColumnName()
- {
- return (EAttribute)xmlPrimaryKeyJoinColumnEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Hint</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @generated
- */
- public EClass getXmlQueryHint()
- {
- return xmlQueryHintEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName()
- * @see #getXmlQueryHint()
- * @generated
- */
- public EAttribute getXmlQueryHint_Name()
- {
- return (EAttribute)xmlQueryHintEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue()
- * @see #getXmlQueryHint()
- * @generated
- */
- public EAttribute getXmlQueryHint_Value()
- {
- return (EAttribute)xmlQueryHintEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Base Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @generated
- */
- public EClass getAbstractXmlBaseTable()
- {
- return abstractXmlBaseTableEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Base Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @generated
- */
- public EClass getXmlBaseTable()
- {
- return xmlBaseTableEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable#getName()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Name()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable#getCatalog()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Catalog()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable#getSchema()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EAttribute getXmlBaseTable_Schema()
- {
- return (EAttribute)xmlBaseTableEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getUniqueConstraints <em>Unique Constraints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable#getUniqueConstraints()
- * @see #getXmlBaseTable()
- * @generated
- */
- public EReference getXmlBaseTable_UniqueConstraints()
- {
- return (EReference)xmlBaseTableEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTable <em>Xml Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTable
- * @generated
- */
- public EClass getXmlTable()
- {
- return xmlTableEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable
- * @generated
- */
- public EClass getXmlSecondaryTable()
- {
- return xmlSecondaryTableEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns()
- * @see #getXmlSecondaryTable()
- * @generated
- */
- public EReference getXmlSecondaryTable_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlSecondaryTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @generated
- */
- public EClass getXmlSecondaryTableImpl()
- {
- return xmlSecondaryTableImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @generated
- */
- public EClass getXmlGenerator()
- {
- return xmlGeneratorEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getName()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_Name()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Initial Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_InitialValue()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Allocation Size</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_AllocationSize()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sequence Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @generated
- */
- public EClass getXmlSequenceGenerator()
- {
- return xmlSequenceGeneratorEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Sequence Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName()
- * @see #getXmlSequenceGenerator()
- * @generated
- */
- public EAttribute getXmlSequenceGenerator_SequenceName()
- {
- return (EAttribute)xmlSequenceGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sequence Generator Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @generated
- */
- public EClass getXmlSequenceGeneratorImpl()
- {
- return xmlSequenceGeneratorImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Sql Result Set Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @generated
- */
- public EClass getSqlResultSetMapping()
- {
- return sqlResultSetMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EAttribute getSqlResultSetMapping_Name()
- {
- return (EAttribute)sqlResultSetMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults <em>Entity Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entity Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EReference getSqlResultSetMapping_EntityResults()
- {
- return (EReference)sqlResultSetMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults <em>Column Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Column Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EReference getSqlResultSetMapping_ColumnResults()
- {
- return (EReference)sqlResultSetMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator
- * @generated
- */
- public EClass getXmlTableGenerator()
- {
- return xmlTableGeneratorEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Table()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Catalog()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Schema()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Pk Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_PkColumnName()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_ValueColumnName()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Pk Column Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_PkColumnValue()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints <em>Unique Constraints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EReference getXmlTableGenerator_UniqueConstraints()
- {
- return (EReference)xmlTableGeneratorEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator Impl</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @generated
- */
- public EClass getXmlTableGeneratorImpl()
- {
- return xmlTableGeneratorImplEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.UniqueConstraint <em>Unique Constraint</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Unique Constraint</em>'.
- * @see org.eclipse.jpt.core.resource.orm.UniqueConstraint
- * @generated
- */
- public EClass getUniqueConstraint()
- {
- return uniqueConstraintEClass;
- }
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.resource.orm.UniqueConstraint#getColumnNames <em>Column Names</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Column Names</em>'.
- * @see org.eclipse.jpt.core.resource.orm.UniqueConstraint#getColumnNames()
- * @see #getUniqueConstraint()
- * @generated
- */
- public EAttribute getUniqueConstraint_ColumnNames()
- {
- return (EAttribute)uniqueConstraintEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Access Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @generated
- */
- public EEnum getAccessType()
- {
- return accessTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Discriminator Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @generated
- */
- public EEnum getDiscriminatorType()
- {
- return discriminatorTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Enum Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @generated
- */
- public EEnum getEnumType()
- {
- return enumTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Fetch Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @generated
- */
- public EEnum getFetchType()
- {
- return fetchTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Generation Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @generated
- */
- public EEnum getGenerationType()
- {
- return generationTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Inheritance Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @generated
- */
- public EEnum getInheritanceType()
- {
- return inheritanceTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Temporal Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @generated
- */
- public EEnum getTemporalType()
- {
- return temporalTypeEEnum;
- }
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Discriminator Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Discriminator Value</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getDiscriminatorValue()
- {
- return discriminatorValueEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.emf.common.util.Enumerator <em>Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Enumerated</em>'.
- * @see org.eclipse.emf.common.util.Enumerator
- * @model instanceClass="org.eclipse.emf.common.util.Enumerator"
- * @generated
- */
- public EDataType getEnumerated()
- {
- return enumeratedEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Order By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Order By</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getOrderBy()
- {
- return orderByEDataType;
- }
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Version Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Version Type</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getVersionType()
- {
- return versionTypeEDataType;
- }
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public OrmFactory getOrmFactory()
- {
- return (OrmFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__VERSION);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__DESCRIPTION);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__PACKAGE);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SCHEMA);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__CATALOG);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__ACCESS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__TABLE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__NAMED_QUERIES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__ENTITIES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__EMBEDDABLES);
-
- xmlPersistenceUnitMetadataEClass = createEClass(XML_PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE);
- createEReference(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS);
-
- xmlPersistenceUnitDefaultsEClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST);
- createEReference(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS);
-
- abstractXmlTypeMappingEClass = createEClass(ABSTRACT_XML_TYPE_MAPPING);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__ACCESS);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE);
- createEAttribute(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION);
- createEReference(abstractXmlTypeMappingEClass, ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ID_CLASS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_PERSIST);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_PERSIST);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_REMOVE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_REMOVE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__PRE_UPDATE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_UPDATE);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__POST_LOAD);
-
- xmlEntityEClass = createEClass(XML_ENTITY);
- createEAttribute(xmlEntityEClass, XML_ENTITY__NAME);
- createEReference(xmlEntityEClass, XML_ENTITY__TABLE);
- createEReference(xmlEntityEClass, XML_ENTITY__SECONDARY_TABLES);
- createEReference(xmlEntityEClass, XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS);
- createEReference(xmlEntityEClass, XML_ENTITY__ID_CLASS);
- createEReference(xmlEntityEClass, XML_ENTITY__INHERITANCE);
- createEAttribute(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_VALUE);
- createEReference(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_COLUMN);
- createEReference(xmlEntityEClass, XML_ENTITY__SEQUENCE_GENERATOR);
- createEReference(xmlEntityEClass, XML_ENTITY__TABLE_GENERATOR);
- createEReference(xmlEntityEClass, XML_ENTITY__NAMED_QUERIES);
- createEReference(xmlEntityEClass, XML_ENTITY__NAMED_NATIVE_QUERIES);
- createEReference(xmlEntityEClass, XML_ENTITY__SQL_RESULT_SET_MAPPINGS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlEntityEClass, XML_ENTITY__ENTITY_LISTENERS);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_PERSIST);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_PERSIST);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_REMOVE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_REMOVE);
- createEReference(xmlEntityEClass, XML_ENTITY__PRE_UPDATE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_UPDATE);
- createEReference(xmlEntityEClass, XML_ENTITY__POST_LOAD);
- createEReference(xmlEntityEClass, XML_ENTITY__ATTRIBUTE_OVERRIDES);
- createEReference(xmlEntityEClass, XML_ENTITY__ASSOCIATION_OVERRIDES);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
-
- attributesEClass = createEClass(ATTRIBUTES);
- createEReference(attributesEClass, ATTRIBUTES__IDS);
- createEReference(attributesEClass, ATTRIBUTES__EMBEDDED_IDS);
- createEReference(attributesEClass, ATTRIBUTES__BASICS);
- createEReference(attributesEClass, ATTRIBUTES__VERSIONS);
- createEReference(attributesEClass, ATTRIBUTES__MANY_TO_ONES);
- createEReference(attributesEClass, ATTRIBUTES__ONE_TO_MANYS);
- createEReference(attributesEClass, ATTRIBUTES__ONE_TO_ONES);
- createEReference(attributesEClass, ATTRIBUTES__MANY_TO_MANYS);
- createEReference(attributesEClass, ATTRIBUTES__EMBEDDEDS);
- createEReference(attributesEClass, ATTRIBUTES__TRANSIENTS);
-
- xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING);
- createEAttribute(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__NAME);
-
- abstractXmlAttributeMappingEClass = createEClass(ABSTRACT_XML_ATTRIBUTE_MAPPING);
-
- columnMappingEClass = createEClass(COLUMN_MAPPING);
- createEReference(columnMappingEClass, COLUMN_MAPPING__COLUMN);
-
- xmlRelationshipMappingEClass = createEClass(XML_RELATIONSHIP_MAPPING);
- createEAttribute(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__TARGET_ENTITY);
- createEAttribute(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__FETCH);
- createEReference(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__JOIN_TABLE);
- createEReference(xmlRelationshipMappingEClass, XML_RELATIONSHIP_MAPPING__CASCADE);
-
- xmlMultiRelationshipMappingEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING);
- createEAttribute(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY);
- createEAttribute(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY);
- createEReference(xmlMultiRelationshipMappingEClass, XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY);
-
- xmlSingleRelationshipMappingEClass = createEClass(XML_SINGLE_RELATIONSHIP_MAPPING);
- createEAttribute(xmlSingleRelationshipMappingEClass, XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL);
- createEReference(xmlSingleRelationshipMappingEClass, XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS);
-
- xmlIdEClass = createEClass(XML_ID);
- createEReference(xmlIdEClass, XML_ID__GENERATED_VALUE);
- createEAttribute(xmlIdEClass, XML_ID__TEMPORAL);
- createEReference(xmlIdEClass, XML_ID__TABLE_GENERATOR);
- createEReference(xmlIdEClass, XML_ID__SEQUENCE_GENERATOR);
-
- xmlIdImplEClass = createEClass(XML_ID_IMPL);
-
- xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID);
- createEReference(xmlEmbeddedIdEClass, XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES);
-
- xmlEmbeddedIdImplEClass = createEClass(XML_EMBEDDED_ID_IMPL);
-
- xmlBasicEClass = createEClass(XML_BASIC);
- createEAttribute(xmlBasicEClass, XML_BASIC__FETCH);
- createEAttribute(xmlBasicEClass, XML_BASIC__OPTIONAL);
- createEAttribute(xmlBasicEClass, XML_BASIC__LOB);
- createEAttribute(xmlBasicEClass, XML_BASIC__TEMPORAL);
- createEAttribute(xmlBasicEClass, XML_BASIC__ENUMERATED);
-
- xmlBasicImplEClass = createEClass(XML_BASIC_IMPL);
-
- xmlVersionEClass = createEClass(XML_VERSION);
- createEAttribute(xmlVersionEClass, XML_VERSION__TEMPORAL);
-
- xmlVersionImplEClass = createEClass(XML_VERSION_IMPL);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- xmlManyToOneImplEClass = createEClass(XML_MANY_TO_ONE_IMPL);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
- createEReference(xmlOneToManyEClass, XML_ONE_TO_MANY__JOIN_COLUMNS);
-
- xmlOneToManyImplEClass = createEClass(XML_ONE_TO_MANY_IMPL);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
- createEAttribute(xmlOneToOneEClass, XML_ONE_TO_ONE__MAPPED_BY);
- createEReference(xmlOneToOneEClass, XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlOneToOneImplEClass = createEClass(XML_ONE_TO_ONE_IMPL);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToManyImplEClass = createEClass(XML_MANY_TO_MANY_IMPL);
-
- xmlEmbeddedEClass = createEClass(XML_EMBEDDED);
- createEReference(xmlEmbeddedEClass, XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
-
- xmlEmbeddedImplEClass = createEClass(XML_EMBEDDED_IMPL);
-
- xmlTransientEClass = createEClass(XML_TRANSIENT);
-
- xmlTransientImplEClass = createEClass(XML_TRANSIENT_IMPL);
-
- xmlAssociationOverrideEClass = createEClass(XML_ASSOCIATION_OVERRIDE);
- createEReference(xmlAssociationOverrideEClass, XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- createEAttribute(xmlAssociationOverrideEClass, XML_ASSOCIATION_OVERRIDE__NAME);
-
- xmlAttributeOverrideEClass = createEClass(XML_ATTRIBUTE_OVERRIDE);
- createEReference(xmlAttributeOverrideEClass, XML_ATTRIBUTE_OVERRIDE__COLUMN);
- createEAttribute(xmlAttributeOverrideEClass, XML_ATTRIBUTE_OVERRIDE__NAME);
-
- xmlAttributeOverrideImplEClass = createEClass(XML_ATTRIBUTE_OVERRIDE_IMPL);
-
- cascadeTypeEClass = createEClass(CASCADE_TYPE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_ALL);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_PERSIST);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_MERGE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_REMOVE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_REFRESH);
-
- cascadeTypeImplEClass = createEClass(CASCADE_TYPE_IMPL);
-
- xmlNamedColumnEClass = createEClass(XML_NAMED_COLUMN);
- createEAttribute(xmlNamedColumnEClass, XML_NAMED_COLUMN__COLUMN_DEFINITION);
- createEAttribute(xmlNamedColumnEClass, XML_NAMED_COLUMN__NAME);
-
- abstractXmlNamedColumnEClass = createEClass(ABSTRACT_XML_NAMED_COLUMN);
-
- xmlAbstractColumnEClass = createEClass(XML_ABSTRACT_COLUMN);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__INSERTABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__NULLABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__TABLE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__UNIQUE);
- createEAttribute(xmlAbstractColumnEClass, XML_ABSTRACT_COLUMN__UPDATABLE);
-
- abstractXmlAbstractColumnEClass = createEClass(ABSTRACT_XML_ABSTRACT_COLUMN);
-
- xmlColumnEClass = createEClass(XML_COLUMN);
- createEAttribute(xmlColumnEClass, XML_COLUMN__LENGTH);
- createEAttribute(xmlColumnEClass, XML_COLUMN__PRECISION);
- createEAttribute(xmlColumnEClass, XML_COLUMN__SCALE);
-
- xmlColumnImplEClass = createEClass(XML_COLUMN_IMPL);
-
- columnResultEClass = createEClass(COLUMN_RESULT);
- createEAttribute(columnResultEClass, COLUMN_RESULT__NAME);
-
- xmlDiscriminatorColumnEClass = createEClass(XML_DISCRIMINATOR_COLUMN);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__LENGTH);
-
- entityListenersEClass = createEClass(ENTITY_LISTENERS);
- createEReference(entityListenersEClass, ENTITY_LISTENERS__ENTITY_LISTENERS);
-
- entityListenerEClass = createEClass(ENTITY_LISTENER);
- createEAttribute(entityListenerEClass, ENTITY_LISTENER__CLASS_NAME);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_PERSIST);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_PERSIST);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_REMOVE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_REMOVE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__PRE_UPDATE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_UPDATE);
- createEReference(entityListenerEClass, ENTITY_LISTENER__POST_LOAD);
-
- entityResultEClass = createEClass(ENTITY_RESULT);
- createEAttribute(entityResultEClass, ENTITY_RESULT__DISCRIMINATOR_COLUMN);
- createEAttribute(entityResultEClass, ENTITY_RESULT__ENTITY_CLASS);
- createEReference(entityResultEClass, ENTITY_RESULT__FIELD_RESULTS);
-
- eventMethodEClass = createEClass(EVENT_METHOD);
- createEAttribute(eventMethodEClass, EVENT_METHOD__METHOD_NAME);
-
- fieldResultEClass = createEClass(FIELD_RESULT);
- createEAttribute(fieldResultEClass, FIELD_RESULT__NAME);
- createEAttribute(fieldResultEClass, FIELD_RESULT__COLUMN);
-
- xmlGeneratedValueEClass = createEClass(XML_GENERATED_VALUE);
- createEAttribute(xmlGeneratedValueEClass, XML_GENERATED_VALUE__GENERATOR);
- createEAttribute(xmlGeneratedValueEClass, XML_GENERATED_VALUE__STRATEGY);
-
- xmlGeneratedValueImplEClass = createEClass(XML_GENERATED_VALUE_IMPL);
-
- idClassEClass = createEClass(ID_CLASS);
- createEAttribute(idClassEClass, ID_CLASS__CLASS_NAME);
-
- inheritanceEClass = createEClass(INHERITANCE);
- createEAttribute(inheritanceEClass, INHERITANCE__STRATEGY);
-
- xmlJoinColumnEClass = createEClass(XML_JOIN_COLUMN);
- createEAttribute(xmlJoinColumnEClass, XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
-
- xmlJoinColumnImplEClass = createEClass(XML_JOIN_COLUMN_IMPL);
-
- xmlJoinTableEClass = createEClass(XML_JOIN_TABLE);
- createEReference(xmlJoinTableEClass, XML_JOIN_TABLE__JOIN_COLUMNS);
- createEReference(xmlJoinTableEClass, XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
-
- xmlJoinTableImplEClass = createEClass(XML_JOIN_TABLE_IMPL);
-
- lobEClass = createEClass(LOB);
-
- mapKeyEClass = createEClass(MAP_KEY);
- createEAttribute(mapKeyEClass, MAP_KEY__NAME);
-
- mapKeyImplEClass = createEClass(MAP_KEY_IMPL);
-
- xmlQueryEClass = createEClass(XML_QUERY);
- createEAttribute(xmlQueryEClass, XML_QUERY__NAME);
- createEAttribute(xmlQueryEClass, XML_QUERY__QUERY);
- createEReference(xmlQueryEClass, XML_QUERY__HINTS);
-
- xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY);
- createEAttribute(xmlNamedNativeQueryEClass, XML_NAMED_NATIVE_QUERY__RESULT_CLASS);
- createEAttribute(xmlNamedNativeQueryEClass, XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
-
- xmlNamedQueryEClass = createEClass(XML_NAMED_QUERY);
-
- postLoadEClass = createEClass(POST_LOAD);
-
- postPersistEClass = createEClass(POST_PERSIST);
-
- postRemoveEClass = createEClass(POST_REMOVE);
-
- postUpdateEClass = createEClass(POST_UPDATE);
-
- prePersistEClass = createEClass(PRE_PERSIST);
-
- preRemoveEClass = createEClass(PRE_REMOVE);
-
- preUpdateEClass = createEClass(PRE_UPDATE);
-
- xmlPrimaryKeyJoinColumnEClass = createEClass(XML_PRIMARY_KEY_JOIN_COLUMN);
- createEAttribute(xmlPrimaryKeyJoinColumnEClass, XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
-
- xmlQueryHintEClass = createEClass(XML_QUERY_HINT);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__NAME);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__VALUE);
-
- abstractXmlBaseTableEClass = createEClass(ABSTRACT_XML_BASE_TABLE);
-
- xmlBaseTableEClass = createEClass(XML_BASE_TABLE);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__NAME);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__CATALOG);
- createEAttribute(xmlBaseTableEClass, XML_BASE_TABLE__SCHEMA);
- createEReference(xmlBaseTableEClass, XML_BASE_TABLE__UNIQUE_CONSTRAINTS);
-
- xmlTableEClass = createEClass(XML_TABLE);
-
- xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE);
- createEReference(xmlSecondaryTableEClass, XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlSecondaryTableImplEClass = createEClass(XML_SECONDARY_TABLE_IMPL);
-
- xmlGeneratorEClass = createEClass(XML_GENERATOR);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__NAME);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__INITIAL_VALUE);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__ALLOCATION_SIZE);
-
- xmlSequenceGeneratorEClass = createEClass(XML_SEQUENCE_GENERATOR);
- createEAttribute(xmlSequenceGeneratorEClass, XML_SEQUENCE_GENERATOR__SEQUENCE_NAME);
-
- xmlSequenceGeneratorImplEClass = createEClass(XML_SEQUENCE_GENERATOR_IMPL);
-
- sqlResultSetMappingEClass = createEClass(SQL_RESULT_SET_MAPPING);
- createEAttribute(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__NAME);
- createEReference(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__ENTITY_RESULTS);
- createEReference(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__COLUMN_RESULTS);
-
- xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__TABLE);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__CATALOG);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__SCHEMA);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__PK_COLUMN_NAME);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__VALUE_COLUMN_NAME);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__PK_COLUMN_VALUE);
- createEReference(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
-
- xmlTableGeneratorImplEClass = createEClass(XML_TABLE_GENERATOR_IMPL);
-
- uniqueConstraintEClass = createEClass(UNIQUE_CONSTRAINT);
- createEAttribute(uniqueConstraintEClass, UNIQUE_CONSTRAINT__COLUMN_NAMES);
-
- // Create enums
- accessTypeEEnum = createEEnum(ACCESS_TYPE);
- discriminatorTypeEEnum = createEEnum(DISCRIMINATOR_TYPE);
- enumTypeEEnum = createEEnum(ENUM_TYPE);
- fetchTypeEEnum = createEEnum(FETCH_TYPE);
- generationTypeEEnum = createEEnum(GENERATION_TYPE);
- inheritanceTypeEEnum = createEEnum(INHERITANCE_TYPE);
- temporalTypeEEnum = createEEnum(TEMPORAL_TYPE);
-
- // Create data types
- discriminatorValueEDataType = createEDataType(DISCRIMINATOR_VALUE);
- enumeratedEDataType = createEDataType(ENUMERATED);
- orderByEDataType = createEDataType(ORDER_BY);
- versionTypeEDataType = createEDataType(VERSION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEntityEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEmbeddableEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- abstractXmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlRelationshipMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getXmlRelationshipMapping());
- xmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getXmlRelationshipMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getColumnMapping());
- xmlIdImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlIdImplEClass.getESuperTypes().add(this.getXmlId());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedIdImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlEmbeddedIdImplEClass.getESuperTypes().add(this.getXmlEmbeddedId());
- xmlBasicEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicEClass.getESuperTypes().add(this.getColumnMapping());
- xmlBasicImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlBasicImplEClass.getESuperTypes().add(this.getXmlBasic());
- xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(this.getColumnMapping());
- xmlVersionImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlVersionImplEClass.getESuperTypes().add(this.getXmlVersion());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping());
- xmlManyToOneImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlManyToOneImplEClass.getESuperTypes().add(this.getXmlManyToOne());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping());
- xmlOneToManyImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlOneToManyImplEClass.getESuperTypes().add(this.getXmlOneToMany());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping());
- xmlOneToOneImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlOneToOneImplEClass.getESuperTypes().add(this.getXmlOneToOne());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping());
- xmlManyToManyImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlManyToManyImplEClass.getESuperTypes().add(this.getXmlManyToMany());
- xmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlEmbeddedImplEClass.getESuperTypes().add(this.getXmlEmbedded());
- xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTransientImplEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlTransientImplEClass.getESuperTypes().add(this.getXmlTransient());
- xmlAttributeOverrideImplEClass.getESuperTypes().add(this.getXmlAttributeOverride());
- cascadeTypeImplEClass.getESuperTypes().add(this.getCascadeType());
- abstractXmlNamedColumnEClass.getESuperTypes().add(this.getXmlNamedColumn());
- xmlAbstractColumnEClass.getESuperTypes().add(this.getXmlNamedColumn());
- abstractXmlAbstractColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- abstractXmlAbstractColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlColumnImplEClass.getESuperTypes().add(this.getAbstractXmlAbstractColumn());
- xmlColumnImplEClass.getESuperTypes().add(this.getXmlColumn());
- xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlGeneratedValueImplEClass.getESuperTypes().add(this.getXmlGeneratedValue());
- xmlJoinColumnEClass.getESuperTypes().add(this.getXmlAbstractColumn());
- xmlJoinColumnImplEClass.getESuperTypes().add(this.getAbstractXmlAbstractColumn());
- xmlJoinColumnImplEClass.getESuperTypes().add(this.getXmlJoinColumn());
- xmlJoinTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlJoinTableImplEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlJoinTableImplEClass.getESuperTypes().add(this.getXmlJoinTable());
- mapKeyImplEClass.getESuperTypes().add(this.getMapKey());
- xmlNamedNativeQueryEClass.getESuperTypes().add(this.getXmlQuery());
- xmlNamedQueryEClass.getESuperTypes().add(this.getXmlQuery());
- postLoadEClass.getESuperTypes().add(this.getEventMethod());
- postPersistEClass.getESuperTypes().add(this.getEventMethod());
- postRemoveEClass.getESuperTypes().add(this.getEventMethod());
- postUpdateEClass.getESuperTypes().add(this.getEventMethod());
- prePersistEClass.getESuperTypes().add(this.getEventMethod());
- preRemoveEClass.getESuperTypes().add(this.getEventMethod());
- preUpdateEClass.getESuperTypes().add(this.getEventMethod());
- xmlPrimaryKeyJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- abstractXmlBaseTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlTableEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlSecondaryTableEClass.getESuperTypes().add(this.getXmlBaseTable());
- xmlSecondaryTableImplEClass.getESuperTypes().add(this.getAbstractXmlBaseTable());
- xmlSecondaryTableImplEClass.getESuperTypes().add(this.getXmlSecondaryTable());
- xmlSequenceGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlSequenceGeneratorImplEClass.getESuperTypes().add(this.getXmlSequenceGenerator());
- xmlTableGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlTableGeneratorImplEClass.getESuperTypes().add(this.getXmlTableGenerator());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEntityMappings_Version(), this.getVersionType(), "version", "1.0", 1, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_PersistenceUnitMetadata(), this.getXmlPersistenceUnitMetadata(), null, "persistenceUnitMetadata", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Package(), theXMLTypePackage.getString(), "package", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Access(), this.getAccessType(), "access", "PROPERTY", 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_SequenceGenerators(), this.getXmlSequenceGenerator(), null, "sequenceGenerators", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_TableGenerators(), this.getXmlTableGenerator(), null, "tableGenerators", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_SqlResultSetMappings(), this.getSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_MappedSuperclasses(), this.getXmlMappedSuperclass(), null, "mappedSuperclasses", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_Entities(), this.getXmlEntity(), null, "entities", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_Embeddables(), this.getXmlEmbeddable(), null, "embeddables", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitMetadataEClass, XmlPersistenceUnitMetadata.class, "XmlPersistenceUnitMetadata", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete(), theXMLTypePackage.getBoolean(), "xmlMappingMetadataComplete", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnitMetadata_PersistenceUnitDefaults(), this.getXmlPersistenceUnitDefaults(), null, "persistenceUnitDefaults", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitDefaultsEClass, XmlPersistenceUnitDefaults.class, "XmlPersistenceUnitDefaults", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitDefaults_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_Access(), this.getAccessType(), "access", "PROPERTY", 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_CascadePersist(), theXMLTypePackage.getBoolean(), "cascadePersist", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnitDefaults_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlTypeMappingEClass, AbstractXmlTypeMapping.class, "AbstractXmlTypeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlTypeMapping_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_Access(), this.getAccessType(), "access", "PROPERTY", 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_MetadataComplete(), theXMLTypePackage.getBooleanObject(), "metadataComplete", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTypeMapping_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAbstractXmlTypeMapping_Attributes(), this.getAttributes(), null, "attributes", null, 0, 1, AbstractXmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_IdClass(), this.getIdClass(), null, "idClass", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PrePersist(), this.getPrePersist(), null, "prePersist", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PostPersist(), this.getPostPersist(), null, "postPersist", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PreRemove(), this.getPreRemove(), null, "preRemove", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PostRemove(), this.getPostRemove(), null, "postRemove", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PreUpdate(), this.getPreUpdate(), null, "preUpdate", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PostUpdate(), this.getPostUpdate(), null, "postUpdate", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_PostLoad(), this.getPostLoad(), null, "postLoad", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityEClass, XmlEntity.class, "XmlEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEntity_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_Table(), this.getXmlTable(), null, "table", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_SecondaryTables(), this.getXmlSecondaryTable(), null, "secondaryTables", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_IdClass(), this.getIdClass(), null, "idClass", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_Inheritance(), this.getInheritance(), null, "inheritance", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_DiscriminatorValue(), this.getDiscriminatorValue(), "discriminatorValue", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_DiscriminatorColumn(), this.getXmlDiscriminatorColumn(), null, "discriminatorColumn", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_SequenceGenerator(), this.getXmlSequenceGenerator(), null, "sequenceGenerator", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_TableGenerator(), this.getXmlTableGenerator(), null, "tableGenerator", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_SqlResultSetMappings(), this.getSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PrePersist(), this.getPrePersist(), null, "prePersist", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PostPersist(), this.getPostPersist(), null, "postPersist", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PreRemove(), this.getPreRemove(), null, "preRemove", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PostRemove(), this.getPostRemove(), null, "postRemove", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PreUpdate(), this.getPreUpdate(), null, "preUpdate", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PostUpdate(), this.getPostUpdate(), null, "postUpdate", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_PostLoad(), this.getPostLoad(), null, "postLoad", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_AssociationOverrides(), this.getXmlAssociationOverride(), null, "associationOverrides", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAttributes_Ids(), this.getXmlId(), null, "ids", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_EmbeddedIds(), this.getXmlEmbeddedId(), null, "embeddedIds", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Basics(), this.getXmlBasic(), null, "basics", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Versions(), this.getXmlVersion(), null, "versions", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_ManyToOnes(), this.getXmlManyToOne(), null, "manyToOnes", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_OneToManys(), this.getXmlOneToMany(), null, "oneToManys", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_OneToOnes(), this.getXmlOneToOne(), null, "oneToOnes", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_ManyToManys(), this.getXmlManyToMany(), null, "manyToManys", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Embeddeds(), this.getXmlEmbedded(), null, "embeddeds", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Transients(), this.getXmlTransient(), null, "transients", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAttributeMapping_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAttributeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlAttributeMappingEClass, AbstractXmlAttributeMapping.class, "AbstractXmlAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(columnMappingEClass, ColumnMapping.class, "ColumnMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getColumnMapping_Column(), this.getXmlColumn(), null, "column", null, 0, 1, ColumnMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlRelationshipMappingEClass, XmlRelationshipMapping.class, "XmlRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRelationshipMapping_TargetEntity(), theXMLTypePackage.getString(), "targetEntity", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlRelationshipMapping_Fetch(), this.getFetchType(), "fetch", "LAZY", 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlRelationshipMapping_JoinTable(), this.getXmlJoinTable(), null, "joinTable", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlRelationshipMapping_Cascade(), this.getCascadeType(), null, "cascade", null, 0, 1, XmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultiRelationshipMappingEClass, XmlMultiRelationshipMapping.class, "XmlMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultiRelationshipMapping_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMultiRelationshipMapping_OrderBy(), this.getOrderBy(), "orderBy", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultiRelationshipMapping_MapKey(), this.getMapKey(), null, "mapKey", null, 0, 1, XmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSingleRelationshipMappingEClass, XmlSingleRelationshipMapping.class, "XmlSingleRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSingleRelationshipMapping_Optional(), theXMLTypePackage.getBooleanObject(), "optional", null, 0, 1, XmlSingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlSingleRelationshipMapping_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlSingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIdEClass, XmlId.class, "XmlId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_GeneratedValue(), this.getXmlGeneratedValue(), null, "generatedValue", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlId_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlId_TableGenerator(), this.getXmlTableGenerator(), null, "tableGenerator", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlId_SequenceGenerator(), this.getXmlSequenceGenerator(), null, "sequenceGenerator", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIdImplEClass, XmlIdImpl.class, "XmlIdImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedIdEClass, XmlEmbeddedId.class, "XmlEmbeddedId", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbeddedId_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", null, 0, -1, XmlEmbeddedId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedIdImplEClass, XmlEmbeddedIdImpl.class, "XmlEmbeddedIdImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicEClass, XmlBasic.class, "XmlBasic", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBasic_Fetch(), this.getFetchType(), "fetch", "LAZY", 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_Optional(), theXMLTypePackage.getBooleanObject(), "optional", null, 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_Lob(), theXMLTypePackage.getBoolean(), "lob", null, 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_Enumerated(), this.getEnumType(), "enumerated", null, 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicImplEClass, XmlBasicImpl.class, "XmlBasicImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlVersion_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, XmlVersion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersionImplEClass, XmlVersionImpl.class, "XmlVersionImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneImplEClass, XmlManyToOneImpl.class, "XmlManyToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlOneToMany_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlOneToMany.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToManyImplEClass, XmlOneToManyImpl.class, "XmlOneToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToOne_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlOneToOne.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlOneToOne_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, XmlOneToOne.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToOneImplEClass, XmlOneToOneImpl.class, "XmlOneToOneImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyImplEClass, XmlManyToManyImpl.class, "XmlManyToManyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedEClass, XmlEmbedded.class, "XmlEmbedded", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbedded_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", null, 0, -1, XmlEmbedded.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedImplEClass, XmlEmbeddedImpl.class, "XmlEmbeddedImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientImplEClass, XmlTransientImpl.class, "XmlTransientImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAssociationOverrideEClass, XmlAssociationOverride.class, "XmlAssociationOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAssociationOverride_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 1, -1, XmlAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAssociationOverride_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAssociationOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeOverrideEClass, XmlAttributeOverride.class, "XmlAttributeOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAttributeOverride_Column(), this.getXmlColumn(), null, "column", null, 1, 1, XmlAttributeOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAttributeOverride_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAttributeOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeOverrideImplEClass, XmlAttributeOverrideImpl.class, "XmlAttributeOverrideImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(cascadeTypeEClass, CascadeType.class, "CascadeType", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getCascadeType_CascadeAll(), theXMLTypePackage.getBoolean(), "cascadeAll", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadePersist(), theXMLTypePackage.getBoolean(), "cascadePersist", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeMerge(), theXMLTypePackage.getBoolean(), "cascadeMerge", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeRemove(), theXMLTypePackage.getBoolean(), "cascadeRemove", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeRefresh(), theXMLTypePackage.getBoolean(), "cascadeRefresh", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(cascadeTypeImplEClass, CascadeTypeImpl.class, "CascadeTypeImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedColumnEClass, XmlNamedColumn.class, "XmlNamedColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedColumn_ColumnDefinition(), theXMLTypePackage.getString(), "columnDefinition", null, 0, 1, XmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedColumn_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlNamedColumnEClass, AbstractXmlNamedColumn.class, "AbstractXmlNamedColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAbstractColumnEClass, XmlAbstractColumn.class, "XmlAbstractColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAbstractColumn_Insertable(), theXMLTypePackage.getBooleanObject(), "insertable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Nullable(), theXMLTypePackage.getBooleanObject(), "nullable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAbstractColumn_Updatable(), theXMLTypePackage.getBooleanObject(), "updatable", null, 0, 1, XmlAbstractColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlAbstractColumnEClass, AbstractXmlAbstractColumn.class, "AbstractXmlAbstractColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlColumnEClass, XmlColumn.class, "XmlColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlColumn_Precision(), theXMLTypePackage.getIntObject(), "precision", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlColumn_Scale(), theXMLTypePackage.getIntObject(), "scale", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlColumnImplEClass, XmlColumnImpl.class, "XmlColumnImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(columnResultEClass, ColumnResult.class, "ColumnResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getColumnResult_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, ColumnResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlDiscriminatorColumnEClass, XmlDiscriminatorColumn.class, "XmlDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlDiscriminatorColumn_DiscriminatorType(), this.getDiscriminatorType(), "discriminatorType", "STRING", 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlDiscriminatorColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityListenersEClass, EntityListeners.class, "EntityListeners", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getEntityListeners_EntityListeners(), this.getEntityListener(), null, "entityListeners", null, 0, -1, EntityListeners.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityListenerEClass, EntityListener.class, "EntityListener", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEntityListener_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PrePersist(), this.getPrePersist(), null, "prePersist", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostPersist(), this.getPostPersist(), null, "postPersist", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PreRemove(), this.getPreRemove(), null, "preRemove", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostRemove(), this.getPostRemove(), null, "postRemove", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PreUpdate(), this.getPreUpdate(), null, "preUpdate", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostUpdate(), this.getPostUpdate(), null, "postUpdate", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityListener_PostLoad(), this.getPostLoad(), null, "postLoad", null, 0, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityResultEClass, EntityResult.class, "EntityResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEntityResult_DiscriminatorColumn(), theXMLTypePackage.getString(), "discriminatorColumn", null, 0, 1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getEntityResult_EntityClass(), theXMLTypePackage.getString(), "entityClass", null, 1, 1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityResult_FieldResults(), this.getFieldResult(), null, "fieldResults", null, 0, -1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(eventMethodEClass, EventMethod.class, "EventMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEventMethod_MethodName(), theXMLTypePackage.getString(), "methodName", null, 1, 1, EventMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(fieldResultEClass, FieldResult.class, "FieldResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getFieldResult_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, FieldResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getFieldResult_Column(), theXMLTypePackage.getString(), "column", null, 1, 1, FieldResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGeneratedValueEClass, XmlGeneratedValue.class, "XmlGeneratedValue", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlGeneratedValue_Generator(), theXMLTypePackage.getString(), "generator", null, 0, 1, XmlGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGeneratedValue_Strategy(), this.getGenerationType(), "strategy", "TABLE", 0, 1, XmlGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGeneratedValueImplEClass, XmlGeneratedValueImpl.class, "XmlGeneratedValueImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(idClassEClass, IdClass.class, "IdClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getIdClass_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, IdClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(inheritanceEClass, Inheritance.class, "Inheritance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getInheritance_Strategy(), this.getInheritanceType(), "strategy", "SINGLE_TABLE", 0, 1, Inheritance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinColumnEClass, XmlJoinColumn.class, "XmlJoinColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinColumn_ReferencedColumnName(), theXMLTypePackage.getString(), "referencedColumnName", null, 0, 1, XmlJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinColumnImplEClass, XmlJoinColumnImpl.class, "XmlJoinColumnImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlJoinTable_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlJoinTable_InverseJoinColumns(), this.getXmlJoinColumn(), null, "inverseJoinColumns", null, 0, -1, XmlJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTableImplEClass, XmlJoinTableImpl.class, "XmlJoinTableImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(lobEClass, Lob.class, "Lob", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(mapKeyEClass, MapKey.class, "MapKey", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getMapKey_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, MapKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(mapKeyImplEClass, MapKeyImpl.class, "MapKeyImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlQueryEClass, XmlQuery.class, "XmlQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQuery_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQuery_Query(), theXMLTypePackage.getString(), "query", null, 1, 1, XmlQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlQuery_Hints(), this.getXmlQueryHint(), null, "hints", null, 0, -1, XmlQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedNativeQuery_ResultClass(), theXMLTypePackage.getString(), "resultClass", null, 0, 1, XmlNamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedNativeQuery_ResultSetMapping(), theXMLTypePackage.getString(), "resultSetMapping", null, 0, 1, XmlNamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedQueryEClass, XmlNamedQuery.class, "XmlNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postLoadEClass, PostLoad.class, "PostLoad", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postPersistEClass, PostPersist.class, "PostPersist", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postRemoveEClass, PostRemove.class, "PostRemove", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postUpdateEClass, PostUpdate.class, "PostUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(prePersistEClass, PrePersist.class, "PrePersist", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(preRemoveEClass, PreRemove.class, "PreRemove", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(preUpdateEClass, PreUpdate.class, "PreUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKeyJoinColumnEClass, XmlPrimaryKeyJoinColumn.class, "XmlPrimaryKeyJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKeyJoinColumn_ReferencedColumnName(), theXMLTypePackage.getString(), "referencedColumnName", null, 0, 1, XmlPrimaryKeyJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryHintEClass, XmlQueryHint.class, "XmlQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQueryHint_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryHint_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, XmlQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlBaseTableEClass, AbstractXmlBaseTable.class, "AbstractXmlBaseTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBaseTableEClass, XmlBaseTable.class, "XmlBaseTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBaseTable_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBaseTable_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBaseTable_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlBaseTable_UniqueConstraints(), this.getUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, XmlBaseTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTableEClass, XmlTable.class, "XmlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlSecondaryTableEClass, XmlSecondaryTable.class, "XmlSecondaryTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlSecondaryTable_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, XmlSecondaryTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSecondaryTableImplEClass, XmlSecondaryTableImpl.class, "XmlSecondaryTableImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlGeneratorEClass, XmlGenerator.class, "XmlGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlGenerator_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGenerator_InitialValue(), theXMLTypePackage.getIntObject(), "initialValue", null, 0, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGenerator_AllocationSize(), theXMLTypePackage.getIntObject(), "allocationSize", null, 0, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSequenceGeneratorEClass, XmlSequenceGenerator.class, "XmlSequenceGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSequenceGenerator_SequenceName(), theXMLTypePackage.getString(), "sequenceName", null, 0, 1, XmlSequenceGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSequenceGeneratorImplEClass, XmlSequenceGeneratorImpl.class, "XmlSequenceGeneratorImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(sqlResultSetMappingEClass, SqlResultSetMapping.class, "SqlResultSetMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getSqlResultSetMapping_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSqlResultSetMapping_EntityResults(), this.getEntityResult(), null, "entityResults", null, 0, -1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSqlResultSetMapping_ColumnResults(), this.getColumnResult(), null, "columnResults", null, 0, -1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTableGeneratorEClass, XmlTableGenerator.class, "XmlTableGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTableGenerator_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_PkColumnName(), theXMLTypePackage.getString(), "pkColumnName", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_ValueColumnName(), theXMLTypePackage.getString(), "valueColumnName", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_PkColumnValue(), theXMLTypePackage.getString(), "pkColumnValue", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlTableGenerator_UniqueConstraints(), this.getUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTableGeneratorImplEClass, XmlTableGeneratorImpl.class, "XmlTableGeneratorImpl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(uniqueConstraintEClass, UniqueConstraint.class, "UniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getUniqueConstraint_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 1, -1, UniqueConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(accessTypeEEnum, AccessType.class, "AccessType");
- addEEnumLiteral(accessTypeEEnum, AccessType.PROPERTY);
- addEEnumLiteral(accessTypeEEnum, AccessType.FIELD);
-
- initEEnum(discriminatorTypeEEnum, DiscriminatorType.class, "DiscriminatorType");
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.STRING);
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.CHAR);
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.INTEGER);
-
- initEEnum(enumTypeEEnum, EnumType.class, "EnumType");
- addEEnumLiteral(enumTypeEEnum, EnumType.ORDINAL);
- addEEnumLiteral(enumTypeEEnum, EnumType.STRING);
-
- initEEnum(fetchTypeEEnum, FetchType.class, "FetchType");
- addEEnumLiteral(fetchTypeEEnum, FetchType.LAZY);
- addEEnumLiteral(fetchTypeEEnum, FetchType.EAGER);
-
- initEEnum(generationTypeEEnum, GenerationType.class, "GenerationType");
- addEEnumLiteral(generationTypeEEnum, GenerationType.TABLE);
- addEEnumLiteral(generationTypeEEnum, GenerationType.SEQUENCE);
- addEEnumLiteral(generationTypeEEnum, GenerationType.IDENTITY);
- addEEnumLiteral(generationTypeEEnum, GenerationType.AUTO);
-
- initEEnum(inheritanceTypeEEnum, InheritanceType.class, "InheritanceType");
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.SINGLE_TABLE);
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.JOINED);
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.TABLE_PER_CLASS);
-
- initEEnum(temporalTypeEEnum, TemporalType.class, "TemporalType");
- addEEnumLiteral(temporalTypeEEnum, TemporalType.DATE);
- addEEnumLiteral(temporalTypeEEnum, TemporalType.TIME);
- addEEnumLiteral(temporalTypeEEnum, TemporalType.TIMESTAMP);
-
- // Initialize data types
- initEDataType(discriminatorValueEDataType, String.class, "DiscriminatorValue", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(enumeratedEDataType, Enumerator.class, "Enumerated", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(orderByEDataType, String.class, "OrderBy", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(versionTypeEDataType, String.class, "VersionType", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // Create resource
- createResource(eNS_URI);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS = eINSTANCE.getXmlEntityMappings();
-
- /**
- * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__VERSION = eINSTANCE.getXmlEntityMappings_Version();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__DESCRIPTION = eINSTANCE.getXmlEntityMappings_Description();
-
- /**
- * The meta object literal for the '<em><b>Persistence Unit Metadata</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlEntityMappings_PersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Package</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__PACKAGE = eINSTANCE.getXmlEntityMappings_Package();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__SCHEMA = eINSTANCE.getXmlEntityMappings_Schema();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__CATALOG = eINSTANCE.getXmlEntityMappings_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__ACCESS = eINSTANCE.getXmlEntityMappings_Access();
-
- /**
- * The meta object literal for the '<em><b>Sequence Generators</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS = eINSTANCE.getXmlEntityMappings_SequenceGenerators();
-
- /**
- * The meta object literal for the '<em><b>Table Generators</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__TABLE_GENERATORS = eINSTANCE.getXmlEntityMappings_TableGenerators();
-
- /**
- * The meta object literal for the '<em><b>Named Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__NAMED_QUERIES = eINSTANCE.getXmlEntityMappings_NamedQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Native Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES = eINSTANCE.getXmlEntityMappings_NamedNativeQueries();
-
- /**
- * The meta object literal for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlEntityMappings_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Mapped Superclasses</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES = eINSTANCE.getXmlEntityMappings_MappedSuperclasses();
-
- /**
- * The meta object literal for the '<em><b>Entities</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__ENTITIES = eINSTANCE.getXmlEntityMappings_Entities();
-
- /**
- * The meta object literal for the '<em><b>Embeddables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__EMBEDDABLES = eINSTANCE.getXmlEntityMappings_Embeddables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlPersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = eINSTANCE.getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete();
-
- /**
- * The meta object literal for the '<em><b>Persistence Unit Defaults</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitDefaults();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA = eINSTANCE.getXmlPersistenceUnitDefaults_Schema();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG = eINSTANCE.getXmlPersistenceUnitDefaults_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS = eINSTANCE.getXmlPersistenceUnitDefaults_Access();
-
- /**
- * The meta object literal for the '<em><b>Cascade Persist</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = eINSTANCE.getXmlPersistenceUnitDefaults_CascadePersist();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS = eINSTANCE.getXmlPersistenceUnitDefaults_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_TYPE_MAPPING = eINSTANCE.getAbstractXmlTypeMapping();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME = eINSTANCE.getAbstractXmlTypeMapping_ClassName();
-
- /**
- * The meta object literal for the '<em><b>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__ACCESS = eINSTANCE.getAbstractXmlTypeMapping_Access();
-
- /**
- * The meta object literal for the '<em><b>Metadata Complete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE = eINSTANCE.getAbstractXmlTypeMapping_MetadataComplete();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION = eINSTANCE.getAbstractXmlTypeMapping_Description();
-
- /**
- * The meta object literal for the '<em><b>Attributes</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES = eINSTANCE.getAbstractXmlTypeMapping_Attributes();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
-
- /**
- * The meta object literal for the '<em><b>Id Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__ID_CLASS = eINSTANCE.getXmlMappedSuperclass_IdClass();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = eINSTANCE.getXmlMappedSuperclass_EntityListeners();
-
- /**
- * The meta object literal for the '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__PRE_PERSIST = eINSTANCE.getXmlMappedSuperclass_PrePersist();
-
- /**
- * The meta object literal for the '<em><b>Post Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__POST_PERSIST = eINSTANCE.getXmlMappedSuperclass_PostPersist();
-
- /**
- * The meta object literal for the '<em><b>Pre Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__PRE_REMOVE = eINSTANCE.getXmlMappedSuperclass_PreRemove();
-
- /**
- * The meta object literal for the '<em><b>Post Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__POST_REMOVE = eINSTANCE.getXmlMappedSuperclass_PostRemove();
-
- /**
- * The meta object literal for the '<em><b>Pre Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__PRE_UPDATE = eINSTANCE.getXmlMappedSuperclass_PreUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__POST_UPDATE = eINSTANCE.getXmlMappedSuperclass_PostUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Load</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__POST_LOAD = eINSTANCE.getXmlMappedSuperclass_PostLoad();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @generated
- */
- public static final EClass XML_ENTITY = eINSTANCE.getXmlEntity();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__NAME = eINSTANCE.getXmlEntity_Name();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__TABLE = eINSTANCE.getXmlEntity_Table();
-
- /**
- * The meta object literal for the '<em><b>Secondary Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__SECONDARY_TABLES = eINSTANCE.getXmlEntity_SecondaryTables();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlEntity_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '<em><b>Id Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ID_CLASS = eINSTANCE.getXmlEntity_IdClass();
-
- /**
- * The meta object literal for the '<em><b>Inheritance</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__INHERITANCE = eINSTANCE.getXmlEntity_Inheritance();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__DISCRIMINATOR_VALUE = eINSTANCE.getXmlEntity_DiscriminatorValue();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__DISCRIMINATOR_COLUMN = eINSTANCE.getXmlEntity_DiscriminatorColumn();
-
- /**
- * The meta object literal for the '<em><b>Sequence Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__SEQUENCE_GENERATOR = eINSTANCE.getXmlEntity_SequenceGenerator();
-
- /**
- * The meta object literal for the '<em><b>Table Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__TABLE_GENERATOR = eINSTANCE.getXmlEntity_TableGenerator();
-
- /**
- * The meta object literal for the '<em><b>Named Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__NAMED_QUERIES = eINSTANCE.getXmlEntity_NamedQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Native Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__NAMED_NATIVE_QUERIES = eINSTANCE.getXmlEntity_NamedNativeQueries();
-
- /**
- * The meta object literal for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlEntity_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlEntity_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlEntity_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ENTITY_LISTENERS = eINSTANCE.getXmlEntity_EntityListeners();
-
- /**
- * The meta object literal for the '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRE_PERSIST = eINSTANCE.getXmlEntity_PrePersist();
-
- /**
- * The meta object literal for the '<em><b>Post Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__POST_PERSIST = eINSTANCE.getXmlEntity_PostPersist();
-
- /**
- * The meta object literal for the '<em><b>Pre Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRE_REMOVE = eINSTANCE.getXmlEntity_PreRemove();
-
- /**
- * The meta object literal for the '<em><b>Post Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__POST_REMOVE = eINSTANCE.getXmlEntity_PostRemove();
-
- /**
- * The meta object literal for the '<em><b>Pre Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRE_UPDATE = eINSTANCE.getXmlEntity_PreUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__POST_UPDATE = eINSTANCE.getXmlEntity_PostUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Load</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__POST_LOAD = eINSTANCE.getXmlEntity_PostLoad();
-
- /**
- * The meta object literal for the '<em><b>Attribute Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlEntity_AttributeOverrides();
-
- /**
- * The meta object literal for the '<em><b>Association Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ASSOCIATION_OVERRIDES = eINSTANCE.getXmlEntity_AssociationOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE = eINSTANCE.getXmlEmbeddable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Attributes
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @generated
- */
- public static final EClass ATTRIBUTES = eINSTANCE.getAttributes();
-
- /**
- * The meta object literal for the '<em><b>Ids</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__IDS = eINSTANCE.getAttributes_Ids();
-
- /**
- * The meta object literal for the '<em><b>Embedded Ids</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__EMBEDDED_IDS = eINSTANCE.getAttributes_EmbeddedIds();
-
- /**
- * The meta object literal for the '<em><b>Basics</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASICS = eINSTANCE.getAttributes_Basics();
-
- /**
- * The meta object literal for the '<em><b>Versions</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__VERSIONS = eINSTANCE.getAttributes_Versions();
-
- /**
- * The meta object literal for the '<em><b>Many To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__MANY_TO_ONES = eINSTANCE.getAttributes_ManyToOnes();
-
- /**
- * The meta object literal for the '<em><b>One To Manys</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__ONE_TO_MANYS = eINSTANCE.getAttributes_OneToManys();
-
- /**
- * The meta object literal for the '<em><b>One To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__ONE_TO_ONES = eINSTANCE.getAttributes_OneToOnes();
-
- /**
- * The meta object literal for the '<em><b>Many To Manys</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__MANY_TO_MANYS = eINSTANCE.getAttributes_ManyToManys();
-
- /**
- * The meta object literal for the '<em><b>Embeddeds</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__EMBEDDEDS = eINSTANCE.getAttributes_Embeddeds();
-
- /**
- * The meta object literal for the '<em><b>Transients</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__TRANSIENTS = eINSTANCE.getAttributes_Transients();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTE_MAPPING__NAME = eINSTANCE.getXmlAttributeMapping_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_ATTRIBUTE_MAPPING = eINSTANCE.getAbstractXmlAttributeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @generated
- */
- public static final EClass COLUMN_MAPPING = eINSTANCE.getColumnMapping();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference COLUMN_MAPPING__COLUMN = eINSTANCE.getColumnMapping_Column();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping <em>Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @generated
- */
- public static final EClass XML_RELATIONSHIP_MAPPING = eINSTANCE.getXmlRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Target Entity</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = eINSTANCE.getXmlRelationshipMapping_TargetEntity();
-
- /**
- * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getXmlRelationshipMapping_Fetch();
-
- /**
- * The meta object literal for the '<em><b>Join Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_RELATIONSHIP_MAPPING__JOIN_TABLE = eINSTANCE.getXmlRelationshipMapping_JoinTable();
-
- /**
- * The meta object literal for the '<em><b>Cascade</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_RELATIONSHIP_MAPPING__CASCADE = eINSTANCE.getXmlRelationshipMapping_Cascade();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @generated
- */
- public static final EClass XML_MULTI_RELATIONSHIP_MAPPING = eINSTANCE.getXmlMultiRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Mapped By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = eINSTANCE.getXmlMultiRelationshipMapping_MappedBy();
-
- /**
- * The meta object literal for the '<em><b>Order By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = eINSTANCE.getXmlMultiRelationshipMapping_OrderBy();
-
- /**
- * The meta object literal for the '<em><b>Map Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = eINSTANCE.getXmlMultiRelationshipMapping_MapKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping <em>Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @generated
- */
- public static final EClass XML_SINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getXmlSingleRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Optional</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = eINSTANCE.getXmlSingleRelationshipMapping_Optional();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = eINSTANCE.getXmlSingleRelationshipMapping_JoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @generated
- */
- public static final EClass XML_ID = eINSTANCE.getXmlId();
-
- /**
- * The meta object literal for the '<em><b>Generated Value</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID__GENERATED_VALUE = eINSTANCE.getXmlId_GeneratedValue();
-
- /**
- * The meta object literal for the '<em><b>Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ID__TEMPORAL = eINSTANCE.getXmlId_Temporal();
-
- /**
- * The meta object literal for the '<em><b>Table Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID__TABLE_GENERATOR = eINSTANCE.getXmlId_TableGenerator();
-
- /**
- * The meta object literal for the '<em><b>Sequence Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID__SEQUENCE_GENERATOR = eINSTANCE.getXmlId_SequenceGenerator();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl <em>Xml Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @generated
- */
- public static final EClass XML_ID_IMPL = eINSTANCE.getXmlIdImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID = eINSTANCE.getXmlEmbeddedId();
-
- /**
- * The meta object literal for the '<em><b>Attribute Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlEmbeddedId_AttributeOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl <em>Xml Embedded Id Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedIdImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedIdImpl()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID_IMPL = eINSTANCE.getXmlEmbeddedIdImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @generated
- */
- public static final EClass XML_BASIC = eINSTANCE.getXmlBasic();
-
- /**
- * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__FETCH = eINSTANCE.getXmlBasic_Fetch();
-
- /**
- * The meta object literal for the '<em><b>Optional</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__OPTIONAL = eINSTANCE.getXmlBasic_Optional();
-
- /**
- * The meta object literal for the '<em><b>Lob</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__LOB = eINSTANCE.getXmlBasic_Lob();
-
- /**
- * The meta object literal for the '<em><b>Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__TEMPORAL = eINSTANCE.getXmlBasic_Temporal();
-
- /**
- * The meta object literal for the '<em><b>Enumerated</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__ENUMERATED = eINSTANCE.getXmlBasic_Enumerated();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl <em>Xml Basic Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasicImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @generated
- */
- public static final EClass XML_BASIC_IMPL = eINSTANCE.getXmlBasicImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @generated
- */
- public static final EClass XML_VERSION = eINSTANCE.getXmlVersion();
-
- /**
- * The meta object literal for the '<em><b>Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VERSION__TEMPORAL = eINSTANCE.getXmlVersion_Temporal();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl <em>Xml Version Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersionImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersionImpl()
- * @generated
- */
- public static final EClass XML_VERSION_IMPL = eINSTANCE.getXmlVersionImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE = eINSTANCE.getXmlManyToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl <em>Xml Many To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOneImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_IMPL = eINSTANCE.getXmlManyToOneImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY = eINSTANCE.getXmlOneToMany();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ONE_TO_MANY__JOIN_COLUMNS = eINSTANCE.getXmlOneToMany_JoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl <em>Xml One To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToManyImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_IMPL = eINSTANCE.getXmlOneToManyImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE = eINSTANCE.getXmlOneToOne();
-
- /**
- * The meta object literal for the '<em><b>Mapped By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE__MAPPED_BY = eINSTANCE.getXmlOneToOne_MappedBy();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlOneToOne_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl <em>Xml One To One Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_IMPL = eINSTANCE.getXmlOneToOneImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl <em>Xml Many To Many Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToManyImpl()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_IMPL = eINSTANCE.getXmlManyToManyImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final EClass XML_EMBEDDED = eINSTANCE.getXmlEmbedded();
-
- /**
- * The meta object literal for the '<em><b>Attribute Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDED__ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlEmbedded_AttributeOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl <em>Xml Embedded Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedImpl()
- * @generated
- */
- public static final EClass XML_EMBEDDED_IMPL = eINSTANCE.getXmlEmbeddedImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransient()
- * @generated
- */
- public static final EClass XML_TRANSIENT = eINSTANCE.getXmlTransient();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransientImpl <em>Xml Transient Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransientImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransientImpl()
- * @generated
- */
- public static final EClass XML_TRANSIENT_IMPL = eINSTANCE.getXmlTransientImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @generated
- */
- public static final EClass XML_ASSOCIATION_OVERRIDE = eINSTANCE.getXmlAssociationOverride();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = eINSTANCE.getXmlAssociationOverride_JoinColumns();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ASSOCIATION_OVERRIDE__NAME = eINSTANCE.getXmlAssociationOverride_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE = eINSTANCE.getXmlAttributeOverride();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTE_OVERRIDE__COLUMN = eINSTANCE.getXmlAttributeOverride_Column();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTE_OVERRIDE__NAME = eINSTANCE.getXmlAttributeOverride_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl <em>Xml Attribute Override Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE_IMPL = eINSTANCE.getXmlAttributeOverrideImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @generated
- */
- public static final EClass CASCADE_TYPE = eINSTANCE.getCascadeType();
-
- /**
- * The meta object literal for the '<em><b>Cascade All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_ALL = eINSTANCE.getCascadeType_CascadeAll();
-
- /**
- * The meta object literal for the '<em><b>Cascade Persist</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_PERSIST = eINSTANCE.getCascadeType_CascadePersist();
-
- /**
- * The meta object literal for the '<em><b>Cascade Merge</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_MERGE = eINSTANCE.getCascadeType_CascadeMerge();
-
- /**
- * The meta object literal for the '<em><b>Cascade Remove</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_REMOVE = eINSTANCE.getCascadeType_CascadeRemove();
-
- /**
- * The meta object literal for the '<em><b>Cascade Refresh</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_REFRESH = eINSTANCE.getCascadeType_CascadeRefresh();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.CascadeTypeImpl <em>Cascade Type Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeTypeImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeTypeImpl()
- * @generated
- */
- public static final EClass CASCADE_TYPE_IMPL = eINSTANCE.getCascadeTypeImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn <em>Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @generated
- */
- public static final EClass XML_NAMED_COLUMN = eINSTANCE.getXmlNamedColumn();
-
- /**
- * The meta object literal for the '<em><b>Column Definition</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_COLUMN__COLUMN_DEFINITION = eINSTANCE.getXmlNamedColumn_ColumnDefinition();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_COLUMN__NAME = eINSTANCE.getXmlNamedColumn_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @generated
- */
- public static final EClass ABSTRACT_XML_NAMED_COLUMN = eINSTANCE.getAbstractXmlNamedColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn <em>Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @generated
- */
- public static final EClass XML_ABSTRACT_COLUMN = eINSTANCE.getXmlAbstractColumn();
-
- /**
- * The meta object literal for the '<em><b>Insertable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__INSERTABLE = eINSTANCE.getXmlAbstractColumn_Insertable();
-
- /**
- * The meta object literal for the '<em><b>Nullable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__NULLABLE = eINSTANCE.getXmlAbstractColumn_Nullable();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__TABLE = eINSTANCE.getXmlAbstractColumn_Table();
-
- /**
- * The meta object literal for the '<em><b>Unique</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__UNIQUE = eINSTANCE.getXmlAbstractColumn_Unique();
-
- /**
- * The meta object literal for the '<em><b>Updatable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ABSTRACT_COLUMN__UPDATABLE = eINSTANCE.getXmlAbstractColumn_Updatable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn <em>Abstract Xml Abstract Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAbstractColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAbstractColumn()
- * @generated
- */
- public static final EClass ABSTRACT_XML_ABSTRACT_COLUMN = eINSTANCE.getAbstractXmlAbstractColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @generated
- */
- public static final EClass XML_COLUMN = eINSTANCE.getXmlColumn();
-
- /**
- * The meta object literal for the '<em><b>Length</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__LENGTH = eINSTANCE.getXmlColumn_Length();
-
- /**
- * The meta object literal for the '<em><b>Precision</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__PRECISION = eINSTANCE.getXmlColumn_Precision();
-
- /**
- * The meta object literal for the '<em><b>Scale</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__SCALE = eINSTANCE.getXmlColumn_Scale();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl <em>Xml Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @generated
- */
- public static final EClass XML_COLUMN_IMPL = eINSTANCE.getXmlColumnImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @generated
- */
- public static final EClass COLUMN_RESULT = eINSTANCE.getColumnResult();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute COLUMN_RESULT__NAME = eINSTANCE.getColumnResult_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @generated
- */
- public static final EClass XML_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlDiscriminatorColumn();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorType();
-
- /**
- * The meta object literal for the '<em><b>Length</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_DISCRIMINATOR_COLUMN__LENGTH = eINSTANCE.getXmlDiscriminatorColumn_Length();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @generated
- */
- public static final EClass ENTITY_LISTENERS = eINSTANCE.getEntityListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENERS__ENTITY_LISTENERS = eINSTANCE.getEntityListeners_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @generated
- */
- public static final EClass ENTITY_LISTENER = eINSTANCE.getEntityListener();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ENTITY_LISTENER__CLASS_NAME = eINSTANCE.getEntityListener_ClassName();
-
- /**
- * The meta object literal for the '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__PRE_PERSIST = eINSTANCE.getEntityListener_PrePersist();
-
- /**
- * The meta object literal for the '<em><b>Post Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__POST_PERSIST = eINSTANCE.getEntityListener_PostPersist();
-
- /**
- * The meta object literal for the '<em><b>Pre Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__PRE_REMOVE = eINSTANCE.getEntityListener_PreRemove();
-
- /**
- * The meta object literal for the '<em><b>Post Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__POST_REMOVE = eINSTANCE.getEntityListener_PostRemove();
-
- /**
- * The meta object literal for the '<em><b>Pre Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__PRE_UPDATE = eINSTANCE.getEntityListener_PreUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__POST_UPDATE = eINSTANCE.getEntityListener_PostUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Load</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENER__POST_LOAD = eINSTANCE.getEntityListener_PostLoad();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @generated
- */
- public static final EClass ENTITY_RESULT = eINSTANCE.getEntityResult();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Column</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ENTITY_RESULT__DISCRIMINATOR_COLUMN = eINSTANCE.getEntityResult_DiscriminatorColumn();
-
- /**
- * The meta object literal for the '<em><b>Entity Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ENTITY_RESULT__ENTITY_CLASS = eINSTANCE.getEntityResult_EntityClass();
-
- /**
- * The meta object literal for the '<em><b>Field Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_RESULT__FIELD_RESULTS = eINSTANCE.getEntityResult_FieldResults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @generated
- */
- public static final EClass FIELD_RESULT = eINSTANCE.getFieldResult();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute FIELD_RESULT__NAME = eINSTANCE.getFieldResult_Name();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute FIELD_RESULT__COLUMN = eINSTANCE.getFieldResult_Column();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @generated
- */
- public static final EClass XML_GENERATED_VALUE = eINSTANCE.getXmlGeneratedValue();
-
- /**
- * The meta object literal for the '<em><b>Generator</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATED_VALUE__GENERATOR = eINSTANCE.getXmlGeneratedValue_Generator();
-
- /**
- * The meta object literal for the '<em><b>Strategy</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATED_VALUE__STRATEGY = eINSTANCE.getXmlGeneratedValue_Strategy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl <em>Xml Generated Value Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @generated
- */
- public static final EClass XML_GENERATED_VALUE_IMPL = eINSTANCE.getXmlGeneratedValueImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.IdClass <em>Id Class</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.IdClass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getIdClass()
- * @generated
- */
- public static final EClass ID_CLASS = eINSTANCE.getIdClass();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ID_CLASS__CLASS_NAME = eINSTANCE.getIdClass_ClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @generated
- */
- public static final EClass INHERITANCE = eINSTANCE.getInheritance();
-
- /**
- * The meta object literal for the '<em><b>Strategy</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute INHERITANCE__STRATEGY = eINSTANCE.getInheritance_Strategy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @generated
- */
- public static final EClass XML_JOIN_COLUMN = eINSTANCE.getXmlJoinColumn();
-
- /**
- * The meta object literal for the '<em><b>Referenced Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME = eINSTANCE.getXmlJoinColumn_ReferencedColumnName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl <em>Xml Join Column Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @generated
- */
- public static final EClass XML_JOIN_COLUMN_IMPL = eINSTANCE.getXmlJoinColumnImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE = eINSTANCE.getXmlJoinTable();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_TABLE__JOIN_COLUMNS = eINSTANCE.getXmlJoinTable_JoinColumns();
-
- /**
- * The meta object literal for the '<em><b>Inverse Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = eINSTANCE.getXmlJoinTable_InverseJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl <em>Xml Join Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE_IMPL = eINSTANCE.getXmlJoinTableImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getLob()
- * @generated
- */
- public static final EClass LOB = eINSTANCE.getLob();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @generated
- */
- public static final EClass MAP_KEY = eINSTANCE.getMapKey();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute MAP_KEY__NAME = eINSTANCE.getMapKey_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.MapKeyImpl <em>Map Key Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKeyImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKeyImpl()
- * @generated
- */
- public static final EClass MAP_KEY_IMPL = eINSTANCE.getMapKeyImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @generated
- */
- public static final EClass XML_QUERY = eINSTANCE.getXmlQuery();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY__NAME = eINSTANCE.getXmlQuery_Name();
-
- /**
- * The meta object literal for the '<em><b>Query</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY__QUERY = eINSTANCE.getXmlQuery_Query();
-
- /**
- * The meta object literal for the '<em><b>Hints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_QUERY__HINTS = eINSTANCE.getXmlQuery_Hints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @generated
- */
- public static final EClass XML_NAMED_NATIVE_QUERY = eINSTANCE.getXmlNamedNativeQuery();
-
- /**
- * The meta object literal for the '<em><b>Result Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_NATIVE_QUERY__RESULT_CLASS = eINSTANCE.getXmlNamedNativeQuery_ResultClass();
-
- /**
- * The meta object literal for the '<em><b>Result Set Mapping</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = eINSTANCE.getXmlNamedNativeQuery_ResultSetMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @generated
- */
- public static final EClass XML_NAMED_QUERY = eINSTANCE.getXmlNamedQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @generated
- */
- public static final EClass EVENT_METHOD = eINSTANCE.getEventMethod();
-
- /**
- * The meta object literal for the '<em><b>Method Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute EVENT_METHOD__METHOD_NAME = eINSTANCE.getEventMethod_MethodName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostLoad()
- * @generated
- */
- public static final EClass POST_LOAD = eINSTANCE.getPostLoad();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostPersist()
- * @generated
- */
- public static final EClass POST_PERSIST = eINSTANCE.getPostPersist();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostRemove()
- * @generated
- */
- public static final EClass POST_REMOVE = eINSTANCE.getPostRemove();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostUpdate()
- * @generated
- */
- public static final EClass POST_UPDATE = eINSTANCE.getPostUpdate();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPrePersist()
- * @generated
- */
- public static final EClass PRE_PERSIST = eINSTANCE.getPrePersist();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreRemove()
- * @generated
- */
- public static final EClass PRE_REMOVE = eINSTANCE.getPreRemove();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreUpdate()
- * @generated
- */
- public static final EClass PRE_UPDATE = eINSTANCE.getPreUpdate();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_JOIN_COLUMN = eINSTANCE.getXmlPrimaryKeyJoinColumn();
-
- /**
- * The meta object literal for the '<em><b>Referenced Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = eINSTANCE.getXmlPrimaryKeyJoinColumn_ReferencedColumnName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @generated
- */
- public static final EClass XML_QUERY_HINT = eINSTANCE.getXmlQueryHint();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_HINT__NAME = eINSTANCE.getXmlQueryHint_Name();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_HINT__VALUE = eINSTANCE.getXmlQueryHint_Value();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable <em>Abstract Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlBaseTable()
- * @generated
- */
- public static final EClass ABSTRACT_XML_BASE_TABLE = eINSTANCE.getAbstractXmlBaseTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable <em>Xml Base Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBaseTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @generated
- */
- public static final EClass XML_BASE_TABLE = eINSTANCE.getXmlBaseTable();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASE_TABLE__NAME = eINSTANCE.getXmlBaseTable_Name();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASE_TABLE__CATALOG = eINSTANCE.getXmlBaseTable_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASE_TABLE__SCHEMA = eINSTANCE.getXmlBaseTable_Schema();
-
- /**
- * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASE_TABLE__UNIQUE_CONSTRAINTS = eINSTANCE.getXmlBaseTable_UniqueConstraints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTable()
- * @generated
- */
- public static final EClass XML_TABLE = eINSTANCE.getXmlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE = eINSTANCE.getXmlSecondaryTable();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlSecondaryTable_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl <em>Xml Secondary Table Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTableImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE_IMPL = eINSTANCE.getXmlSecondaryTableImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @generated
- */
- public static final EClass XML_GENERATOR = eINSTANCE.getXmlGenerator();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR__NAME = eINSTANCE.getXmlGenerator_Name();
-
- /**
- * The meta object literal for the '<em><b>Initial Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR__INITIAL_VALUE = eINSTANCE.getXmlGenerator_InitialValue();
-
- /**
- * The meta object literal for the '<em><b>Allocation Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR__ALLOCATION_SIZE = eINSTANCE.getXmlGenerator_AllocationSize();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @generated
- */
- public static final EClass XML_SEQUENCE_GENERATOR = eINSTANCE.getXmlSequenceGenerator();
-
- /**
- * The meta object literal for the '<em><b>Sequence Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SEQUENCE_GENERATOR__SEQUENCE_NAME = eINSTANCE.getXmlSequenceGenerator_SequenceName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl <em>Xml Sequence Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @generated
- */
- public static final EClass XML_SEQUENCE_GENERATOR_IMPL = eINSTANCE.getXmlSequenceGeneratorImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @generated
- */
- public static final EClass SQL_RESULT_SET_MAPPING = eINSTANCE.getSqlResultSetMapping();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute SQL_RESULT_SET_MAPPING__NAME = eINSTANCE.getSqlResultSetMapping_Name();
-
- /**
- * The meta object literal for the '<em><b>Entity Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference SQL_RESULT_SET_MAPPING__ENTITY_RESULTS = eINSTANCE.getSqlResultSetMapping_EntityResults();
-
- /**
- * The meta object literal for the '<em><b>Column Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference SQL_RESULT_SET_MAPPING__COLUMN_RESULTS = eINSTANCE.getSqlResultSetMapping_ColumnResults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__TABLE = eINSTANCE.getXmlTableGenerator_Table();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__CATALOG = eINSTANCE.getXmlTableGenerator_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__SCHEMA = eINSTANCE.getXmlTableGenerator_Schema();
-
- /**
- * The meta object literal for the '<em><b>Pk Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__PK_COLUMN_NAME = eINSTANCE.getXmlTableGenerator_PkColumnName();
-
- /**
- * The meta object literal for the '<em><b>Value Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = eINSTANCE.getXmlTableGenerator_ValueColumnName();
-
- /**
- * The meta object literal for the '<em><b>Pk Column Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__PK_COLUMN_VALUE = eINSTANCE.getXmlTableGenerator_PkColumnValue();
-
- /**
- * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = eINSTANCE.getXmlTableGenerator_UniqueConstraints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl <em>Xml Table Generator Impl</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR_IMPL = eINSTANCE.getXmlTableGeneratorImpl();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.UniqueConstraint <em>Unique Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.UniqueConstraint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getUniqueConstraint()
- * @generated
- */
- public static final EClass UNIQUE_CONSTRAINT = eINSTANCE.getUniqueConstraint();
-
- /**
- * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute UNIQUE_CONSTRAINT__COLUMN_NAMES = eINSTANCE.getUniqueConstraint_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @generated
- */
- public static final EEnum ACCESS_TYPE = eINSTANCE.getAccessType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @generated
- */
- public static final EEnum DISCRIMINATOR_TYPE = eINSTANCE.getDiscriminatorType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @generated
- */
- public static final EEnum ENUM_TYPE = eINSTANCE.getEnumType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @generated
- */
- public static final EEnum FETCH_TYPE = eINSTANCE.getFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @generated
- */
- public static final EEnum GENERATION_TYPE = eINSTANCE.getGenerationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @generated
- */
- public static final EEnum INHERITANCE_TYPE = eINSTANCE.getInheritanceType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @generated
- */
- public static final EEnum TEMPORAL_TYPE = eINSTANCE.getTemporalType();
-
- /**
- * The meta object literal for the '<em>Discriminator Value</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorValue()
- * @generated
- */
- public static final EDataType DISCRIMINATOR_VALUE = eINSTANCE.getDiscriminatorValue();
-
- /**
- * The meta object literal for the '<em>Enumerated</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumerated()
- * @generated
- */
- public static final EDataType ENUMERATED = eINSTANCE.getEnumerated();
-
- /**
- * The meta object literal for the '<em>Order By</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getOrderBy()
- * @generated
- */
- public static final EDataType ORDER_BY = eINSTANCE.getOrderBy();
-
- /**
- * The meta object literal for the '<em>Version Type</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getVersionType()
- * @generated
- */
- public static final EDataType VERSION_TYPE = eINSTANCE.getVersionType();
-
- }
-
-} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java
deleted file mode 100644
index 0aa1f932ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResource.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.internal.resource.orm.translators.EntityMappingsTranslator;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class OrmResource extends JpaXmlResource
-{
- public OrmResource(Renderer aRenderer) {
- super(aRenderer);
- }
-
- public OrmResource(URI uri, Renderer aRenderer) {
- super(uri, aRenderer);
- }
-
- public Translator getRootTranslator() {
- return EntityMappingsTranslator.INSTANCE;
- }
-
- @Override
- public void javaElementChanged(ElementChangedEvent event) {
- // TODO Auto-generated method stub
- }
-
- public XmlEntityMappings getEntityMappings() {
- return (XmlEntityMappings) getRootObject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java
deleted file mode 100644
index 5f7e951c9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class OrmResourceFactory extends TranslatorResourceFactory
-{
- public OrmResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public OrmResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public OrmResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new OrmResource(uri, renderer);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceModel.java
deleted file mode 100644
index c7c90dd669..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmResourceModel.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.resource.common.JpaXmlResourceModel;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class OrmResourceModel extends JpaXmlResourceModel
-{
- public OrmResourceModel(IFile file) {
- super(file);
- }
-
-
- /**
- * @see ResourceModel#getResourceType()
- */
- public String getResourceType() {
- return ResourceModel.ORM_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmArtifactEdit buildArtifactEdit(IProject project) {
- return OrmArtifactEdit.getArtifactEditForRead(project);
- }
-
- @Override
- public OrmResource resource() {
- return (OrmResource) super.resource();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java
deleted file mode 100644
index 98419a3518..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Post Load</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostLoad()
- * @model kind="class"
- * @generated
- */
-public class PostLoad extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostLoad()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_LOAD;
- }
-
-} // PostLoad
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java
deleted file mode 100644
index 55ac8f00bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Post Persist</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostPersist()
- * @model kind="class"
- * @generated
- */
-public class PostPersist extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostPersist()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_PERSIST;
- }
-
-} // PostPersist
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java
deleted file mode 100644
index d9a68a060d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Post Remove</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostRemove()
- * @model kind="class"
- * @generated
- */
-public class PostRemove extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostRemove()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_REMOVE;
- }
-
-} // PostRemove
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java
deleted file mode 100644
index cbd617e8cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Post Update</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostUpdate()
- * @model kind="class"
- * @generated
- */
-public class PostUpdate extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostUpdate()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_UPDATE;
- }
-
-} // PostUpdate
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java
deleted file mode 100644
index 461caecf78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Pre Persist</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPrePersist()
- * @model kind="class"
- * @generated
- */
-public class PrePersist extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PrePersist()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_PERSIST;
- }
-
-} // PrePersist
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java
deleted file mode 100644
index 810358352b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Pre Remove</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreRemove()
- * @model kind="class"
- * @generated
- */
-public class PreRemove extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PreRemove()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_REMOVE;
- }
-
-} // PreRemove
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java
deleted file mode 100644
index 01cdff5a0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Pre Update</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreUpdate()
- * @model kind="class"
- * @generated
- */
-public class PreUpdate extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PreUpdate()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_UPDATE;
- }
-
-} // PreUpdate
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java
deleted file mode 100644
index 33bc163750..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Sql Result Set Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults <em>Entity Results</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults <em>Column Results</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class SqlResultSetMapping extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityResults() <em>Entity Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityResults()
- * @generated
- * @ordered
- */
- protected EList<EntityResult> entityResults;
-
- /**
- * The cached value of the '{@link #getColumnResults() <em>Column Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnResults()
- * @generated
- * @ordered
- */
- protected EList<ColumnResult> columnResults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected SqlResultSetMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.SQL_RESULT_SET_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SQL_RESULT_SET_MAPPING__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.EntityResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Results</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping_EntityResults()
- * @model containment="true"
- * @generated
- */
- public EList<EntityResult> getEntityResults()
- {
- if (entityResults == null)
- {
- entityResults = new EObjectContainmentEList<EntityResult>(EntityResult.class, this, OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS);
- }
- return entityResults;
- }
-
- /**
- * Returns the value of the '<em><b>Column Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.ColumnResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Results</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping_ColumnResults()
- * @model containment="true"
- * @generated
- */
- public EList<ColumnResult> getColumnResults()
- {
- if (columnResults == null)
- {
- columnResults = new EObjectContainmentEList<ColumnResult>(ColumnResult.class, this, OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS);
- }
- return columnResults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return ((InternalEList<?>)getEntityResults()).basicRemove(otherEnd, msgs);
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return ((InternalEList<?>)getColumnResults()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- return getName();
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return getEntityResults();
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return getColumnResults();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- getEntityResults().clear();
- getEntityResults().addAll((Collection<? extends EntityResult>)newValue);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- getColumnResults().clear();
- getColumnResults().addAll((Collection<? extends ColumnResult>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- getEntityResults().clear();
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- getColumnResults().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return entityResults != null && !entityResults.isEmpty();
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return columnResults != null && !columnResults.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // SqlResultSetMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java
deleted file mode 100644
index 7b9b8dd6d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Temporal Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @model
- * @generated
- */
-public enum TemporalType implements Enumerator
-{
- /**
- * The '<em><b>DATE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DATE_VALUE
- * @generated
- * @ordered
- */
- DATE(0, "DATE", "DATE"),
-
- /**
- * The '<em><b>TIME</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TIME_VALUE
- * @generated
- * @ordered
- */
- TIME(1, "TIME", "TIME"),
-
- /**
- * The '<em><b>TIMESTAMP</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TIMESTAMP_VALUE
- * @generated
- * @ordered
- */
- TIMESTAMP(2, "TIMESTAMP", "TIMESTAMP");
-
- /**
- * The '<em><b>DATE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DATE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DATE
- * @model
- * @generated
- * @ordered
- */
- public static final int DATE_VALUE = 0;
-
- /**
- * The '<em><b>TIME</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIME</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TIME
- * @model
- * @generated
- * @ordered
- */
- public static final int TIME_VALUE = 1;
-
- /**
- * The '<em><b>TIMESTAMP</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIMESTAMP</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TIMESTAMP
- * @model
- * @generated
- * @ordered
- */
- public static final int TIMESTAMP_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Temporal Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final TemporalType[] VALUES_ARRAY =
- new TemporalType[]
- {
- DATE,
- TIME,
- TIMESTAMP,
- };
-
- /**
- * A public read-only list of all the '<em><b>Temporal Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<TemporalType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- TemporalType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- TemporalType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType get(int value)
- {
- switch (value)
- {
- case DATE_VALUE: return DATE;
- case TIME_VALUE: return TIME;
- case TIMESTAMP_VALUE: return TIMESTAMP;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private TemporalType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //TemporalType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/UniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/UniqueConstraint.java
deleted file mode 100644
index 556e3e6ddd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/UniqueConstraint.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Unique Constraint</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.UniqueConstraint#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getUniqueConstraint()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class UniqueConstraint extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnNames()
- * @generated
- * @ordered
- */
- protected EList<String> columnNames;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected UniqueConstraint()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.UNIQUE_CONSTRAINT;
- }
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getUniqueConstraint_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, OrmPackage.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.UNIQUE_CONSTRAINT__COLUMN_NAMES:
- return getColumnNames();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.UNIQUE_CONSTRAINT__COLUMN_NAMES:
- getColumnNames().clear();
- getColumnNames().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.UNIQUE_CONSTRAINT__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.UNIQUE_CONSTRAINT__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-} // UniqueConstraint
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java
deleted file mode 100644
index cc9b71705f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAbstractColumn.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getInsertable <em>Insertable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getNullable <em>Nullable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique <em>Unique</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUpdatable <em>Updatable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAbstractColumn extends XmlNamedColumn
-{
- /**
- * Returns the value of the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insertable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insertable</em>' attribute.
- * @see #setInsertable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Insertable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getInsertable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getInsertable <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insertable</em>' attribute.
- * @see #getInsertable()
- * @generated
- */
- void setInsertable(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Nullable</em>' attribute.
- * @see #setNullable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Nullable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getNullable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getNullable <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Nullable</em>' attribute.
- * @see #getNullable()
- * @generated
- */
- void setNullable(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUnique();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- void setUnique(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Updatable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Updatable</em>' attribute.
- * @see #setUpdatable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAbstractColumn_Updatable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUpdatable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAbstractColumn#getUpdatable <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Updatable</em>' attribute.
- * @see #getUpdatable()
- * @generated
- */
- void setUpdatable(Boolean value);
-
- /**
- * Return the {@link TextRange} for the table attibute. If the table attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange tableTextRange();
-
-} // AbstractColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
deleted file mode 100644
index edf0076f05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Association Override</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getJoinColumns <em>Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlAssociationOverride extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAssociationOverride()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ASSOCIATION_OVERRIDE;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride_JoinColumns()
- * @model containment="true" required="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // AssociationOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java
deleted file mode 100644
index 6c3a367b62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- TextRange nameTextRange();
-
-} // AttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
deleted file mode 100644
index de3a886f30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute Override</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeOverride extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_Column()
- * @model containment="true" required="true"
- * @generated
- */
- XmlColumn getColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- void setColumn(XmlColumn value);
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // AttributeOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java
deleted file mode 100644
index 38a8354284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideImpl.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute Override</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlAttributeOverrideImpl extends AbstractJpaEObject implements XmlAttributeOverride
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAttributeOverrideImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ATTRIBUTE_OVERRIDE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_Column()
- * @model containment="true" required="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideImpl#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- return basicSetColumn(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} // AttributeOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java
deleted file mode 100644
index 61933f0bf1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBaseTable.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Base Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getUniqueConstraints <em>Unique Constraints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBaseTable extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCatalog();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- void setCatalog(String value);
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSchema();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBaseTable#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- void setSchema(String value);
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.UniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBaseTable_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- EList<UniqueConstraint> getUniqueConstraints();
-
- /**
- * Return the {@link TextRange} for the name attibute. If the name attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange nameTextRange();
-
- /**
- * Return the {@link TextRange} for the schema attibute. If the schema attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange schemaTextRange();
-
- /**
- * Return the {@link TextRange} for the catalog attibute. If the catalog attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange catalogTextRange();
-} // XmlBaseTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java
deleted file mode 100644
index 65138e3be7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Basic</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#isLob <em>Lob</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getTemporal <em>Temporal</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getEnumerated <em>Enumerated</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic extends XmlAttributeMapping, ColumnMapping
-{
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Fetch()
- * @model default="LAZY"
- * @generated
- */
- FetchType getFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- void setFetch(FetchType value);
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getOptional();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- void setOptional(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isLob();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- void setLob(boolean value);
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Temporal()
- * @model
- * @generated
- */
- TemporalType getTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- void setTemporal(TemporalType value);
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Enumerated()
- * @model
- * @generated
- */
- EnumType getEnumerated();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- void setEnumerated(EnumType value);
-
-} // Basic
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java
deleted file mode 100644
index 2d45014b20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasicImpl.java
+++ /dev/null
@@ -1,619 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Basic Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasicImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicImpl extends AbstractXmlAttributeMapping implements XmlBasic
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected static final Boolean OPTIONAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected Boolean optional = OPTIONAL_EDEFAULT;
-
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final EnumType ENUMERATED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_BASIC_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOptional()
- {
- return optional;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- public void setOptional(Boolean newOptional)
- {
- Boolean oldOptional = optional;
- optional = newOptional;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isLob()
- {
- return lob;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- public void setLob(boolean newLob)
- {
- boolean oldLob = lob;
- lob = newLob;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasicImpl#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- public void setEnumerated(EnumType newEnumerated)
- {
- EnumType oldEnumerated = enumerated;
- enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC_IMPL__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN:
- return basicSetColumn(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL:
- return getOptional();
- case OrmPackage.XML_BASIC_IMPL__LOB:
- return isLob() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- return getEnumerated();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__LOB:
- setLob(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_BASIC_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- case OrmPackage.XML_BASIC_IMPL__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC_IMPL__FETCH: return OrmPackage.XML_BASIC__FETCH;
- case OrmPackage.XML_BASIC_IMPL__OPTIONAL: return OrmPackage.XML_BASIC__OPTIONAL;
- case OrmPackage.XML_BASIC_IMPL__LOB: return OrmPackage.XML_BASIC__LOB;
- case OrmPackage.XML_BASIC_IMPL__TEMPORAL: return OrmPackage.XML_BASIC__TEMPORAL;
- case OrmPackage.XML_BASIC_IMPL__ENUMERATED: return OrmPackage.XML_BASIC__ENUMERATED;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_BASIC_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_BASIC__FETCH: return OrmPackage.XML_BASIC_IMPL__FETCH;
- case OrmPackage.XML_BASIC__OPTIONAL: return OrmPackage.XML_BASIC_IMPL__OPTIONAL;
- case OrmPackage.XML_BASIC__LOB: return OrmPackage.XML_BASIC_IMPL__LOB;
- case OrmPackage.XML_BASIC__TEMPORAL: return OrmPackage.XML_BASIC_IMPL__TEMPORAL;
- case OrmPackage.XML_BASIC__ENUMERATED: return OrmPackage.XML_BASIC_IMPL__ENUMERATED;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(", lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(')');
- return result.toString();
- }
-
-} // BasicImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java
deleted file mode 100644
index 282f383c48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlColumn extends XmlAbstractColumn
-{
- /**
- * Returns the value of the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Length</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Length</em>' attribute.
- * @see #setLength(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Length()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getLength();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Length</em>' attribute.
- * @see #getLength()
- * @generated
- */
- void setLength(Integer value);
-
- /**
- * Returns the value of the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Precision</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Precision</em>' attribute.
- * @see #setPrecision(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Precision()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getPrecision();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Precision</em>' attribute.
- * @see #getPrecision()
- * @generated
- */
- void setPrecision(Integer value);
-
- /**
- * Returns the value of the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Scale</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Scale</em>' attribute.
- * @see #setScale(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Scale()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getScale();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Scale</em>' attribute.
- * @see #getScale()
- * @generated
- */
- void setScale(Integer value);
-
-} // Column
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java
deleted file mode 100644
index ad096bf380..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumnImpl.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumnImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlColumnImpl extends AbstractXmlAbstractColumn implements XmlColumn
-{
- /**
- * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected static final Integer LENGTH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected Integer length = LENGTH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrecision()
- * @generated
- * @ordered
- */
- protected static final Integer PRECISION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrecision()
- * @generated
- * @ordered
- */
- protected Integer precision = PRECISION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getScale() <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScale()
- * @generated
- * @ordered
- */
- protected static final Integer SCALE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScale() <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScale()
- * @generated
- * @ordered
- */
- protected Integer scale = SCALE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlColumnImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_COLUMN_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Length</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Length</em>' attribute.
- * @see #setLength(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Length()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getLength()
- {
- return length;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl#getLength <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Length</em>' attribute.
- * @see #getLength()
- * @generated
- */
- public void setLength(Integer newLength)
- {
- Integer oldLength = length;
- length = newLength;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN_IMPL__LENGTH, oldLength, length));
- }
-
- /**
- * Returns the value of the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Precision</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Precision</em>' attribute.
- * @see #setPrecision(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Precision()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getPrecision()
- {
- return precision;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl#getPrecision <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Precision</em>' attribute.
- * @see #getPrecision()
- * @generated
- */
- public void setPrecision(Integer newPrecision)
- {
- Integer oldPrecision = precision;
- precision = newPrecision;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN_IMPL__PRECISION, oldPrecision, precision));
- }
-
- /**
- * Returns the value of the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Scale</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Scale</em>' attribute.
- * @see #setScale(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Scale()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getScale()
- {
- return scale;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumnImpl#getScale <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Scale</em>' attribute.
- * @see #getScale()
- * @generated
- */
- public void setScale(Integer newScale)
- {
- Integer oldScale = scale;
- scale = newScale;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN_IMPL__SCALE, oldScale, scale));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH:
- return getLength();
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- return getPrecision();
- case OrmPackage.XML_COLUMN_IMPL__SCALE:
- return getScale();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH:
- setLength((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- setPrecision((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN_IMPL__SCALE:
- setScale((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH:
- setLength(LENGTH_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- setPrecision(PRECISION_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN_IMPL__SCALE:
- setScale(SCALE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH:
- return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length);
- case OrmPackage.XML_COLUMN_IMPL__PRECISION:
- return PRECISION_EDEFAULT == null ? precision != null : !PRECISION_EDEFAULT.equals(precision);
- case OrmPackage.XML_COLUMN_IMPL__SCALE:
- return SCALE_EDEFAULT == null ? scale != null : !SCALE_EDEFAULT.equals(scale);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_COLUMN_IMPL__LENGTH: return OrmPackage.XML_COLUMN__LENGTH;
- case OrmPackage.XML_COLUMN_IMPL__PRECISION: return OrmPackage.XML_COLUMN__PRECISION;
- case OrmPackage.XML_COLUMN_IMPL__SCALE: return OrmPackage.XML_COLUMN__SCALE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH: return OrmPackage.XML_COLUMN_IMPL__LENGTH;
- case OrmPackage.XML_COLUMN__PRECISION: return OrmPackage.XML_COLUMN_IMPL__PRECISION;
- case OrmPackage.XML_COLUMN__SCALE: return OrmPackage.XML_COLUMN_IMPL__SCALE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (length: ");
- result.append(length);
- result.append(", precision: ");
- result.append(precision);
- result.append(", scale: ");
- result.append(scale);
- result.append(')');
- return result.toString();
- }
-
-} // ColumnImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java
deleted file mode 100644
index 3f4cd01ea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Discriminator Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorType() <em>Discriminator Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorType()
- * @generated
- * @ordered
- */
- protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected static final Integer LENGTH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected Integer length = LENGTH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlDiscriminatorColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_DISCRIMINATOR_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Type</b></em>' attribute.
- * The default value is <code>"STRING"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.DiscriminatorType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Discriminator Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see #setDiscriminatorType(DiscriminatorType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_DiscriminatorType()
- * @model default="STRING"
- * @generated
- */
- public DiscriminatorType getDiscriminatorType()
- {
- return discriminatorType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see #getDiscriminatorType()
- * @generated
- */
- public void setDiscriminatorType(DiscriminatorType newDiscriminatorType)
- {
- DiscriminatorType oldDiscriminatorType = discriminatorType;
- discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType));
- }
-
- /**
- * Returns the value of the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Length</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Length</em>' attribute.
- * @see #setLength(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_Length()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getLength()
- {
- return length;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Length</em>' attribute.
- * @see #getLength()
- * @generated
- */
- public void setLength(Integer newLength)
- {
- Integer oldLength = length;
- length = newLength;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH, oldLength, length));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- return getDiscriminatorType();
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- return getLength();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- setDiscriminatorType((DiscriminatorType)newValue);
- return;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- setLength((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT);
- return;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- setLength(LENGTH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (discriminatorType: ");
- result.append(discriminatorType);
- result.append(", length: ");
- result.append(length);
- result.append(')');
- return result.toString();
- }
-
-} // DiscriminatorColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java
deleted file mode 100644
index caf452e7ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embeddable</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddable()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddable extends AbstractXmlTypeMapping
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddable()
- {
- super();
- }
-
- public XmlEntityMappings entityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDABLE;
- }
-
-} // Embeddable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java
deleted file mode 100644
index 7221cfd532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbedded extends XmlAttributeMapping
-{
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAttributeOverride> getAttributeOverrides();
-
-} // Embedded
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java
deleted file mode 100644
index 57344eb45a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbeddedId extends XmlAttributeMapping
-{
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAttributeOverride> getAttributeOverrides();
-
-} // EmbeddedId
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java
deleted file mode 100644
index 0c963fb00f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedIdImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedIdImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedIdImpl extends AbstractXmlAttributeMapping implements XmlEmbeddedId
-{
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddedIdImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED_ID_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbeddedId.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbeddedId.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED_ID_IMPL__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // EmbeddedId
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java
deleted file mode 100644
index 398cb90c11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedImpl extends AbstractXmlAttributeMapping implements XmlEmbedded
-{
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddedImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbedded.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEmbedded.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_EMBEDDED_IMPL__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // Embedded
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java
deleted file mode 100644
index 9f70b1ed84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,1925 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables <em>Secondary Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getIdClass <em>Id Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSequenceGenerator <em>Sequence Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTableGenerator <em>Table Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedQueries <em>Named Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getNamedNativeQueries <em>Named Native Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad <em>Post Load</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getAssociationOverrides <em>Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends AbstractXmlTypeMapping
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected XmlTable table;
-
- /**
- * The cached value of the '{@link #getSecondaryTables() <em>Secondary Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecondaryTables()
- * @generated
- * @ordered
- */
- protected EList<XmlSecondaryTable> secondaryTables;
-
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * The cached value of the '{@link #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected IdClass idClass;
-
- /**
- * The cached value of the '{@link #getInheritance() <em>Inheritance</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInheritance()
- * @generated
- * @ordered
- */
- protected Inheritance inheritance;
-
- /**
- * The default value of the '{@link #getDiscriminatorValue() <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorValue()
- * @generated
- * @ordered
- */
- protected static final String DISCRIMINATOR_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorValue() <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorValue()
- * @generated
- * @ordered
- */
- protected String discriminatorValue = DISCRIMINATOR_VALUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected XmlDiscriminatorColumn discriminatorColumn;
-
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
-
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
-
- /**
- * The cached value of the '{@link #getNamedQueries() <em>Named Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedQuery> namedQueries;
-
- /**
- * The cached value of the '{@link #getNamedNativeQueries() <em>Named Native Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedNativeQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedNativeQuery> namedNativeQueries;
-
- /**
- * The cached value of the '{@link #getSqlResultSetMappings() <em>Sql Result Set Mappings</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSqlResultSetMappings()
- * @generated
- * @ordered
- */
- protected EList<SqlResultSetMapping> sqlResultSetMappings;
-
- /**
- * The default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * The cached value of the '{@link #getPrePersist() <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrePersist()
- * @generated
- * @ordered
- */
- protected PrePersist prePersist;
-
- /**
- * The cached value of the '{@link #getPostPersist() <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostPersist()
- * @generated
- * @ordered
- */
- protected PostPersist postPersist;
-
- /**
- * The cached value of the '{@link #getPreRemove() <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreRemove()
- * @generated
- * @ordered
- */
- protected PreRemove preRemove;
-
- /**
- * The cached value of the '{@link #getPostRemove() <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostRemove()
- * @generated
- * @ordered
- */
- protected PostRemove postRemove;
-
- /**
- * The cached value of the '{@link #getPreUpdate() <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreUpdate()
- * @generated
- * @ordered
- */
- protected PreUpdate preUpdate;
-
- /**
- * The cached value of the '{@link #getPostUpdate() <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostUpdate()
- * @generated
- * @ordered
- */
- protected PostUpdate postUpdate;
-
- /**
- * The cached value of the '{@link #getPostLoad() <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostLoad()
- * @generated
- * @ordered
- */
- protected PostLoad postLoad;
-
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * The cached value of the '{@link #getAssociationOverrides() <em>Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> associationOverrides;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntity()
- {
- super();
- }
-
- public XmlEntityMappings entityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ENTITY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' containment reference.
- * @see #setTable(XmlTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_Table()
- * @model containment="true"
- * @generated
- */
- public XmlTable getTable()
- {
- return table;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTable(XmlTable newTable, NotificationChain msgs)
- {
- XmlTable oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE, oldTable, newTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' containment reference.
- * @see #getTable()
- * @generated
- */
- public void setTable(XmlTable newTable)
- {
- if (newTable != table)
- {
- NotificationChain msgs = null;
- if (table != null)
- msgs = ((InternalEObject)table).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE, null, msgs);
- if (newTable != null)
- msgs = ((InternalEObject)newTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE, null, msgs);
- msgs = basicSetTable(newTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE, newTable, newTable));
- }
-
- /**
- * Returns the value of the '<em><b>Secondary Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Secondary Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Secondary Tables</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_SecondaryTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlSecondaryTable> getSecondaryTables()
- {
- if (secondaryTables == null)
- {
- secondaryTables = new EObjectContainmentEList<XmlSecondaryTable>(XmlSecondaryTable.class, this, OrmPackage.XML_ENTITY__SECONDARY_TABLES);
- }
- return secondaryTables;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id Class</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id Class</em>' containment reference.
- * @see #setIdClass(IdClass)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_IdClass()
- * @model containment="true"
- * @generated
- */
- public IdClass getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(IdClass newIdClass, NotificationChain msgs)
- {
- IdClass oldIdClass = idClass;
- idClass = newIdClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ID_CLASS, oldIdClass, newIdClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getIdClass <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id Class</em>' containment reference.
- * @see #getIdClass()
- * @generated
- */
- public void setIdClass(IdClass newIdClass)
- {
- if (newIdClass != idClass)
- {
- NotificationChain msgs = null;
- if (idClass != null)
- msgs = ((InternalEObject)idClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ID_CLASS, null, msgs);
- if (newIdClass != null)
- msgs = ((InternalEObject)newIdClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ID_CLASS, null, msgs);
- msgs = basicSetIdClass(newIdClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ID_CLASS, newIdClass, newIdClass));
- }
-
- /**
- * Returns the value of the '<em><b>Inheritance</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Inheritance</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Inheritance</em>' containment reference.
- * @see #setInheritance(Inheritance)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_Inheritance()
- * @model containment="true"
- * @generated
- */
- public Inheritance getInheritance()
- {
- return inheritance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInheritance(Inheritance newInheritance, NotificationChain msgs)
- {
- Inheritance oldInheritance = inheritance;
- inheritance = newInheritance;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__INHERITANCE, oldInheritance, newInheritance);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Inheritance</em>' containment reference.
- * @see #getInheritance()
- * @generated
- */
- public void setInheritance(Inheritance newInheritance)
- {
- if (newInheritance != inheritance)
- {
- NotificationChain msgs = null;
- if (inheritance != null)
- msgs = ((InternalEObject)inheritance).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__INHERITANCE, null, msgs);
- if (newInheritance != null)
- msgs = ((InternalEObject)newInheritance).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__INHERITANCE, null, msgs);
- msgs = basicSetInheritance(newInheritance, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__INHERITANCE, newInheritance, newInheritance));
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Discriminator Value</em>' attribute.
- * @see #setDiscriminatorValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_DiscriminatorValue()
- * @model dataType="org.eclipse.jpt.core.resource.orm.DiscriminatorValue"
- * @generated
- */
- public String getDiscriminatorValue()
- {
- return discriminatorValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Value</em>' attribute.
- * @see #getDiscriminatorValue()
- * @generated
- */
- public void setDiscriminatorValue(String newDiscriminatorValue)
- {
- String oldDiscriminatorValue = discriminatorValue;
- discriminatorValue = newDiscriminatorValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE, oldDiscriminatorValue, discriminatorValue));
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Discriminator Column</em>' containment reference.
- * @see #setDiscriminatorColumn(XmlDiscriminatorColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_DiscriminatorColumn()
- * @model containment="true"
- * @generated
- */
- public XmlDiscriminatorColumn getDiscriminatorColumn()
- {
- return discriminatorColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetDiscriminatorColumn(XmlDiscriminatorColumn newDiscriminatorColumn, NotificationChain msgs)
- {
- XmlDiscriminatorColumn oldDiscriminatorColumn = discriminatorColumn;
- discriminatorColumn = newDiscriminatorColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, newDiscriminatorColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Column</em>' containment reference.
- * @see #getDiscriminatorColumn()
- * @generated
- */
- public void setDiscriminatorColumn(XmlDiscriminatorColumn newDiscriminatorColumn)
- {
- if (newDiscriminatorColumn != discriminatorColumn)
- {
- NotificationChain msgs = null;
- if (discriminatorColumn != null)
- msgs = ((InternalEObject)discriminatorColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, null, msgs);
- if (newDiscriminatorColumn != null)
- msgs = ((InternalEObject)newDiscriminatorColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, null, msgs);
- msgs = basicSetDiscriminatorColumn(newDiscriminatorColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, newDiscriminatorColumn, newDiscriminatorColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Queries</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, OrmPackage.XML_ENTITY__NAMED_QUERIES);
- }
- return namedQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Native Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Native Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Native Queries</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Listeners</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_ExcludeDefaultListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultListeners()
- {
- return excludeDefaultListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #isExcludeDefaultListeners()
- * @generated
- */
- public void setExcludeDefaultListeners(boolean newExcludeDefaultListeners)
- {
- boolean oldExcludeDefaultListeners = excludeDefaultListeners;
- excludeDefaultListeners = newExcludeDefaultListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS, oldExcludeDefaultListeners, excludeDefaultListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Superclass Listeners</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_ExcludeSuperclassListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeSuperclassListeners()
- {
- return excludeSuperclassListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #isExcludeSuperclassListeners()
- * @generated
- */
- public void setExcludeSuperclassListeners(boolean newExcludeSuperclassListeners)
- {
- boolean oldExcludeSuperclassListeners = excludeSuperclassListeners;
- excludeSuperclassListeners = newExcludeSuperclassListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS, oldExcludeSuperclassListeners, excludeSuperclassListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PrePersist()
- * @model containment="true"
- * @generated
- */
- public PrePersist getPrePersist()
- {
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrePersist(PrePersist newPrePersist, NotificationChain msgs)
- {
- PrePersist oldPrePersist = prePersist;
- prePersist = newPrePersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_PERSIST, oldPrePersist, newPrePersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- public void setPrePersist(PrePersist newPrePersist)
- {
- if (newPrePersist != prePersist)
- {
- NotificationChain msgs = null;
- if (prePersist != null)
- msgs = ((InternalEObject)prePersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_PERSIST, newPrePersist, newPrePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PostPersist()
- * @model containment="true"
- * @generated
- */
- public PostPersist getPostPersist()
- {
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostPersist(PostPersist newPostPersist, NotificationChain msgs)
- {
- PostPersist oldPostPersist = postPersist;
- postPersist = newPostPersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_PERSIST, oldPostPersist, newPostPersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- public void setPostPersist(PostPersist newPostPersist)
- {
- if (newPostPersist != postPersist)
- {
- NotificationChain msgs = null;
- if (postPersist != null)
- msgs = ((InternalEObject)postPersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_PERSIST, newPostPersist, newPostPersist));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PreRemove()
- * @model containment="true"
- * @generated
- */
- public PreRemove getPreRemove()
- {
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreRemove(PreRemove newPreRemove, NotificationChain msgs)
- {
- PreRemove oldPreRemove = preRemove;
- preRemove = newPreRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_REMOVE, oldPreRemove, newPreRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- public void setPreRemove(PreRemove newPreRemove)
- {
- if (newPreRemove != preRemove)
- {
- NotificationChain msgs = null;
- if (preRemove != null)
- msgs = ((InternalEObject)preRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_REMOVE, newPreRemove, newPreRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PostRemove()
- * @model containment="true"
- * @generated
- */
- public PostRemove getPostRemove()
- {
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostRemove(PostRemove newPostRemove, NotificationChain msgs)
- {
- PostRemove oldPostRemove = postRemove;
- postRemove = newPostRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_REMOVE, oldPostRemove, newPostRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- public void setPostRemove(PostRemove newPostRemove)
- {
- if (newPostRemove != postRemove)
- {
- NotificationChain msgs = null;
- if (postRemove != null)
- msgs = ((InternalEObject)postRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_REMOVE, newPostRemove, newPostRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PreUpdate()
- * @model containment="true"
- * @generated
- */
- public PreUpdate getPreUpdate()
- {
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreUpdate(PreUpdate newPreUpdate, NotificationChain msgs)
- {
- PreUpdate oldPreUpdate = preUpdate;
- preUpdate = newPreUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_UPDATE, oldPreUpdate, newPreUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- public void setPreUpdate(PreUpdate newPreUpdate)
- {
- if (newPreUpdate != preUpdate)
- {
- NotificationChain msgs = null;
- if (preUpdate != null)
- msgs = ((InternalEObject)preUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_UPDATE, newPreUpdate, newPreUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PostUpdate()
- * @model containment="true"
- * @generated
- */
- public PostUpdate getPostUpdate()
- {
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostUpdate(PostUpdate newPostUpdate, NotificationChain msgs)
- {
- PostUpdate oldPostUpdate = postUpdate;
- postUpdate = newPostUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_UPDATE, oldPostUpdate, newPostUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- public void setPostUpdate(PostUpdate newPostUpdate)
- {
- if (newPostUpdate != postUpdate)
- {
- NotificationChain msgs = null;
- if (postUpdate != null)
- msgs = ((InternalEObject)postUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_UPDATE, newPostUpdate, newPostUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PostLoad()
- * @model containment="true"
- * @generated
- */
- public PostLoad getPostLoad()
- {
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostLoad(PostLoad newPostLoad, NotificationChain msgs)
- {
- PostLoad oldPostLoad = postLoad;
- postLoad = newPostLoad;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_LOAD, oldPostLoad, newPostLoad);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- public void setPostLoad(PostLoad newPostLoad)
- {
- if (newPostLoad != postLoad)
- {
- NotificationChain msgs = null;
- if (postLoad != null)
- msgs = ((InternalEObject)postLoad).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__TABLE:
- return basicSetTable(null, msgs);
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return ((InternalEList<?>)getSecondaryTables()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return basicSetIdClass(null, msgs);
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return basicSetInheritance(null, msgs);
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return basicSetDiscriminatorColumn(null, msgs);
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return basicSetEntityListeners(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return basicSetPostLoad(null, msgs);
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAME:
- return getName();
- case OrmPackage.XML_ENTITY__TABLE:
- return getTable();
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return getSecondaryTables();
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return getIdClass();
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return getInheritance();
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- return getDiscriminatorValue();
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return getDiscriminatorColumn();
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return getEntityListeners();
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return getPostLoad();
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_ENTITY__TABLE:
- setTable((XmlTable)newValue);
- return;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- getSecondaryTables().clear();
- getSecondaryTables().addAll((Collection<? extends XmlSecondaryTable>)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((IdClass)newValue);
- return;
- case OrmPackage.XML_ENTITY__INHERITANCE:
- setInheritance((Inheritance)newValue);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- setDiscriminatorValue((String)newValue);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((XmlDiscriminatorColumn)newValue);
- return;
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- setPostLoad((PostLoad)newValue);
- return;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__TABLE:
- setTable((XmlTable)null);
- return;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- getSecondaryTables().clear();
- return;
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((IdClass)null);
- return;
- case OrmPackage.XML_ENTITY__INHERITANCE:
- setInheritance((Inheritance)null);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- setDiscriminatorValue(DISCRIMINATOR_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((XmlDiscriminatorColumn)null);
- return;
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- setPostLoad((PostLoad)null);
- return;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_ENTITY__TABLE:
- return table != null;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return secondaryTables != null && !secondaryTables.isEmpty();
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return idClass != null;
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return inheritance != null;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- return DISCRIMINATOR_VALUE_EDEFAULT == null ? discriminatorValue != null : !DISCRIMINATOR_VALUE_EDEFAULT.equals(discriminatorValue);
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return discriminatorColumn != null;
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return tableGenerator != null;
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return entityListeners != null;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return postLoad != null;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", discriminatorValue: ");
- result.append(discriminatorValue);
- result.append(", excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- result.append(')');
- return result.toString();
- }
-
-} // Entity
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java
deleted file mode 100644
index 9e1e6dd1b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,1079 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Mappings</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess <em>Access</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators <em>Sequence Generators</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators <em>Table Generators</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedQueries <em>Named Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getNamedNativeQueries <em>Named Native Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses <em>Mapped Superclasses</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities <em>Entities</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables <em>Embeddables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlEntityMappings extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected static final String VERSION_EDEFAULT = "1.0";
-
- /**
- * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected String version = VERSION_EDEFAULT;
-
- /**
- * This is true if the Version attribute has been set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean versionESet;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPersistenceUnitMetadata() <em>Persistence Unit Metadata</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnitMetadata()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitMetadata persistenceUnitMetadata;
-
- /**
- * The default value of the '{@link #getPackage() <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackage()
- * @generated
- * @ordered
- */
- protected static final String PACKAGE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPackage() <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackage()
- * @generated
- * @ordered
- */
- protected String package_ = PACKAGE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getSequenceGenerators() <em>Sequence Generators</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerators()
- * @generated
- * @ordered
- */
- protected EList<XmlSequenceGenerator> sequenceGenerators;
-
- /**
- * The cached value of the '{@link #getTableGenerators() <em>Table Generators</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerators()
- * @generated
- * @ordered
- */
- protected EList<XmlTableGenerator> tableGenerators;
-
- /**
- * The cached value of the '{@link #getNamedQueries() <em>Named Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedQuery> namedQueries;
-
- /**
- * The cached value of the '{@link #getNamedNativeQueries() <em>Named Native Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedNativeQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedNativeQuery> namedNativeQueries;
-
- /**
- * The cached value of the '{@link #getSqlResultSetMappings() <em>Sql Result Set Mappings</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSqlResultSetMappings()
- * @generated
- * @ordered
- */
- protected EList<SqlResultSetMapping> sqlResultSetMappings;
-
- /**
- * The cached value of the '{@link #getMappedSuperclasses() <em>Mapped Superclasses</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedSuperclasses()
- * @generated
- * @ordered
- */
- protected EList<XmlMappedSuperclass> mappedSuperclasses;
-
- /**
- * The cached value of the '{@link #getEntities() <em>Entities</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntities()
- * @generated
- * @ordered
- */
- protected EList<XmlEntity> entities;
-
- /**
- * The cached value of the '{@link #getEmbeddables() <em>Embeddables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddables()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbeddable> embeddables;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntityMappings()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ENTITY_MAPPINGS;
- }
-
- /**
- * Returns the value of the '<em><b>Version</b></em>' attribute.
- * The default value is <code>"1.0"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Version</em>' attribute.
- * @see #isSetVersion()
- * @see #unsetVersion()
- * @see #setVersion(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Version()
- * @model default="1.0" unsettable="true" dataType="org.eclipse.jpt.core.resource.orm.VersionType" required="true"
- * @generated
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #isSetVersion()
- * @see #unsetVersion()
- * @see #getVersion()
- * @generated
- */
- public void setVersion(String newVersion)
- {
- String oldVersion = version;
- version = newVersion;
- boolean oldVersionESet = versionESet;
- versionESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, version, !oldVersionESet));
- }
-
- /**
- * Unsets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetVersion()
- * @see #getVersion()
- * @see #setVersion(String)
- * @generated
- */
- public void unsetVersion()
- {
- String oldVersion = version;
- boolean oldVersionESet = versionESet;
- version = VERSION_EDEFAULT;
- versionESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, VERSION_EDEFAULT, oldVersionESet));
- }
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion <em>Version</em>}' attribute is set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return whether the value of the '<em>Version</em>' attribute is set.
- * @see #unsetVersion()
- * @see #getVersion()
- * @see #setVersion(String)
- * @generated
- */
- public boolean isSetVersion()
- {
- return versionESet;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Unit Metadata</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Unit Metadata</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Persistence Unit Metadata</em>' containment reference.
- * @see #setPersistenceUnitMetadata(XmlPersistenceUnitMetadata)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_PersistenceUnitMetadata()
- * @model containment="true"
- * @generated
- */
- public XmlPersistenceUnitMetadata getPersistenceUnitMetadata()
- {
- return persistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata, NotificationChain msgs)
- {
- XmlPersistenceUnitMetadata oldPersistenceUnitMetadata = persistenceUnitMetadata;
- persistenceUnitMetadata = newPersistenceUnitMetadata;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, oldPersistenceUnitMetadata, newPersistenceUnitMetadata);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Persistence Unit Metadata</em>' containment reference.
- * @see #getPersistenceUnitMetadata()
- * @generated
- */
- public void setPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata)
- {
- if (newPersistenceUnitMetadata != persistenceUnitMetadata)
- {
- NotificationChain msgs = null;
- if (persistenceUnitMetadata != null)
- msgs = ((InternalEObject)persistenceUnitMetadata).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs);
- if (newPersistenceUnitMetadata != null)
- msgs = ((InternalEObject)newPersistenceUnitMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs);
- msgs = basicSetPersistenceUnitMetadata(newPersistenceUnitMetadata, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, newPersistenceUnitMetadata, newPersistenceUnitMetadata));
- }
-
- /**
- * Returns the value of the '<em><b>Package</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Package</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Package</em>' attribute.
- * @see #setPackage(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Package()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPackage()
- {
- return package_;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Package</em>' attribute.
- * @see #getPackage()
- * @generated
- */
- public void setPackage(String newPackage)
- {
- String oldPackage = package_;
- package_ = newPackage;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE, oldPackage, package_));
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The default value is <code>"PROPERTY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Access()
- * @model default="PROPERTY"
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generators</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generators</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generators</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_SequenceGenerators()
- * @model containment="true"
- * @generated
- */
- public EList<XmlSequenceGenerator> getSequenceGenerators()
- {
- if (sequenceGenerators == null)
- {
- sequenceGenerators = new EObjectContainmentEList<XmlSequenceGenerator>(XmlSequenceGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS);
- }
- return sequenceGenerators;
- }
-
- /**
- * Returns the value of the '<em><b>Table Generators</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generators</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generators</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_TableGenerators()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTableGenerator> getTableGenerators()
- {
- if (tableGenerators == null)
- {
- tableGenerators = new EObjectContainmentEList<XmlTableGenerator>(XmlTableGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS);
- }
- return tableGenerators;
- }
-
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Queries</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES);
- }
- return namedQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Native Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Native Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Native Queries</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Mapped Superclasses</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped Superclasses</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped Superclasses</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_MappedSuperclasses()
- * @model containment="true"
- * @generated
- */
- public EList<XmlMappedSuperclass> getMappedSuperclasses()
- {
- if (mappedSuperclasses == null)
- {
- mappedSuperclasses = new EObjectContainmentEList<XmlMappedSuperclass>(XmlMappedSuperclass.class, this, OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES);
- }
- return mappedSuperclasses;
- }
-
- /**
- * Returns the value of the '<em><b>Entities</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEntity}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entities</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entities</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Entities()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEntity> getEntities()
- {
- if (entities == null)
- {
- entities = new EObjectContainmentEList<XmlEntity>(XmlEntity.class, this, OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES);
- }
- return entities;
- }
-
- /**
- * Returns the value of the '<em><b>Embeddables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embeddables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Embeddables</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Embeddables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbeddable> getEmbeddables()
- {
- if (embeddables == null)
- {
- embeddables = new EObjectContainmentEList<XmlEmbeddable>(XmlEmbeddable.class, this, OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES);
- }
- return embeddables;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return basicSetPersistenceUnitMetadata(null, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return ((InternalEList<?>)getSequenceGenerators()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return ((InternalEList<?>)getTableGenerators()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return ((InternalEList<?>)getMappedSuperclasses()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return ((InternalEList<?>)getEntities()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return ((InternalEList<?>)getEmbeddables()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__VERSION:
- return getVersion();
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return getPersistenceUnitMetadata();
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- return getPackage();
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- return getSchema();
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- return getCatalog();
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- return getAccess();
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return getSequenceGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return getTableGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return getMappedSuperclasses();
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return getEntities();
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return getEmbeddables();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__VERSION:
- setVersion((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- setPackage((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- getSequenceGenerators().clear();
- getSequenceGenerators().addAll((Collection<? extends XmlSequenceGenerator>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- getTableGenerators().clear();
- getTableGenerators().addAll((Collection<? extends XmlTableGenerator>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- getMappedSuperclasses().clear();
- getMappedSuperclasses().addAll((Collection<? extends XmlMappedSuperclass>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- getEntities().clear();
- getEntities().addAll((Collection<? extends XmlEntity>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- getEmbeddables().clear();
- getEmbeddables().addAll((Collection<? extends XmlEmbeddable>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__VERSION:
- unsetVersion();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)null);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- setPackage(PACKAGE_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- getSequenceGenerators().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- getTableGenerators().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- getMappedSuperclasses().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- getEntities().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- getEmbeddables().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__VERSION:
- return isSetVersion();
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return persistenceUnitMetadata != null;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- return PACKAGE_EDEFAULT == null ? package_ != null : !PACKAGE_EDEFAULT.equals(package_);
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return sequenceGenerators != null && !sequenceGenerators.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return tableGenerators != null && !tableGenerators.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return mappedSuperclasses != null && !mappedSuperclasses.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return entities != null && !entities.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return embeddables != null && !embeddables.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-
- // **************** overrides **********************************************
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (version: ");
- if (versionESet) result.append(version); else result.append("<unset>");
- result.append(", description: ");
- result.append(description);
- result.append(", package: ");
- result.append(package_);
- result.append(", schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", access: ");
- result.append(access);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public JpaEObject root() {
- return this;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java
deleted file mode 100644
index 69761ac340..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Generated Value</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGeneratedValue extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generator</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generator</em>' attribute.
- * @see #setGenerator(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Generator()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generator</em>' attribute.
- * @see #getGenerator()
- * @generated
- */
- void setGenerator(String value);
-
- /**
- * Returns the value of the '<em><b>Strategy</b></em>' attribute.
- * The default value is <code>"TABLE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.GenerationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Strategy</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #setStrategy(GenerationType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Strategy()
- * @model default="TABLE"
- * @generated
- */
- GenerationType getStrategy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #getStrategy()
- * @generated
- */
- void setStrategy(GenerationType value);
-
-} // GeneratedValue
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
deleted file mode 100644
index e4c9eb1bbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Generated Value</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValueImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlGeneratedValueImpl extends AbstractJpaEObject implements XmlGeneratedValue
-{
- /**
- * The default value of the '{@link #getGenerator() <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGenerator()
- * @generated
- * @ordered
- */
- protected static final String GENERATOR_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getGenerator() <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGenerator()
- * @generated
- * @ordered
- */
- protected String generator = GENERATOR_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final GenerationType STRATEGY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStrategy()
- * @generated
- * @ordered
- */
- protected GenerationType strategy = STRATEGY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlGeneratedValueImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_GENERATED_VALUE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generator</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generator</em>' attribute.
- * @see #setGenerator(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Generator()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getGenerator()
- {
- return generator;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl#getGenerator <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generator</em>' attribute.
- * @see #getGenerator()
- * @generated
- */
- public void setGenerator(String newGenerator)
- {
- String oldGenerator = generator;
- generator = newGenerator;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE_IMPL__GENERATOR, oldGenerator, generator));
- }
-
- /**
- * Returns the value of the '<em><b>Strategy</b></em>' attribute.
- * The default value is <code>"TABLE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.GenerationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Strategy</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #setStrategy(GenerationType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Strategy()
- * @model default="TABLE"
- * @generated
- */
- public GenerationType getStrategy()
- {
- return strategy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValueImpl#getStrategy <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #getStrategy()
- * @generated
- */
- public void setStrategy(GenerationType newStrategy)
- {
- GenerationType oldStrategy = strategy;
- strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE_IMPL__STRATEGY, oldStrategy, strategy));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE_IMPL__GENERATOR:
- return getGenerator();
- case OrmPackage.XML_GENERATED_VALUE_IMPL__STRATEGY:
- return getStrategy();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE_IMPL__GENERATOR:
- setGenerator((String)newValue);
- return;
- case OrmPackage.XML_GENERATED_VALUE_IMPL__STRATEGY:
- setStrategy((GenerationType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE_IMPL__GENERATOR:
- setGenerator(GENERATOR_EDEFAULT);
- return;
- case OrmPackage.XML_GENERATED_VALUE_IMPL__STRATEGY:
- setStrategy(STRATEGY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE_IMPL__GENERATOR:
- return GENERATOR_EDEFAULT == null ? generator != null : !GENERATOR_EDEFAULT.equals(generator);
- case OrmPackage.XML_GENERATED_VALUE_IMPL__STRATEGY:
- return strategy != STRATEGY_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (generator: ");
- result.append(generator);
- result.append(", strategy: ");
- result.append(strategy);
- result.append(')');
- return result.toString();
- }
-
-} // GeneratedValue
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java
deleted file mode 100644
index 9094846ec9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Generator</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGenerator extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getInitialValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- void setInitialValue(Integer value);
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getAllocationSize();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- void setAllocationSize(Integer value);
-
-} // Generator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
deleted file mode 100644
index c56d38c1d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getGeneratedValue <em>Generated Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getTemporal <em>Temporal</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getTableGenerator <em>Table Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getSequenceGenerator <em>Sequence Generator</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlId extends XmlAttributeMapping, ColumnMapping
-{
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- XmlGeneratedValue getGeneratedValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- void setGeneratedValue(XmlGeneratedValue value);
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_Temporal()
- * @model
- * @generated
- */
- TemporalType getTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- void setTemporal(TemporalType value);
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_TableGenerator()
- * @model containment="true"
- * @generated
- */
- XmlTableGenerator getTableGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- void setTableGenerator(XmlTableGenerator value);
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- XmlSequenceGenerator getSequenceGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- void setSequenceGenerator(XmlSequenceGenerator value);
-
-} // Id
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java
deleted file mode 100644
index 1f675e59ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdImpl.java
+++ /dev/null
@@ -1,596 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlIdImpl extends AbstractXmlAttributeMapping implements XmlId
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * The cached value of the '{@link #getGeneratedValue() <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGeneratedValue()
- * @generated
- * @ordered
- */
- protected XmlGeneratedValue generatedValue;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
-
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlIdImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ID_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- public XmlGeneratedValue getGeneratedValue()
- {
- return generatedValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetGeneratedValue(XmlGeneratedValue newGeneratedValue, NotificationChain msgs)
- {
- XmlGeneratedValue oldGeneratedValue = generatedValue;
- generatedValue = newGeneratedValue;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- public void setGeneratedValue(XmlGeneratedValue newGeneratedValue)
- {
- if (newGeneratedValue != generatedValue)
- {
- NotificationChain msgs = null;
- if (generatedValue != null)
- msgs = ((InternalEObject)generatedValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__GENERATED_VALUE, null, msgs);
- if (newGeneratedValue != null)
- msgs = ((InternalEObject)newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__GENERATED_VALUE, null, msgs);
- msgs = basicSetGeneratedValue(newGeneratedValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__GENERATED_VALUE, newGeneratedValue, newGeneratedValue));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdImpl#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- return basicSetColumn(null, msgs);
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return basicSetGeneratedValue(null, msgs);
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return getGeneratedValue();
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)null);
- return;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE:
- return generatedValue != null;
- case OrmPackage.XML_ID_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR:
- return tableGenerator != null;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlId.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID_IMPL__GENERATED_VALUE: return OrmPackage.XML_ID__GENERATED_VALUE;
- case OrmPackage.XML_ID_IMPL__TEMPORAL: return OrmPackage.XML_ID__TEMPORAL;
- case OrmPackage.XML_ID_IMPL__TABLE_GENERATOR: return OrmPackage.XML_ID__TABLE_GENERATOR;
- case OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR: return OrmPackage.XML_ID__SEQUENCE_GENERATOR;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_ID_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlId.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ID__GENERATED_VALUE: return OrmPackage.XML_ID_IMPL__GENERATED_VALUE;
- case OrmPackage.XML_ID__TEMPORAL: return OrmPackage.XML_ID_IMPL__TEMPORAL;
- case OrmPackage.XML_ID__TABLE_GENERATOR: return OrmPackage.XML_ID_IMPL__TABLE_GENERATOR;
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR: return OrmPackage.XML_ID_IMPL__SEQUENCE_GENERATOR;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (temporal: ");
- result.append(temporal);
- result.append(')');
- return result.toString();
- }
-
-} // Id
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java
deleted file mode 100644
index e01285cbf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Join Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlJoinColumn extends XmlAbstractColumn
-{
- /**
- * Returns the value of the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Referenced Column Name</em>' attribute.
- * @see #setReferencedColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn_ReferencedColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReferencedColumnName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Referenced Column Name</em>' attribute.
- * @see #getReferencedColumnName()
- * @generated
- */
- void setReferencedColumnName(String value);
-
- TextRange referencedColumnNameTextRange();
-
-} // JoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
deleted file mode 100644
index 54704c9d7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Join Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinColumnImpl extends AbstractXmlAbstractColumn implements XmlJoinColumn
-{
- /**
- * The default value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected String referencedColumnName = REFERENCED_COLUMN_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinColumnImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_COLUMN_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Referenced Column Name</em>' attribute.
- * @see #setReferencedColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn_ReferencedColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReferencedColumnName()
- {
- return referencedColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnImpl#getReferencedColumnName <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Referenced Column Name</em>' attribute.
- * @see #getReferencedColumnName()
- * @generated
- */
- public void setReferencedColumnName(String newReferencedColumnName)
- {
- String oldReferencedColumnName = referencedColumnName;
- referencedColumnName = newReferencedColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME, oldReferencedColumnName, referencedColumnName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME:
- return getReferencedColumnName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME:
- setReferencedColumnName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME:
- setReferencedColumnName(REFERENCED_COLUMN_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME:
- return REFERENCED_COLUMN_NAME_EDEFAULT == null ? referencedColumnName != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(referencedColumnName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinColumn.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME: return OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinColumn.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME: return OrmPackage.XML_JOIN_COLUMN_IMPL__REFERENCED_COLUMN_NAME;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange referencedColumnNameTextRange() {
- IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.REFERENCED_COLUMN_NAME);
- return (referencedColumnNameNode == null) ? validationTextRange() : buildTextRange(referencedColumnNameNode);
- }
-} // JoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java
deleted file mode 100644
index 9e3b028042..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Join Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getJoinColumns <em>Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns <em>Inverse Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlJoinTable extends XmlBaseTable
-{
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
- /**
- * Returns the value of the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Inverse Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Inverse Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable_InverseJoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getInverseJoinColumns();
-
-} // JoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java
deleted file mode 100644
index e0a2972dcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableImpl.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Join Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinTableImpl extends AbstractXmlBaseTable implements XmlJoinTable
-{
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
- /**
- * The cached value of the '{@link #getInverseJoinColumns() <em>Inverse Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInverseJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> inverseJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinTableImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_TABLE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Inverse Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Inverse Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable_InverseJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getInverseJoinColumns()
- {
- if (inverseJoinColumns == null)
- {
- inverseJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS);
- }
- return inverseJoinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- return ((InternalEList<?>)getInverseJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- return getInverseJoinColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- getInverseJoinColumns().clear();
- getInverseJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- getInverseJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS:
- return inverseJoinColumns != null && !inverseJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS;
- case OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE_IMPL__JOIN_COLUMNS;
- case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS: return OrmPackage.XML_JOIN_TABLE_IMPL__INVERSE_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // JoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java
deleted file mode 100644
index 8745efe5f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Many To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany extends XmlMultiRelationshipMapping
-{
-} // ManyToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
deleted file mode 100644
index 9682b876d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
+++ /dev/null
@@ -1,734 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Many To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToManyImpl extends AbstractXmlAttributeMapping implements XmlManyToMany
-{
- /**
- * The default value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected static final String TARGET_ENTITY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected String targetEntity = TARGET_ENTITY_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * The default value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected static final String MAPPED_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected String mappedBy = MAPPED_BY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected static final String ORDER_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected String orderBy = ORDER_BY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMapKey() <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKey()
- * @generated
- * @ordered
- */
- protected MapKey mapKey;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_MANY_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetEntity()
- {
- return targetEntity;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- public void setTargetEntity(String newTargetEntity)
- {
- String oldTargetEntity = targetEntity;
- targetEntity = newTargetEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY, oldTargetEntity, targetEntity));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMappedBy()
- {
- return mappedBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- public void setMappedBy(String newMappedBy)
- {
- String oldMappedBy = mappedBy;
- mappedBy = newMappedBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- public String getOrderBy()
- {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- public void setOrderBy(String newOrderBy)
- {
- String oldOrderBy = orderBy;
- orderBy = newOrderBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MapKey()
- * @model containment="true"
- * @generated
- */
- public MapKey getMapKey()
- {
- return mapKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKey(MapKey newMapKey, NotificationChain msgs)
- {
- MapKey oldMapKey = mapKey;
- mapKey = newMapKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, oldMapKey, newMapKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- public void setMapKey(MapKey newMapKey)
- {
- if (newMapKey != mapKey)
- {
- NotificationChain msgs = null;
- if (mapKey != null)
- msgs = ((InternalEObject)mapKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- public CascadeType getCascade()
- {
- return cascade;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCascade(CascadeType newCascade, NotificationChain msgs)
- {
- CascadeType oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, oldCascade, newCascade);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToManyImpl#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(CascadeType newCascade)
- {
- if (newCascade != cascade)
- {
- NotificationChain msgs = null;
- if (cascade != null)
- msgs = ((InternalEObject)cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- return basicSetMapKey(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- return getOrderBy();
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- return getMapKey();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY:
- return mapKey != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
- case OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_MANY_TO_MANY_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_MANY_TO_MANY_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_MANY_TO_MANY_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_MANY_TO_MANY_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY: return OrmPackage.XML_MANY_TO_MANY_IMPL__MAPPED_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY: return OrmPackage.XML_MANY_TO_MANY_IMPL__ORDER_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY: return OrmPackage.XML_MANY_TO_MANY_IMPL__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(')');
- return result.toString();
- }
-
-} // ManyToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java
deleted file mode 100644
index 10c32ac72f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Many To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne extends XmlSingleRelationshipMapping
-{
-} // ManyToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java
deleted file mode 100644
index 21996c930c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOneImpl.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Many To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOneImpl extends AbstractXmlAttributeMapping implements XmlManyToOne
-{
- /**
- * The default value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected static final String TARGET_ENTITY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected String targetEntity = TARGET_ENTITY_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * The default value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected static final Boolean OPTIONAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected Boolean optional = OPTIONAL_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_ONE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetEntity()
- {
- return targetEntity;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- public void setTargetEntity(String newTargetEntity)
- {
- String oldTargetEntity = targetEntity;
- targetEntity = newTargetEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY, oldTargetEntity, targetEntity));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOptional()
- {
- return optional;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- public void setOptional(Boolean newOptional)
- {
- Boolean oldOptional = optional;
- optional = newOptional;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- public CascadeType getCascade()
- {
- return cascade;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCascade(CascadeType newCascade, NotificationChain msgs)
- {
- CascadeType oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, oldCascade, newCascade);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOneImpl#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(CascadeType newCascade)
- {
- if (newCascade != cascade)
- {
- NotificationChain msgs = null;
- if (cascade != null)
- msgs = ((InternalEObject)cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- return getOptional();
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
- case OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_MANY_TO_ONE_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_MANY_TO_ONE_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_MANY_TO_ONE_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL: return OrmPackage.XML_MANY_TO_ONE_IMPL__OPTIONAL;
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_MANY_TO_ONE_IMPL__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(')');
- return result.toString();
- }
-
-} // ManyToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java
deleted file mode 100644
index 62e2209c36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,1040 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Mapped Superclass</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getIdClass <em>Id Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostLoad <em>Post Load</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends AbstractXmlTypeMapping
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected IdClass idClass;
-
- /**
- * The default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * The cached value of the '{@link #getPrePersist() <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrePersist()
- * @generated
- * @ordered
- */
- protected PrePersist prePersist;
-
- /**
- * The cached value of the '{@link #getPostPersist() <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostPersist()
- * @generated
- * @ordered
- */
- protected PostPersist postPersist;
-
- /**
- * The cached value of the '{@link #getPreRemove() <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreRemove()
- * @generated
- * @ordered
- */
- protected PreRemove preRemove;
-
- /**
- * The cached value of the '{@link #getPostRemove() <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostRemove()
- * @generated
- * @ordered
- */
- protected PostRemove postRemove;
-
- /**
- * The cached value of the '{@link #getPreUpdate() <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreUpdate()
- * @generated
- * @ordered
- */
- protected PreUpdate preUpdate;
-
- /**
- * The cached value of the '{@link #getPostUpdate() <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostUpdate()
- * @generated
- * @ordered
- */
- protected PostUpdate postUpdate;
-
- /**
- * The cached value of the '{@link #getPostLoad() <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostLoad()
- * @generated
- * @ordered
- */
- protected PostLoad postLoad;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappedSuperclass()
- {
- super();
- }
-
- public XmlEntityMappings entityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MAPPED_SUPERCLASS;
- }
-
- /**
- * Returns the value of the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id Class</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id Class</em>' containment reference.
- * @see #setIdClass(IdClass)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_IdClass()
- * @model containment="true"
- * @generated
- */
- public IdClass getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(IdClass newIdClass, NotificationChain msgs)
- {
- IdClass oldIdClass = idClass;
- idClass = newIdClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, oldIdClass, newIdClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getIdClass <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id Class</em>' containment reference.
- * @see #getIdClass()
- * @generated
- */
- public void setIdClass(IdClass newIdClass)
- {
- if (newIdClass != idClass)
- {
- NotificationChain msgs = null;
- if (idClass != null)
- msgs = ((InternalEObject)idClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, null, msgs);
- if (newIdClass != null)
- msgs = ((InternalEObject)newIdClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, null, msgs);
- msgs = basicSetIdClass(newIdClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, newIdClass, newIdClass));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Listeners</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeDefaultListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultListeners()
- {
- return excludeDefaultListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #isExcludeDefaultListeners()
- * @generated
- */
- public void setExcludeDefaultListeners(boolean newExcludeDefaultListeners)
- {
- boolean oldExcludeDefaultListeners = excludeDefaultListeners;
- excludeDefaultListeners = newExcludeDefaultListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS, oldExcludeDefaultListeners, excludeDefaultListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Superclass Listeners</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeSuperclassListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeSuperclassListeners()
- {
- return excludeSuperclassListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #isExcludeSuperclassListeners()
- * @generated
- */
- public void setExcludeSuperclassListeners(boolean newExcludeSuperclassListeners)
- {
- boolean oldExcludeSuperclassListeners = excludeSuperclassListeners;
- excludeSuperclassListeners = newExcludeSuperclassListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS, oldExcludeSuperclassListeners, excludeSuperclassListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PrePersist()
- * @model containment="true"
- * @generated
- */
- public PrePersist getPrePersist()
- {
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrePersist(PrePersist newPrePersist, NotificationChain msgs)
- {
- PrePersist oldPrePersist = prePersist;
- prePersist = newPrePersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST, oldPrePersist, newPrePersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- public void setPrePersist(PrePersist newPrePersist)
- {
- if (newPrePersist != prePersist)
- {
- NotificationChain msgs = null;
- if (prePersist != null)
- msgs = ((InternalEObject)prePersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST, newPrePersist, newPrePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PostPersist()
- * @model containment="true"
- * @generated
- */
- public PostPersist getPostPersist()
- {
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostPersist(PostPersist newPostPersist, NotificationChain msgs)
- {
- PostPersist oldPostPersist = postPersist;
- postPersist = newPostPersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST, oldPostPersist, newPostPersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- public void setPostPersist(PostPersist newPostPersist)
- {
- if (newPostPersist != postPersist)
- {
- NotificationChain msgs = null;
- if (postPersist != null)
- msgs = ((InternalEObject)postPersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST, newPostPersist, newPostPersist));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PreRemove()
- * @model containment="true"
- * @generated
- */
- public PreRemove getPreRemove()
- {
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreRemove(PreRemove newPreRemove, NotificationChain msgs)
- {
- PreRemove oldPreRemove = preRemove;
- preRemove = newPreRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE, oldPreRemove, newPreRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- public void setPreRemove(PreRemove newPreRemove)
- {
- if (newPreRemove != preRemove)
- {
- NotificationChain msgs = null;
- if (preRemove != null)
- msgs = ((InternalEObject)preRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE, newPreRemove, newPreRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PostRemove()
- * @model containment="true"
- * @generated
- */
- public PostRemove getPostRemove()
- {
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostRemove(PostRemove newPostRemove, NotificationChain msgs)
- {
- PostRemove oldPostRemove = postRemove;
- postRemove = newPostRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE, oldPostRemove, newPostRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- public void setPostRemove(PostRemove newPostRemove)
- {
- if (newPostRemove != postRemove)
- {
- NotificationChain msgs = null;
- if (postRemove != null)
- msgs = ((InternalEObject)postRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE, newPostRemove, newPostRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PreUpdate()
- * @model containment="true"
- * @generated
- */
- public PreUpdate getPreUpdate()
- {
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreUpdate(PreUpdate newPreUpdate, NotificationChain msgs)
- {
- PreUpdate oldPreUpdate = preUpdate;
- preUpdate = newPreUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE, oldPreUpdate, newPreUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- public void setPreUpdate(PreUpdate newPreUpdate)
- {
- if (newPreUpdate != preUpdate)
- {
- NotificationChain msgs = null;
- if (preUpdate != null)
- msgs = ((InternalEObject)preUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE, newPreUpdate, newPreUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PostUpdate()
- * @model containment="true"
- * @generated
- */
- public PostUpdate getPostUpdate()
- {
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostUpdate(PostUpdate newPostUpdate, NotificationChain msgs)
- {
- PostUpdate oldPostUpdate = postUpdate;
- postUpdate = newPostUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE, oldPostUpdate, newPostUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- public void setPostUpdate(PostUpdate newPostUpdate)
- {
- if (newPostUpdate != postUpdate)
- {
- NotificationChain msgs = null;
- if (postUpdate != null)
- msgs = ((InternalEObject)postUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE, newPostUpdate, newPostUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_PostLoad()
- * @model containment="true"
- * @generated
- */
- public PostLoad getPostLoad()
- {
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostLoad(PostLoad newPostLoad, NotificationChain msgs)
- {
- PostLoad oldPostLoad = postLoad;
- postLoad = newPostLoad;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, oldPostLoad, newPostLoad);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- public void setPostLoad(PostLoad newPostLoad)
- {
- if (newPostLoad != postLoad)
- {
- NotificationChain msgs = null;
- if (postLoad != null)
- msgs = ((InternalEObject)postLoad).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return basicSetIdClass(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return basicSetEntityListeners(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- return basicSetPostLoad(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return getIdClass();
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return getEntityListeners();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- return getPostLoad();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- setIdClass((IdClass)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- setPostLoad((PostLoad)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- setIdClass((IdClass)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- setPostLoad((PostLoad)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return idClass != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return entityListeners != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__POST_LOAD:
- return postLoad != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- result.append(')');
- return result.toString();
- }
-
-} // MappedSuperclass
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java
deleted file mode 100644
index 145df997b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMultiRelationshipMapping.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Multi Relationship Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMappedBy <em>Mapped By</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getOrderBy <em>Order By</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMultiRelationshipMapping extends XmlRelationshipMapping
-{
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- String getOrderBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- void setOrderBy(String value);
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MapKey()
- * @model containment="true"
- * @generated
- */
- MapKey getMapKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- void setMapKey(MapKey value);
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMappedBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMultiRelationshipMapping#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- void setMappedBy(String value);
-
-} // MultiRelationshipMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java
deleted file mode 100644
index 0f9c44a995..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedColumn.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Named Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getColumnDefinition <em>Column Definition</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedColumn extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Definition</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Definition</em>' attribute.
- * @see #setColumnDefinition(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn_ColumnDefinition()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getColumnDefinition();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getColumnDefinition <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column Definition</em>' attribute.
- * @see #getColumnDefinition()
- * @generated
- */
- void setColumnDefinition(String value);
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedColumn_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedColumn#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Return the {@link TextRange} for the name attibute. If the name attibute
- * does not exist return the {@link TextRange} for the *table element.
- */
- TextRange nameTextRange();
-
-} // NamedColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
deleted file mode 100644
index 97b606baf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Named Native Query</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultClass <em>Result Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping <em>Result Set Mapping</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedNativeQuery extends AbstractJpaEObject implements XmlQuery
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected static final String QUERY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected String query = QUERY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getHints() <em>Hints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHints()
- * @generated
- * @ordered
- */
- protected EList<XmlQueryHint> hints;
-
- /**
- * The default value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected static final String RESULT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected String resultClass = RESULT_CLASS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected static final String RESULT_SET_MAPPING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected String resultSetMapping = RESULT_SET_MAPPING_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedNativeQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_NAMED_NATIVE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Class</em>' attribute.
- * @see #setResultClass(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery_ResultClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultClass()
- {
- return resultClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultClass <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Class</em>' attribute.
- * @see #getResultClass()
- * @generated
- */
- public void setResultClass(String newResultClass)
- {
- String oldResultClass = resultClass;
- resultClass = newResultClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS, oldResultClass, resultClass));
- }
-
- /**
- * Returns the value of the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Set Mapping</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Set Mapping</em>' attribute.
- * @see #setResultSetMapping(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery_ResultSetMapping()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultSetMapping()
- {
- return resultSetMapping;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Set Mapping</em>' attribute.
- * @see #getResultSetMapping()
- * @generated
- */
- public void setResultSetMapping(String newResultSetMapping)
- {
- String oldResultSetMapping = resultSetMapping;
- resultSetMapping = newResultSetMapping;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping));
- }
-
- /**
- * Returns the value of the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getQuery()
- {
- return query;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- public void setQuery(String newQuery)
- {
- String oldQuery = query;
- query = newQuery;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY, oldQuery, query));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlQueryHint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- return getName();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- return getQuery();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return getHints();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- return getResultClass();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- return getResultSetMapping();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- setQuery((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- setResultClass((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- setQuery(QUERY_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- getHints().clear();
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- setResultClass(RESULT_CLASS_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", query: ");
- result.append(query);
- result.append(", resultClass: ");
- result.append(resultClass);
- result.append(", resultSetMapping: ");
- result.append(resultSetMapping);
- result.append(')');
- return result.toString();
- }
-
-} // NamedNativeQuery
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
deleted file mode 100644
index 6ad0936b99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Named Query</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedQuery extends AbstractJpaEObject implements XmlQuery
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected static final String QUERY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected String query = QUERY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getHints() <em>Hints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHints()
- * @generated
- * @ordered
- */
- protected EList<XmlQueryHint> hints;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_NAMED_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_QUERY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getQuery()
- {
- return query;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- public void setQuery(String newQuery)
- {
- String oldQuery = query;
- query = newQuery;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_QUERY__QUERY, oldQuery, query));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlQueryHint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, OrmPackage.XML_NAMED_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__NAME:
- return getName();
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- return getQuery();
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return getHints();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- setQuery((String)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- setQuery(QUERY_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- getHints().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query);
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", query: ");
- result.append(query);
- result.append(')');
- return result.toString();
- }
-
-} // NamedQuery
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java
deleted file mode 100644
index 4502f8fc94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>One To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany extends XmlMultiRelationshipMapping
-{
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-} // OneToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
deleted file mode 100644
index bf4c8970fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
+++ /dev/null
@@ -1,787 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>One To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToManyImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToManyImpl extends AbstractXmlAttributeMapping implements XmlOneToMany
-{
- /**
- * The default value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected static final String TARGET_ENTITY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected String targetEntity = TARGET_ENTITY_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * The default value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected static final String MAPPED_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected String mappedBy = MAPPED_BY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected static final String ORDER_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected String orderBy = ORDER_BY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMapKey() <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKey()
- * @generated
- * @ordered
- */
- protected MapKey mapKey;
-
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToManyImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_MANY_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetEntity()
- {
- return targetEntity;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- public void setTargetEntity(String newTargetEntity)
- {
- String oldTargetEntity = targetEntity;
- targetEntity = newTargetEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY, oldTargetEntity, targetEntity));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMappedBy()
- {
- return mappedBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- public void setMappedBy(String newMappedBy)
- {
- String oldMappedBy = mappedBy;
- mappedBy = newMappedBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_OrderBy()
- * @model dataType="org.eclipse.jpt.core.resource.orm.OrderBy"
- * @generated
- */
- public String getOrderBy()
- {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- public void setOrderBy(String newOrderBy)
- {
- String oldOrderBy = orderBy;
- orderBy = newOrderBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_MapKey()
- * @model containment="true"
- * @generated
- */
- public MapKey getMapKey()
- {
- return mapKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKey(MapKey newMapKey, NotificationChain msgs)
- {
- MapKey oldMapKey = mapKey;
- mapKey = newMapKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, oldMapKey, newMapKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- public void setMapKey(MapKey newMapKey)
- {
- if (newMapKey != mapKey)
- {
- NotificationChain msgs = null;
- if (mapKey != null)
- msgs = ((InternalEObject)mapKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- public CascadeType getCascade()
- {
- return cascade;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCascade(CascadeType newCascade, NotificationChain msgs)
- {
- CascadeType oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, oldCascade, newCascade);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToManyImpl#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(CascadeType newCascade)
- {
- if (newCascade != cascade)
- {
- NotificationChain msgs = null;
- if (cascade != null)
- msgs = ((InternalEObject)cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return basicSetMapKey(null, msgs);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- return getOrderBy();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return getMapKey();
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- setMapKey((MapKey)null);
- return;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY:
- return mapKey != null;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
- case OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY: return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_ONE_TO_MANY_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_ONE_TO_MANY_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_ONE_TO_MANY_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY: return OrmPackage.XML_ONE_TO_MANY_IMPL__MAPPED_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY: return OrmPackage.XML_ONE_TO_MANY_IMPL__ORDER_BY;
- case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY: return OrmPackage.XML_ONE_TO_MANY_IMPL__MAP_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_MANY_IMPL__JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(')');
- return result.toString();
- }
-
-} // OneToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java
deleted file mode 100644
index 19da5f080a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>One To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getMappedBy <em>Mapped By</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne extends XmlSingleRelationshipMapping
-{
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMappedBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- void setMappedBy(String value);
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns();
-
-} // OneToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
deleted file mode 100644
index efd40cb31e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
+++ /dev/null
@@ -1,751 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>One To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOneImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOneImpl extends AbstractXmlAttributeMapping implements XmlOneToOne
-{
- /**
- * The default value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected static final String TARGET_ENTITY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected String targetEntity = TARGET_ENTITY_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * The default value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected static final Boolean OPTIONAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected Boolean optional = OPTIONAL_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * The default value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected static final String MAPPED_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected String mappedBy = MAPPED_BY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToOneImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_ONE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetEntity()
- {
- return targetEntity;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- public void setTargetEntity(String newTargetEntity)
- {
- String oldTargetEntity = targetEntity;
- targetEntity = newTargetEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY, oldTargetEntity, targetEntity));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOptional()
- {
- return optional;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- public void setOptional(Boolean newOptional)
- {
- Boolean oldOptional = optional;
- optional = newOptional;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMappedBy()
- {
- return mappedBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- public void setMappedBy(String newMappedBy)
- {
- String oldMappedBy = mappedBy;
- mappedBy = newMappedBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- public CascadeType getCascade()
- {
- return cascade;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCascade(CascadeType newCascade, NotificationChain msgs)
- {
- CascadeType oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, oldCascade, newCascade);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOneImpl#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(CascadeType newCascade)
- {
- if (newCascade != cascade)
- {
- NotificationChain msgs = null;
- if (cascade != null)
- msgs = ((InternalEObject)cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return basicSetCascade(null, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- return getFetch();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return getCascade();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- return getOptional();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- setCascade((CascadeType)null);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE:
- return cascade != null;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY: return OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH: return OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE: return OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE: return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS: return OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY: return OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_RELATIONSHIP_MAPPING__TARGET_ENTITY: return OrmPackage.XML_ONE_TO_ONE_IMPL__TARGET_ENTITY;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__FETCH: return OrmPackage.XML_ONE_TO_ONE_IMPL__FETCH;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_TABLE;
- case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE: return OrmPackage.XML_ONE_TO_ONE_IMPL__CASCADE;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL: return OrmPackage.XML_ONE_TO_ONE_IMPL__OPTIONAL;
- case OrmPackage.XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE_IMPL__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY: return OrmPackage.XML_ONE_TO_ONE_IMPL__MAPPED_BY;
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_ONE_IMPL__PRIMARY_KEY_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(", mappedBy: ");
- result.append(mappedBy);
- result.append(')');
- return result.toString();
- }
-
-} // OneToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java
deleted file mode 100644
index 9c35c572ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence Unit Defaults</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getAccess <em>Access</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_PERSIST_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected boolean cascadePersist = CASCADE_PERSIST_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitDefaults()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PERSISTENCE_UNIT_DEFAULTS;
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The default value is <code>"PROPERTY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_Access()
- * @model default="PROPERTY"
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Persist</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade Persist</em>' attribute.
- * @see #setCascadePersist(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_CascadePersist()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadePersist()
- {
- return cascadePersist;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Persist</em>' attribute.
- * @see #isCascadePersist()
- * @generated
- */
- public void setCascadePersist(boolean newCascadePersist)
- {
- boolean oldCascadePersist = cascadePersist;
- cascadePersist = newCascadePersist;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST, oldCascadePersist, cascadePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return basicSetEntityListeners(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- return getSchema();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- return getCatalog();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- return getAccess();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- return isCascadePersist() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- setCascadePersist(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- setCascadePersist(CASCADE_PERSIST_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- return cascadePersist != CASCADE_PERSIST_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return entityListeners != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", access: ");
- result.append(access);
- result.append(", cascadePersist: ");
- result.append(cascadePersist);
- result.append(')');
- return result.toString();
- }
-
-} // PersistenceUnitDefaults
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java
deleted file mode 100644
index 06b617dd77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence Unit Metadata</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
- * @generated
- * @ordered
- */
- protected static final boolean XML_MAPPING_METADATA_COMPLETE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
- * @generated
- * @ordered
- */
- protected boolean xmlMappingMetadataComplete = XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPersistenceUnitDefaults() <em>Persistence Unit Defaults</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnitDefaults()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitDefaults persistenceUnitDefaults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitMetadata()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PERSISTENCE_UNIT_METADATA;
- }
-
- /**
- * Returns the value of the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Xml Mapping Metadata Complete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #setXmlMappingMetadataComplete(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isXmlMappingMetadataComplete()
- {
- return xmlMappingMetadataComplete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #isXmlMappingMetadataComplete()
- * @generated
- */
- public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete)
- {
- boolean oldXmlMappingMetadataComplete = xmlMappingMetadataComplete;
- xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE, oldXmlMappingMetadataComplete, xmlMappingMetadataComplete));
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Unit Defaults</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Unit Defaults</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Persistence Unit Defaults</em>' containment reference.
- * @see #setPersistenceUnitDefaults(XmlPersistenceUnitDefaults)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata_PersistenceUnitDefaults()
- * @model containment="true"
- * @generated
- */
- public XmlPersistenceUnitDefaults getPersistenceUnitDefaults()
- {
- return persistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPersistenceUnitDefaults(XmlPersistenceUnitDefaults newPersistenceUnitDefaults, NotificationChain msgs)
- {
- XmlPersistenceUnitDefaults oldPersistenceUnitDefaults = persistenceUnitDefaults;
- persistenceUnitDefaults = newPersistenceUnitDefaults;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, oldPersistenceUnitDefaults, newPersistenceUnitDefaults);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Persistence Unit Defaults</em>' containment reference.
- * @see #getPersistenceUnitDefaults()
- * @generated
- */
- public void setPersistenceUnitDefaults(XmlPersistenceUnitDefaults newPersistenceUnitDefaults)
- {
- if (newPersistenceUnitDefaults != persistenceUnitDefaults)
- {
- NotificationChain msgs = null;
- if (persistenceUnitDefaults != null)
- msgs = ((InternalEObject)persistenceUnitDefaults).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, null, msgs);
- if (newPersistenceUnitDefaults != null)
- msgs = ((InternalEObject)newPersistenceUnitDefaults).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, null, msgs);
- msgs = basicSetPersistenceUnitDefaults(newPersistenceUnitDefaults, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, newPersistenceUnitDefaults, newPersistenceUnitDefaults));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return basicSetPersistenceUnitDefaults(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- return isXmlMappingMetadataComplete() ? Boolean.TRUE : Boolean.FALSE;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return getPersistenceUnitDefaults();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- setXmlMappingMetadataComplete(((Boolean)newValue).booleanValue());
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- setPersistenceUnitDefaults((XmlPersistenceUnitDefaults)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- setXmlMappingMetadataComplete(XML_MAPPING_METADATA_COMPLETE_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- setPersistenceUnitDefaults((XmlPersistenceUnitDefaults)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- return xmlMappingMetadataComplete != XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return persistenceUnitDefaults != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (xmlMappingMetadataComplete: ");
- result.append(xmlMappingMetadataComplete);
- result.append(')');
- return result.toString();
- }
-
-} // PersistenceUnitMetadata
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java
deleted file mode 100644
index 440d4d1ea0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.TextRange;
-import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
-import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Primary Key Join Column</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlPrimaryKeyJoinColumn extends AbstractXmlNamedColumn
-{
- /**
- * The default value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected String referencedColumnName = REFERENCED_COLUMN_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPrimaryKeyJoinColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PRIMARY_KEY_JOIN_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Referenced Column Name</em>' attribute.
- * @see #setReferencedColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn_ReferencedColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReferencedColumnName()
- {
- return referencedColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Referenced Column Name</em>' attribute.
- * @see #getReferencedColumnName()
- * @generated
- */
- public void setReferencedColumnName(String newReferencedColumnName)
- {
- String oldReferencedColumnName = referencedColumnName;
- referencedColumnName = newReferencedColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME, oldReferencedColumnName, referencedColumnName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return getReferencedColumnName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName(REFERENCED_COLUMN_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return REFERENCED_COLUMN_NAME_EDEFAULT == null ? referencedColumnName != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(referencedColumnName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange referencedColumnNameTextRange() {
- IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.getChildAttributeNode(this.node, OrmXmlMapper.REFERENCED_COLUMN_NAME);
- return (referencedColumnNameNode == null) ? validationTextRange() : buildTextRange(referencedColumnNameNode);
- }
-
-
-} // PrimaryKeyJoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java
deleted file mode 100644
index 6c9676e3ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Query</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getHints <em>Hints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQuery extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getQuery();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- void setQuery(String value);
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlQueryHint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- EList<XmlQueryHint> getHints();
-
-} // Query
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java
deleted file mode 100644
index ed0a6c85ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Query Hint</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlQueryHint extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlQueryHint()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_QUERY_HINT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_QUERY_HINT__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint_Value()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- public void setValue(String newValue)
- {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_QUERY_HINT__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__NAME:
- return getName();
- case OrmPackage.XML_QUERY_HINT__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_QUERY_HINT__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_QUERY_HINT__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_QUERY_HINT__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} // QueryHint
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java
deleted file mode 100644
index 78ee50bc0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlRelationshipMapping.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Relationship Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getJoinTable <em>Join Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getCascade <em>Cascade</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlRelationshipMapping extends XmlAttributeMapping
-{
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTargetEntity();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- void setTargetEntity(String value);
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- FetchType getFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- void setFetch(FetchType value);
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- CascadeType getCascade();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- void setCascade(CascadeType value);
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlRelationshipMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- XmlJoinTable getJoinTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlRelationshipMapping#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- void setJoinTable(XmlJoinTable value);
-
-} // RelationshipMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java
deleted file mode 100644
index a6cfb7aa0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Secondary Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSecondaryTable extends XmlBaseTable
-{
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns();
-
-} // SecondaryTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java
deleted file mode 100644
index d0d68d926c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTableImpl.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Secondary Table Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTableImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlSecondaryTableImpl extends AbstractXmlBaseTable implements XmlSecondaryTable
-{
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSecondaryTableImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SECONDARY_TABLE_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS: return OrmPackage.XML_SECONDARY_TABLE_IMPL__PRIMARY_KEY_JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-} // XmlSecondaryTableImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java
deleted file mode 100644
index 161fdc9c3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Sequence Generator</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSequenceGenerator extends XmlGenerator
-{
- /**
- * Returns the value of the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Name</em>' attribute.
- * @see #setSequenceName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator_SequenceName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSequenceName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Name</em>' attribute.
- * @see #getSequenceName()
- * @generated
- */
- void setSequenceName(String value);
-
-} // SequenceGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
deleted file mode 100644
index 924f863d8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Sequence Generator</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGeneratorImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlSequenceGeneratorImpl extends AbstractJpaEObject implements XmlSequenceGenerator
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected static final Integer INITIAL_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected Integer initialValue = INITIAL_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected static final Integer ALLOCATION_SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected Integer allocationSize = ALLOCATION_SIZE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSequenceName() <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceName()
- * @generated
- * @ordered
- */
- protected static final String SEQUENCE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSequenceName() <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceName()
- * @generated
- * @ordered
- */
- protected String sequenceName = SEQUENCE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSequenceGeneratorImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SEQUENCE_GENERATOR_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Name</em>' attribute.
- * @see #setSequenceName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator_SequenceName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSequenceName()
- {
- return sequenceName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl#getSequenceName <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Name</em>' attribute.
- * @see #getSequenceName()
- * @generated
- */
- public void setSequenceName(String newSequenceName)
- {
- String oldSequenceName = sequenceName;
- sequenceName = newSequenceName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME, oldSequenceName, sequenceName));
- }
-
- /**
- * Returns the value of the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getInitialValue()
- {
- return initialValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- public void setInitialValue(Integer newInitialValue)
- {
- Integer oldInitialValue = initialValue;
- initialValue = newInitialValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE, oldInitialValue, initialValue));
- }
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getAllocationSize()
- {
- return allocationSize;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGeneratorImpl#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- public void setAllocationSize(Integer newAllocationSize)
- {
- Integer oldAllocationSize = allocationSize;
- allocationSize = newAllocationSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE, oldAllocationSize, allocationSize));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME:
- return getName();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME:
- return getSequenceName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME:
- setSequenceName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME:
- setSequenceName(SEQUENCE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME:
- return SEQUENCE_NAME_EDEFAULT == null ? sequenceName != null : !SEQUENCE_NAME_EDEFAULT.equals(sequenceName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", initialValue: ");
- result.append(initialValue);
- result.append(", allocationSize: ");
- result.append(allocationSize);
- result.append(", sequenceName: ");
- result.append(sequenceName);
- result.append(')');
- return result.toString();
- }
-
-} // SequenceGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java
deleted file mode 100644
index 7ffe31a8b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSingleRelationshipMapping.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Single Relationship Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getOptional <em>Optional</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSingleRelationshipMapping extends XmlRelationshipMapping
-{
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getOptional();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSingleRelationshipMapping#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- void setOptional(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSingleRelationshipMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-} // SingleRelationshipMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java
deleted file mode 100644
index ddcde8ddc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlTable extends AbstractXmlBaseTable
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TABLE;
- }
-} // Table
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java
deleted file mode 100644
index 259b5ad101..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Table Generator</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints <em>Unique Constraints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTableGenerator extends XmlGenerator
-{
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCatalog();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- void setCatalog(String value);
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSchema();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- void setSchema(String value);
-
- /**
- * Returns the value of the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pk Column Name</em>' attribute.
- * @see #setPkColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getPkColumnName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Name</em>' attribute.
- * @see #getPkColumnName()
- * @generated
- */
- void setPkColumnName(String value);
-
- /**
- * Returns the value of the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Column Name</em>' attribute.
- * @see #setValueColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_ValueColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getValueColumnName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Column Name</em>' attribute.
- * @see #getValueColumnName()
- * @generated
- */
- void setValueColumnName(String value);
-
- /**
- * Returns the value of the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pk Column Value</em>' attribute.
- * @see #setPkColumnValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getPkColumnValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Value</em>' attribute.
- * @see #getPkColumnValue()
- * @generated
- */
- void setPkColumnValue(String value);
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.UniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- EList<UniqueConstraint> getUniqueConstraints();
-
-} // TableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
deleted file mode 100644
index 29592462f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
+++ /dev/null
@@ -1,797 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Table Generator</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGeneratorImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTableGeneratorImpl extends AbstractJpaEObject implements XmlTableGenerator
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected static final Integer INITIAL_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected Integer initialValue = INITIAL_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected static final Integer ALLOCATION_SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected Integer allocationSize = ALLOCATION_SIZE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPkColumnName() <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnName()
- * @generated
- * @ordered
- */
- protected static final String PK_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPkColumnName() <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnName()
- * @generated
- * @ordered
- */
- protected String pkColumnName = PK_COLUMN_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValueColumnName() <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueColumnName()
- * @generated
- * @ordered
- */
- protected static final String VALUE_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValueColumnName() <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueColumnName()
- * @generated
- * @ordered
- */
- protected String valueColumnName = VALUE_COLUMN_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPkColumnValue() <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnValue()
- * @generated
- * @ordered
- */
- protected static final String PK_COLUMN_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPkColumnValue() <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnValue()
- * @generated
- * @ordered
- */
- protected String pkColumnValue = PK_COLUMN_VALUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUniqueConstraints()
- * @generated
- * @ordered
- */
- protected EList<UniqueConstraint> uniqueConstraints;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTableGeneratorImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TABLE_GENERATOR_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pk Column Name</em>' attribute.
- * @see #setPkColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPkColumnName()
- {
- return pkColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getPkColumnName <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Name</em>' attribute.
- * @see #getPkColumnName()
- * @generated
- */
- public void setPkColumnName(String newPkColumnName)
- {
- String oldPkColumnName = pkColumnName;
- pkColumnName = newPkColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME, oldPkColumnName, pkColumnName));
- }
-
- /**
- * Returns the value of the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Column Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Column Name</em>' attribute.
- * @see #setValueColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_ValueColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValueColumnName()
- {
- return valueColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getValueColumnName <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Column Name</em>' attribute.
- * @see #getValueColumnName()
- * @generated
- */
- public void setValueColumnName(String newValueColumnName)
- {
- String oldValueColumnName = valueColumnName;
- valueColumnName = newValueColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME, oldValueColumnName, valueColumnName));
- }
-
- /**
- * Returns the value of the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pk Column Value</em>' attribute.
- * @see #setPkColumnValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPkColumnValue()
- {
- return pkColumnValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getPkColumnValue <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Value</em>' attribute.
- * @see #getPkColumnValue()
- * @generated
- */
- public void setPkColumnValue(String newPkColumnValue)
- {
- String oldPkColumnValue = pkColumnValue;
- pkColumnValue = newPkColumnValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE, oldPkColumnValue, pkColumnValue));
- }
-
- /**
- * Returns the value of the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getInitialValue()
- {
- return initialValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- public void setInitialValue(Integer newInitialValue)
- {
- Integer oldInitialValue = initialValue;
- initialValue = newInitialValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE, oldInitialValue, initialValue));
- }
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getAllocationSize()
- {
- return allocationSize;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGeneratorImpl#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- public void setAllocationSize(Integer newAllocationSize)
- {
- Integer oldAllocationSize = allocationSize;
- allocationSize = newAllocationSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE, oldAllocationSize, allocationSize));
- }
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.UniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- public EList<UniqueConstraint> getUniqueConstraints()
- {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<UniqueConstraint>(UniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS);
- }
- return uniqueConstraints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS:
- return ((InternalEList<?>)getUniqueConstraints()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__NAME:
- return getName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- return getTable();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- return getCatalog();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- return getSchema();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- return getPkColumnName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- return getValueColumnName();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- return getPkColumnValue();
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS:
- return getUniqueConstraints();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- setPkColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- setValueColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- setPkColumnValue((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- getUniqueConstraints().addAll((Collection<? extends UniqueConstraint>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- setPkColumnName(PK_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- setValueColumnName(VALUE_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- setPkColumnValue(PK_COLUMN_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_NAME:
- return PK_COLUMN_NAME_EDEFAULT == null ? pkColumnName != null : !PK_COLUMN_NAME_EDEFAULT.equals(pkColumnName);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__VALUE_COLUMN_NAME:
- return VALUE_COLUMN_NAME_EDEFAULT == null ? valueColumnName != null : !VALUE_COLUMN_NAME_EDEFAULT.equals(valueColumnName);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__PK_COLUMN_VALUE:
- return PK_COLUMN_VALUE_EDEFAULT == null ? pkColumnValue != null : !PK_COLUMN_VALUE_EDEFAULT.equals(pkColumnValue);
- case OrmPackage.XML_TABLE_GENERATOR_IMPL__UNIQUE_CONSTRAINTS:
- return uniqueConstraints != null && !uniqueConstraints.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", initialValue: ");
- result.append(initialValue);
- result.append(", allocationSize: ");
- result.append(allocationSize);
- result.append(", table: ");
- result.append(table);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", schema: ");
- result.append(schema);
- result.append(", pkColumnName: ");
- result.append(pkColumnName);
- result.append(", valueColumnName: ");
- result.append(valueColumnName);
- result.append(", pkColumnValue: ");
- result.append(pkColumnValue);
- result.append(')');
- return result.toString();
- }
-
-} // TableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java
deleted file mode 100644
index aeae56313b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Transient</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransient()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTransient extends XmlAttributeMapping
-{
-} // Transient
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java
deleted file mode 100644
index 20a95752ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransientImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Transient</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransientImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlTransientImpl extends AbstractXmlAttributeMapping implements XmlTransient
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransientImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TRANSIENT_IMPL;
- }
-
-} // Transient
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java
deleted file mode 100644
index c1e5ed9ac2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Version</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getTemporal <em>Temporal</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlVersion extends XmlAttributeMapping, ColumnMapping
-{
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion_Temporal()
- * @model
- * @generated
- */
- TemporalType getTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- void setTemporal(TemporalType value);
-
-} // Version
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java
deleted file mode 100644
index e5638836bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersionImpl.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Version</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersionImpl()
- * @model kind="class"
- * @generated
- */
-public class XmlVersionImpl extends AbstractXmlAttributeMapping implements XmlVersion
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVersionImpl()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_VERSION_IMPL;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION_IMPL__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_VERSION_IMPL__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_VERSION_IMPL__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION_IMPL__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersionImpl#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION_IMPL__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN:
- return basicSetColumn(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN:
- return getColumn();
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- return getTemporal();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN:
- return column != null;
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_VERSION_IMPL__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_VERSION_IMPL__TEMPORAL: return OrmPackage.XML_VERSION__TEMPORAL;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_VERSION_IMPL__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlVersion.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_VERSION__TEMPORAL: return OrmPackage.XML_VERSION_IMPL__TEMPORAL;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (temporal: ");
- result.append(temporal);
- result.append(')');
- return result.toString();
- }
-
-} // Version
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceArtifactEdit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceArtifactEdit.java
deleted file mode 100644
index c4b6b3009d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceArtifactEdit.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.common.JpaArtifactEdit;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class PersistenceArtifactEdit extends JpaArtifactEdit
-{
- /**
- * @param aProject
- * @return a persistence artifact for project aProject.
- * Opened only for read access (no write)
- */
- public static PersistenceArtifactEdit getArtifactEditForRead(IProject aProject) {
- PersistenceArtifactEdit artifactEdit = null;
- try {
- artifactEdit = new PersistenceArtifactEdit(aProject, true);
- }
- catch (IllegalArgumentException iae) {
- // suppress illegal argument exception
- JptCorePlugin.log(iae);
- }
- return artifactEdit;
- }
-
- /**
- * @param aProject
- * @return a persistence artifact for the project aProject.
- * Opened for both write and read access
- */
- public static PersistenceArtifactEdit getArtifactEditForWrite(IProject aProject) {
- PersistenceArtifactEdit artifactEdit = null;
- try {
- artifactEdit = new PersistenceArtifactEdit(aProject, false);
- }
- catch (IllegalArgumentException iae) {
- // suppress illegal argument exception
- JptCorePlugin.log(iae);
- }
- return artifactEdit;
- }
-
-
- public PersistenceArtifactEdit(IProject aProject, boolean toAccessAsReadOnly)
- throws IllegalArgumentException {
- super(aProject, toAccessAsReadOnly);
- }
-
-
- @Override
- public PersistenceResource getResource(IFile file) {
- // This *seems* to do the same basic thing as below, but circumvents the
- // URI munging that ArtifactEditModel does (see bug 209093)
- try {
- PersistenceResource resource =
- (PersistenceResource) getArtifactEditModel().createResource(URI.createPlatformResourceURI(file.getFullPath().toString()));
- if (! resource.isLoaded()) {
- resource.load(getArtifactEditModel().getResourceSet().getLoadOptions());
- }
- return resource;
- }
- catch (ClassCastException cce) {
- return null;
- }
- catch (IOException ioe) {
- JptCorePlugin.log(ioe);
- return null;
- }
- }
-
- @Override
- public PersistenceResource getResource(String fileURI) {
- try {
- return (PersistenceResource) getArtifactEditModel().getResource(URI.createURI(fileURI));
- }
- catch (ClassCastException cce) {
- return null;
- }
- }
-
- /**
- * Return a persistence resource for the default deploy location
- */
- public PersistenceResource getResource() {
- return getResource(JptCorePlugin.persistenceXmlDeploymentURI(getProject()));
- }
-
- /**
- * Create a persistence resource with base defaults
- */
- public PersistenceResource createDefaultResource() {
- PersistenceResource resource = getResource();
- XmlPersistence persistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- persistence.setVersion("1.0");
- XmlPersistenceUnit pUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- pUnit.setName(getProject().getName());
- persistence.getPersistenceUnits().add(pUnit);
- resource.getContents().add(persistence);
- save(null);
- return resource;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java
deleted file mode 100644
index 4fbedaaaaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage
- * @generated
- */
-public class PersistenceFactory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistenceFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static PersistenceFactory init()
- {
- try
- {
- PersistenceFactory thePersistenceFactory = (PersistenceFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.persistence.xmi");
- if (thePersistenceFactory != null)
- {
- return thePersistenceFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new PersistenceFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistenceFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case PersistencePackage.XML_PERSISTENCE: return (EObject)createXmlPersistence();
- case PersistencePackage.XML_PERSISTENCE_UNIT: return (EObject)createXmlPersistenceUnit();
- case PersistencePackage.XML_MAPPING_FILE_REF: return (EObject)createXmlMappingFileRef();
- case PersistencePackage.XML_JAVA_CLASS_REF: return (EObject)createXmlJavaClassRef();
- case PersistencePackage.XML_PROPERTIES: return (EObject)createXmlProperties();
- case PersistencePackage.XML_PROPERTY: return (EObject)createXmlProperty();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE:
- return createXmlPersistenceUnitTransactionTypeFromString(eDataType, initialValue);
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT:
- return createXmlPersistenceUnitTransactionTypeObjectFromString(eDataType, initialValue);
- case PersistencePackage.XML_VERSION:
- return createXmlVersionFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE:
- return convertXmlPersistenceUnitTransactionTypeToString(eDataType, instanceValue);
- case PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT:
- return convertXmlPersistenceUnitTransactionTypeObjectToString(eDataType, instanceValue);
- case PersistencePackage.XML_VERSION:
- return convertXmlVersionToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistence createXmlPersistence()
- {
- XmlPersistence xmlPersistence = new XmlPersistence();
- return xmlPersistence;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnit createXmlPersistenceUnit()
- {
- XmlPersistenceUnit xmlPersistenceUnit = new XmlPersistenceUnit();
- return xmlPersistenceUnit;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappingFileRef createXmlMappingFileRef()
- {
- XmlMappingFileRef xmlMappingFileRef = new XmlMappingFileRef();
- return xmlMappingFileRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJavaClassRef createXmlJavaClassRef()
- {
- XmlJavaClassRef xmlJavaClassRef = new XmlJavaClassRef();
- return xmlJavaClassRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperties createXmlProperties()
- {
- XmlProperties xmlProperties = new XmlProperties();
- return xmlProperties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperty createXmlProperty()
- {
- XmlProperty xmlProperty = new XmlProperty();
- return xmlProperty;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitTransactionType createXmlPersistenceUnitTransactionTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlPersistenceUnitTransactionType result = XmlPersistenceUnitTransactionType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlPersistenceUnitTransactionTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Enumerator createXmlPersistenceUnitTransactionTypeObjectFromString(EDataType eDataType, String initialValue)
- {
- return (Enumerator)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlPersistenceUnitTransactionTypeObjectToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String createXmlVersionFromString(EDataType eDataType, String initialValue)
- {
- return (String)super.createFromString(eDataType, initialValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlVersionToString(EDataType eDataType, Object instanceValue)
- {
- return super.convertToString(eDataType, instanceValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistencePackage getPersistencePackage()
- {
- return (PersistencePackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static PersistencePackage getPackage()
- {
- return PersistencePackage.eINSTANCE;
- }
-
-} //PersistenceFactory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java
deleted file mode 100644
index 29fa3a9445..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java
+++ /dev/null
@@ -1,1324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.PersistenceFactory
- * @model kind="package"
- * @generated
- */
-public class PersistencePackage extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "persistence";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.persistence.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.persistence";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistencePackage eINSTANCE = org.eclipse.jpt.core.resource.persistence.PersistencePackage.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @generated
- */
- public static final int XML_PERSISTENCE = 0;
-
- /**
- * The feature id for the '<em><b>Persistence Units</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE__PERSISTENCE_UNITS = 0;
-
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE__VERSION = 1;
-
- /**
- * The number of structural features of the '<em>Xml Persistence</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT = 1;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__DESCRIPTION = 0;
-
- /**
- * The feature id for the '<em><b>Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__PROVIDER = 1;
-
- /**
- * The feature id for the '<em><b>Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE = 2;
-
- /**
- * The feature id for the '<em><b>Non Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = 3;
-
- /**
- * The feature id for the '<em><b>Mapping Files</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__MAPPING_FILES = 4;
-
- /**
- * The feature id for the '<em><b>Jar Files</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__JAR_FILES = 5;
-
- /**
- * The feature id for the '<em><b>Classes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__CLASSES = 6;
-
- /**
- * The feature id for the '<em><b>Exclude Unlisted Classes</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = 7;
-
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__PROPERTIES = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__NAME = 9;
-
- /**
- * The feature id for the '<em><b>Transaction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__TRANSACTION_TYPE = 10;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_FEATURE_COUNT = 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @generated
- */
- public static final int XML_MAPPING_FILE_REF = 2;
-
- /**
- * The feature id for the '<em><b>File Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPING_FILE_REF__FILE_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapping File Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPING_FILE_REF_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @generated
- */
- public static final int XML_JAVA_CLASS_REF = 3;
-
- /**
- * The feature id for the '<em><b>Java Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAVA_CLASS_REF__JAVA_CLASS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Java Class Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAVA_CLASS_REF_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @generated
- */
- public static final int XML_PROPERTIES = 4;
-
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTIES__PROPERTIES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Properties</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTIES_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty()
- * @generated
- */
- public static final int XML_PROPERTY = 5;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__VALUE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Property</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_TRANSACTION_TYPE = 6;
-
- /**
- * The meta object id for the '<em>Xml Persistence Unit Transaction Type Object</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionTypeObject()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = 7;
-
- /**
- * The meta object id for the '<em>Xml Version</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 8;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappingFileRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJavaClassRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertiesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlPersistenceUnitTransactionTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType xmlPersistenceUnitTransactionTypeObjectEDataType = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EDataType xmlVersionEDataType = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#eNS_URI
- * @see #init()
- * @generated
- */
- private PersistencePackage()
- {
- super(eNS_URI, PersistenceFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this
- * model, and for any others upon which it depends. Simple
- * dependencies are satisfied by calling this method on all
- * dependent packages before doing anything else. This method drives
- * initialization for interdependent packages directly, in parallel
- * with this package, itself.
- * <p>Of this package and its interdependencies, all packages which
- * have not yet been registered by their URI values are first created
- * and registered. The packages are then initialized in two steps:
- * meta-model objects for all of the packages are created before any
- * are initialized, since one package's meta-model objects may refer to
- * those of another.
- * <p>Invocation of this method will not affect any packages that have
- * already been initialized.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static PersistencePackage init()
- {
- if (isInited) return (PersistencePackage)EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI);
-
- // Obtain or create and register package
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PersistencePackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE);
-
- // Create package meta-data objects
- thePersistencePackage.createPackageContents();
- theOrmPackage.createPackageContents();
-
- // Initialize created meta-data
- thePersistencePackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePersistencePackage.freeze();
-
- return thePersistencePackage;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @generated
- */
- public EClass getXmlPersistence()
- {
- return xmlPersistenceEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getPersistenceUnits <em>Persistence Units</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Persistence Units</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence#getPersistenceUnits()
- * @see #getXmlPersistence()
- * @generated
- */
- public EReference getXmlPersistence_PersistenceUnits()
- {
- return (EReference)xmlPersistenceEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getVersion <em>Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Version</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence#getVersion()
- * @see #getXmlPersistence()
- * @generated
- */
- public EAttribute getXmlPersistence_Version()
- {
- return (EAttribute)xmlPersistenceEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @generated
- */
- public EClass getXmlPersistenceUnit()
- {
- return xmlPersistenceUnitEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Description()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Provider</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Provider()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jta Data Source</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_JtaDataSource()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Jta Data Source</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_NonJtaDataSource()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles <em>Mapping Files</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Mapping Files</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_MappingFiles()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles <em>Jar Files</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Jar Files</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_JarFiles()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses <em>Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Classes</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_Classes()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Unlisted Classes</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_ExcludeUnlistedClasses()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Properties</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_Properties()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Name()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Transaction Type</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_TransactionType()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(10);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapping File Ref</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @generated
- */
- public EClass getXmlMappingFileRef()
- {
- return xmlMappingFileRefEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>File Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName()
- * @see #getXmlMappingFileRef()
- * @generated
- */
- public EAttribute getXmlMappingFileRef_FileName()
- {
- return (EAttribute)xmlMappingFileRefEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Java Class Ref</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @generated
- */
- public EClass getXmlJavaClassRef()
- {
- return xmlJavaClassRefEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Java Class</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass()
- * @see #getXmlJavaClassRef()
- * @generated
- */
- public EAttribute getXmlJavaClassRef_JavaClass()
- {
- return (EAttribute)xmlJavaClassRefEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Properties</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @generated
- */
- public EClass getXmlProperties()
- {
- return xmlPropertiesEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties#getProperties <em>Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Properties</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties#getProperties()
- * @see #getXmlProperties()
- * @generated
- */
- public EReference getXmlProperties_Properties()
- {
- return (EReference)xmlPropertiesEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty <em>Xml Property</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Property</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty
- * @generated
- */
- public EClass getXmlProperty()
- {
- return xmlPropertyEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty#getName()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Name()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty#getValue()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Value()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Persistence Unit Transaction Type</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @generated
- */
- public EEnum getXmlPersistenceUnitTransactionType()
- {
- return xmlPersistenceUnitTransactionTypeEEnum;
- }
-
-
- /**
- * Returns the meta object for data type '{@link org.eclipse.emf.common.util.Enumerator <em>Xml Persistence Unit Transaction Type Object</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Xml Persistence Unit Transaction Type Object</em>'.
- * @see org.eclipse.emf.common.util.Enumerator
- * @model instanceClass="org.eclipse.emf.common.util.Enumerator"
- * @generated
- */
- public EDataType getXmlPersistenceUnitTransactionTypeObject()
- {
- return xmlPersistenceUnitTransactionTypeObjectEDataType;
- }
-
-
- /**
- * Returns the meta object for data type '{@link java.lang.String <em>Xml Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for data type '<em>Xml Version</em>'.
- * @see java.lang.String
- * @model instanceClass="java.lang.String"
- * @generated
- */
- public EDataType getXmlVersion()
- {
- return xmlVersionEDataType;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public PersistenceFactory getPersistenceFactory()
- {
- return (PersistenceFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlPersistenceEClass = createEClass(XML_PERSISTENCE);
- createEReference(xmlPersistenceEClass, XML_PERSISTENCE__PERSISTENCE_UNITS);
- createEAttribute(xmlPersistenceEClass, XML_PERSISTENCE__VERSION);
-
- xmlPersistenceUnitEClass = createEClass(XML_PERSISTENCE_UNIT);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__DESCRIPTION);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__PROVIDER);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__MAPPING_FILES);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__JAR_FILES);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__CLASSES);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__PROPERTIES);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__NAME);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__TRANSACTION_TYPE);
-
- xmlMappingFileRefEClass = createEClass(XML_MAPPING_FILE_REF);
- createEAttribute(xmlMappingFileRefEClass, XML_MAPPING_FILE_REF__FILE_NAME);
-
- xmlJavaClassRefEClass = createEClass(XML_JAVA_CLASS_REF);
- createEAttribute(xmlJavaClassRefEClass, XML_JAVA_CLASS_REF__JAVA_CLASS);
-
- xmlPropertiesEClass = createEClass(XML_PROPERTIES);
- createEReference(xmlPropertiesEClass, XML_PROPERTIES__PROPERTIES);
-
- xmlPropertyEClass = createEClass(XML_PROPERTY);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__NAME);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE);
-
- // Create enums
- xmlPersistenceUnitTransactionTypeEEnum = createEEnum(XML_PERSISTENCE_UNIT_TRANSACTION_TYPE);
-
- // Create data types
- xmlPersistenceUnitTransactionTypeObjectEDataType = createEDataType(XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT);
- xmlVersionEDataType = createEDataType(XML_VERSION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlPersistenceEClass, XmlPersistence.class, "XmlPersistence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPersistence_PersistenceUnits(), this.getXmlPersistenceUnit(), null, "persistenceUnits", null, 0, -1, XmlPersistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistence_Version(), this.getXmlVersion(), "version", null, 1, 1, XmlPersistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitEClass, XmlPersistenceUnit.class, "XmlPersistenceUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnit_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_Provider(), theXMLTypePackage.getString(), "provider", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_JtaDataSource(), theXMLTypePackage.getString(), "jtaDataSource", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_NonJtaDataSource(), theXMLTypePackage.getString(), "nonJtaDataSource", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_MappingFiles(), this.getXmlMappingFileRef(), null, "mappingFiles", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_JarFiles(), theXMLTypePackage.getString(), "jarFiles", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_Classes(), this.getXmlJavaClassRef(), null, "classes", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_ExcludeUnlistedClasses(), theXMLTypePackage.getBoolean(), "excludeUnlistedClasses", "false", 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_Properties(), this.getXmlProperties(), null, "properties", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_TransactionType(), this.getXmlPersistenceUnitTransactionType(), "transactionType", "JTA", 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappingFileRefEClass, XmlMappingFileRef.class, "XmlMappingFileRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMappingFileRef_FileName(), theEcorePackage.getEString(), "fileName", "", 0, 1, XmlMappingFileRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
-
- initEClass(xmlJavaClassRefEClass, XmlJavaClassRef.class, "XmlJavaClassRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJavaClassRef_JavaClass(), theEcorePackage.getEString(), "javaClass", null, 0, 1, XmlJavaClassRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
-
- initEClass(xmlPropertiesEClass, XmlProperties.class, "XmlProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlProperties_Properties(), this.getXmlProperty(), null, "properties", null, 0, -1, XmlProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertyEClass, XmlProperty.class, "XmlProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlProperty_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlProperty_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.class, "XmlPersistenceUnitTransactionType");
- addEEnumLiteral(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.JTA);
- addEEnumLiteral(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- // Initialize data types
- initEDataType(xmlPersistenceUnitTransactionTypeObjectEDataType, Enumerator.class, "XmlPersistenceUnitTransactionTypeObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
- initEDataType(xmlVersionEDataType, String.class, "XmlVersion", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
-
- // Create resource
- createResource(eNS_URI);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @generated
- */
- public static final EClass XML_PERSISTENCE = eINSTANCE.getXmlPersistence();
-
- /**
- * The meta object literal for the '<em><b>Persistence Units</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE__PERSISTENCE_UNITS = eINSTANCE.getXmlPersistence_PersistenceUnits();
-
- /**
- * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE__VERSION = eINSTANCE.getXmlPersistence_Version();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT = eINSTANCE.getXmlPersistenceUnit();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__DESCRIPTION = eINSTANCE.getXmlPersistenceUnit_Description();
-
- /**
- * The meta object literal for the '<em><b>Provider</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__PROVIDER = eINSTANCE.getXmlPersistenceUnit_Provider();
-
- /**
- * The meta object literal for the '<em><b>Jta Data Source</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE = eINSTANCE.getXmlPersistenceUnit_JtaDataSource();
-
- /**
- * The meta object literal for the '<em><b>Non Jta Data Source</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = eINSTANCE.getXmlPersistenceUnit_NonJtaDataSource();
-
- /**
- * The meta object literal for the '<em><b>Mapping Files</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__MAPPING_FILES = eINSTANCE.getXmlPersistenceUnit_MappingFiles();
-
- /**
- * The meta object literal for the '<em><b>Jar Files</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__JAR_FILES = eINSTANCE.getXmlPersistenceUnit_JarFiles();
-
- /**
- * The meta object literal for the '<em><b>Classes</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__CLASSES = eINSTANCE.getXmlPersistenceUnit_Classes();
-
- /**
- * The meta object literal for the '<em><b>Exclude Unlisted Classes</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = eINSTANCE.getXmlPersistenceUnit_ExcludeUnlistedClasses();
-
- /**
- * The meta object literal for the '<em><b>Properties</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__PROPERTIES = eINSTANCE.getXmlPersistenceUnit_Properties();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__NAME = eINSTANCE.getXmlPersistenceUnit_Name();
-
- /**
- * The meta object literal for the '<em><b>Transaction Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__TRANSACTION_TYPE = eINSTANCE.getXmlPersistenceUnit_TransactionType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @generated
- */
- public static final EClass XML_MAPPING_FILE_REF = eINSTANCE.getXmlMappingFileRef();
-
- /**
- * The meta object literal for the '<em><b>File Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPING_FILE_REF__FILE_NAME = eINSTANCE.getXmlMappingFileRef_FileName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @generated
- */
- public static final EClass XML_JAVA_CLASS_REF = eINSTANCE.getXmlJavaClassRef();
-
- /**
- * The meta object literal for the '<em><b>Java Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JAVA_CLASS_REF__JAVA_CLASS = eINSTANCE.getXmlJavaClassRef_JavaClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @generated
- */
- public static final EClass XML_PROPERTIES = eINSTANCE.getXmlProperties();
-
- /**
- * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PROPERTIES__PROPERTIES = eINSTANCE.getXmlProperties_Properties();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty()
- * @generated
- */
- public static final EClass XML_PROPERTY = eINSTANCE.getXmlProperty();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__NAME = eINSTANCE.getXmlProperty_Name();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__VALUE = eINSTANCE.getXmlProperty_Value();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @generated
- */
- public static final EEnum XML_PERSISTENCE_UNIT_TRANSACTION_TYPE = eINSTANCE.getXmlPersistenceUnitTransactionType();
-
- /**
- * The meta object literal for the '<em>Xml Persistence Unit Transaction Type Object</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.common.util.Enumerator
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionTypeObject()
- * @generated
- */
- public static final EDataType XML_PERSISTENCE_UNIT_TRANSACTION_TYPE_OBJECT = eINSTANCE.getXmlPersistenceUnitTransactionTypeObject();
-
- /**
- * The meta object literal for the '<em>Xml Version</em>' data type.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see java.lang.String
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlVersion()
- * @generated
- */
- public static final EDataType XML_VERSION = eINSTANCE.getXmlVersion();
-
- }
-
-} //PersistencePackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java
deleted file mode 100644
index e8e5450eda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResource.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jpt.core.internal.resource.persistence.translators.PersistenceTranslator;
-import org.eclipse.jpt.core.resource.common.JpaXmlResource;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class PersistenceResource extends JpaXmlResource
-{
- public PersistenceResource(Renderer aRenderer) {
- super(aRenderer);
- }
-
- public PersistenceResource(URI uri, Renderer aRenderer) {
- super(uri, aRenderer);
- }
-
- public Translator getRootTranslator() {
- return PersistenceTranslator.INSTANCE;
- }
-
- @Override
- public void javaElementChanged(ElementChangedEvent event) {
- // TODO Auto-generated method stub
- }
-
- public XmlPersistence getPersistence() {
- return (XmlPersistence) getRootObject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java
deleted file mode 100644
index 58b34972d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class PersistenceResourceFactory extends TranslatorResourceFactory
-{
- public PersistenceResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public PersistenceResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public PersistenceResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new PersistenceResource(uri, renderer);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceModel.java
deleted file mode 100644
index 7cfe62a3ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceResourceModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.resource.common.JpaXmlResourceModel;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class PersistenceResourceModel extends JpaXmlResourceModel
-{
- public PersistenceResourceModel(IFile file) {
- super(file);
- }
-
-
- /**
- * @see ResourceModel#getResourceType()
- */
- public String getResourceType() {
- return ResourceModel.PERSISTENCE_RESOURCE_TYPE;
- }
-
- @Override
- protected PersistenceArtifactEdit buildArtifactEdit(IProject project) {
- return PersistenceArtifactEdit.getArtifactEditForRead(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java
deleted file mode 100644
index 531528d3f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Java Class Ref</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlJavaClassRef extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJavaClass()
- * @generated
- * @ordered
- */
- protected static final String JAVA_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJavaClass()
- * @generated
- * @ordered
- */
- protected String javaClass = JAVA_CLASS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJavaClassRef()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_JAVA_CLASS_REF;
- }
-
- /**
- * Returns the value of the '<em><b>Java Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Java Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Java Class</em>' attribute.
- * @see #setJavaClass(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef_JavaClass()
- * @model unique="false" ordered="false"
- * @generated
- */
- public String getJavaClass()
- {
- return javaClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Java Class</em>' attribute.
- * @see #getJavaClass()
- * @generated
- */
- public void setJavaClass(String newJavaClass)
- {
- String oldJavaClass = javaClass;
- javaClass = newJavaClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS, oldJavaClass, javaClass));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- return getJavaClass();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- setJavaClass((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- setJavaClass(JAVA_CLASS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- return JAVA_CLASS_EDEFAULT == null ? javaClass != null : !JAVA_CLASS_EDEFAULT.equals(javaClass);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (javaClass: ");
- result.append(javaClass);
- result.append(')');
- return result.toString();
- }
-
-} // XmlJavaClassRef
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java
deleted file mode 100644
index 557b9b76ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Mapping File Ref</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlMappingFileRef extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected static final String FILE_NAME_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected String fileName = FILE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappingFileRef()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_MAPPING_FILE_REF;
- }
-
- /**
- * Returns the value of the '<em><b>File Name</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>File Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>File Name</em>' attribute.
- * @see #setFileName(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef_FileName()
- * @model default="" unique="false" ordered="false"
- * @generated
- */
- public String getFileName()
- {
- return fileName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>File Name</em>' attribute.
- * @see #getFileName()
- * @generated
- */
- public void setFileName(String newFileName)
- {
- String oldFileName = fileName;
- fileName = newFileName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME, oldFileName, fileName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- return getFileName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- setFileName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- setFileName(FILE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- return FILE_NAME_EDEFAULT == null ? fileName != null : !FILE_NAME_EDEFAULT.equals(fileName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (fileName: ");
- result.append(fileName);
- result.append(')');
- return result.toString();
- }
-
-} // XmlMappingFileRef
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java
deleted file mode 100644
index 4d4a0af657..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getPersistenceUnits <em>Persistence Units</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getVersion <em>Version</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistence extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getPersistenceUnits() <em>Persistence Units</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnits()
- * @generated
- * @ordered
- */
- protected EList<XmlPersistenceUnit> persistenceUnits;
-
- /**
- * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected static final String VERSION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected String version = VERSION_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistence()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PERSISTENCE;
- }
-
- /**
- * Returns the value of the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Version</em>' attribute.
- * @see #setVersion(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence_Version()
- * @model unique="false" dataType="org.eclipse.jpt.core.resource.persistence.XmlVersion" required="true"
- * @generated
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #getVersion()
- * @generated
- */
- public void setVersion(String newVersion)
- {
- String oldVersion = version;
- version = newVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE__VERSION, oldVersion, version));
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Units</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Units</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Persistence Units</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence_PersistenceUnits()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPersistenceUnit> getPersistenceUnits()
- {
- if (persistenceUnits == null)
- {
- persistenceUnits = new EObjectContainmentEList<XmlPersistenceUnit>(XmlPersistenceUnit.class, this, PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS);
- }
- return persistenceUnits;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return ((InternalEList<?>)getPersistenceUnits()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return getPersistenceUnits();
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- return getVersion();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- getPersistenceUnits().clear();
- getPersistenceUnits().addAll((Collection<? extends XmlPersistenceUnit>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- setVersion((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- getPersistenceUnits().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- setVersion(VERSION_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return persistenceUnits != null && !persistenceUnits.isEmpty();
- case PersistencePackage.XML_PERSISTENCE__VERSION:
- return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
- }
- return super.eIsSet(featureID);
- }
-
-
- // **************** overrides **********************************************
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (version: ");
- result.append(version);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public JpaEObject root() {
- return this;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java
deleted file mode 100644
index c084103e60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java
+++ /dev/null
@@ -1,955 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Unit</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles <em>Mapping Files</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles <em>Jar Files</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses <em>Classes</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlPersistenceUnit extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getProvider() <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProvider()
- * @generated
- * @ordered
- */
- protected static final String PROVIDER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getProvider() <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProvider()
- * @generated
- * @ordered
- */
- protected String provider = PROVIDER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJtaDataSource()
- * @generated
- * @ordered
- */
- protected static final String JTA_DATA_SOURCE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJtaDataSource()
- * @generated
- * @ordered
- */
- protected String jtaDataSource = JTA_DATA_SOURCE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonJtaDataSource()
- * @generated
- * @ordered
- */
- protected static final String NON_JTA_DATA_SOURCE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonJtaDataSource()
- * @generated
- * @ordered
- */
- protected String nonJtaDataSource = NON_JTA_DATA_SOURCE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMappingFiles() <em>Mapping Files</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappingFiles()
- * @generated
- * @ordered
- */
- protected EList<XmlMappingFileRef> mappingFiles;
-
- /**
- * The cached value of the '{@link #getJarFiles() <em>Jar Files</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJarFiles()
- * @generated
- * @ordered
- */
- protected EList<String> jarFiles;
-
- /**
- * The cached value of the '{@link #getClasses() <em>Classes</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClasses()
- * @generated
- * @ordered
- */
- protected EList<XmlJavaClassRef> classes;
-
- /**
- * The default value of the '{@link #isExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeUnlistedClasses()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_UNLISTED_CLASSES_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeUnlistedClasses()
- * @generated
- * @ordered
- */
- protected boolean excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT;
-
- /**
- * This is true if the Exclude Unlisted Classes attribute has been set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean excludeUnlistedClassesESet;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected XmlProperties properties;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlPersistenceUnitTransactionType TRANSACTION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTransactionType() <em>Transaction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransactionType()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitTransactionType transactionType = TRANSACTION_TYPE_EDEFAULT;
-
- /**
- * This is true if the Transaction Type attribute has been set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- protected boolean transactionTypeESet;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnit()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PERSISTENCE_UNIT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Name()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Transaction Type</b></em>' attribute.
- * The default value is <code>"JTA"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transaction Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Transaction Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see #isSetTransactionType()
- * @see #unsetTransactionType()
- * @see #setTransactionType(XmlPersistenceUnitTransactionType)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_TransactionType()
- * @model default="JTA" unique="false" unsettable="true"
- * @generated
- */
- public XmlPersistenceUnitTransactionType getTransactionType()
- {
- return transactionType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Transaction Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see #isSetTransactionType()
- * @see #unsetTransactionType()
- * @see #getTransactionType()
- * @generated
- */
- public void setTransactionType(XmlPersistenceUnitTransactionType newTransactionType)
- {
- XmlPersistenceUnitTransactionType oldTransactionType = transactionType;
- transactionType = newTransactionType == null ? TRANSACTION_TYPE_EDEFAULT : newTransactionType;
- boolean oldTransactionTypeESet = transactionTypeESet;
- transactionTypeESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, transactionType, !oldTransactionTypeESet));
- }
-
- /**
- * Unsets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetTransactionType()
- * @see #getTransactionType()
- * @see #setTransactionType(XmlPersistenceUnitTransactionType)
- * @generated
- */
- public void unsetTransactionType()
- {
- XmlPersistenceUnitTransactionType oldTransactionType = transactionType;
- boolean oldTransactionTypeESet = transactionTypeESet;
- transactionType = TRANSACTION_TYPE_EDEFAULT;
- transactionTypeESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, TRANSACTION_TYPE_EDEFAULT, oldTransactionTypeESet));
- }
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute is set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return whether the value of the '<em>Transaction Type</em>' attribute is set.
- * @see #unsetTransactionType()
- * @see #getTransactionType()
- * @see #setTransactionType(XmlPersistenceUnitTransactionType)
- * @generated
- */
- public boolean isSetTransactionType()
- {
- return transactionTypeESet;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Description()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Provider</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Provider</em>' attribute.
- * @see #setProvider(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Provider()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getProvider()
- {
- return provider;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Provider</em>' attribute.
- * @see #getProvider()
- * @generated
- */
- public void setProvider(String newProvider)
- {
- String oldProvider = provider;
- provider = newProvider;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER, oldProvider, provider));
- }
-
- /**
- * Returns the value of the '<em><b>Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jta Data Source</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jta Data Source</em>' attribute.
- * @see #setJtaDataSource(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_JtaDataSource()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getJtaDataSource()
- {
- return jtaDataSource;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jta Data Source</em>' attribute.
- * @see #getJtaDataSource()
- * @generated
- */
- public void setJtaDataSource(String newJtaDataSource)
- {
- String oldJtaDataSource = jtaDataSource;
- jtaDataSource = newJtaDataSource;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE, oldJtaDataSource, jtaDataSource));
- }
-
- /**
- * Returns the value of the '<em><b>Non Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Jta Data Source</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Jta Data Source</em>' attribute.
- * @see #setNonJtaDataSource(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_NonJtaDataSource()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getNonJtaDataSource()
- {
- return nonJtaDataSource;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Jta Data Source</em>' attribute.
- * @see #getNonJtaDataSource()
- * @generated
- */
- public void setNonJtaDataSource(String newNonJtaDataSource)
- {
- String oldNonJtaDataSource = nonJtaDataSource;
- nonJtaDataSource = newNonJtaDataSource;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE, oldNonJtaDataSource, nonJtaDataSource));
- }
-
- /**
- * Returns the value of the '<em><b>Mapping Files</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapping Files</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapping Files</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_MappingFiles()
- * @model containment="true"
- * @generated
- */
- public EList<XmlMappingFileRef> getMappingFiles()
- {
- if (mappingFiles == null)
- {
- mappingFiles = new EObjectContainmentEList<XmlMappingFileRef>(XmlMappingFileRef.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES);
- }
- return mappingFiles;
- }
-
- /**
- * Returns the value of the '<em><b>Jar Files</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jar Files</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jar Files</em>' attribute list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_JarFiles()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getJarFiles()
- {
- if (jarFiles == null)
- {
- jarFiles = new EDataTypeEList<String>(String.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES);
- }
- return jarFiles;
- }
-
- /**
- * Returns the value of the '<em><b>Classes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Classes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Classes</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Classes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJavaClassRef> getClasses()
- {
- if (classes == null)
- {
- classes = new EObjectContainmentEList<XmlJavaClassRef>(XmlJavaClassRef.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES);
- }
- return classes;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Unlisted Classes</b></em>' attribute.
- * The default value is <code>"false"</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Unlisted Classes</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Unlisted Classes</em>' attribute.
- * @see #isSetExcludeUnlistedClasses()
- * @see #unsetExcludeUnlistedClasses()
- * @see #setExcludeUnlistedClasses(boolean)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_ExcludeUnlistedClasses()
- * @model default="false" unique="false" unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeUnlistedClasses()
- {
- return excludeUnlistedClasses;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Unlisted Classes</em>' attribute.
- * @see #isSetExcludeUnlistedClasses()
- * @see #unsetExcludeUnlistedClasses()
- * @see #isExcludeUnlistedClasses()
- * @generated
- */
- public void setExcludeUnlistedClasses(boolean newExcludeUnlistedClasses)
- {
- boolean oldExcludeUnlistedClasses = excludeUnlistedClasses;
- excludeUnlistedClasses = newExcludeUnlistedClasses;
- boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet;
- excludeUnlistedClassesESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, excludeUnlistedClasses, !oldExcludeUnlistedClassesESet));
- }
-
- /**
- * Unsets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isSetExcludeUnlistedClasses()
- * @see #isExcludeUnlistedClasses()
- * @see #setExcludeUnlistedClasses(boolean)
- * @generated
- */
- public void unsetExcludeUnlistedClasses()
- {
- boolean oldExcludeUnlistedClasses = excludeUnlistedClasses;
- boolean oldExcludeUnlistedClassesESet = excludeUnlistedClassesESet;
- excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT;
- excludeUnlistedClassesESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, EXCLUDE_UNLISTED_CLASSES_EDEFAULT, oldExcludeUnlistedClassesESet));
- }
-
- /**
- * Returns whether the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#isExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute is set.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return whether the value of the '<em>Exclude Unlisted Classes</em>' attribute is set.
- * @see #unsetExcludeUnlistedClasses()
- * @see #isExcludeUnlistedClasses()
- * @see #setExcludeUnlistedClasses(boolean)
- * @generated
- */
- public boolean isSetExcludeUnlistedClasses()
- {
- return excludeUnlistedClassesESet;
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlProperties</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference.
- * @see #setProperties(XmlProperties)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Properties()
- * @model containment="true"
- * @generated
- */
- public XmlProperties getProperties()
- {
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetProperties(XmlProperties newProperties, NotificationChain msgs)
- {
- XmlProperties oldProperties = properties;
- properties = newProperties;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, oldProperties, newProperties);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Properties</em>' containment reference.
- * @see #getProperties()
- * @generated
- */
- public void setProperties(XmlProperties newProperties)
- {
- if (newProperties != properties)
- {
- NotificationChain msgs = null;
- if (properties != null)
- msgs = ((InternalEObject)properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, null, msgs);
- if (newProperties != null)
- msgs = ((InternalEObject)newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, null, msgs);
- msgs = basicSetProperties(newProperties, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, newProperties, newProperties));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return ((InternalEList<?>)getMappingFiles()).basicRemove(otherEnd, msgs);
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return ((InternalEList<?>)getClasses()).basicRemove(otherEnd, msgs);
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return basicSetProperties(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- return getDescription();
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- return getProvider();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- return getJtaDataSource();
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- return getNonJtaDataSource();
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return getMappingFiles();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- return getJarFiles();
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return getClasses();
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- return isExcludeUnlistedClasses() ? Boolean.TRUE : Boolean.FALSE;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return getProperties();
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- return getName();
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- return getTransactionType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- setProvider((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- setJtaDataSource((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- setNonJtaDataSource((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- getMappingFiles().clear();
- getMappingFiles().addAll((Collection<? extends XmlMappingFileRef>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- getJarFiles().clear();
- getJarFiles().addAll((Collection<? extends String>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- getClasses().clear();
- getClasses().addAll((Collection<? extends XmlJavaClassRef>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- setExcludeUnlistedClasses(((Boolean)newValue).booleanValue());
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- setProperties((XmlProperties)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- setName((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- setTransactionType((XmlPersistenceUnitTransactionType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- setProvider(PROVIDER_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- setJtaDataSource(JTA_DATA_SOURCE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- setNonJtaDataSource(NON_JTA_DATA_SOURCE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- getMappingFiles().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- getJarFiles().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- getClasses().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- unsetExcludeUnlistedClasses();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- setProperties((XmlProperties)null);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- unsetTransactionType();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- return PROVIDER_EDEFAULT == null ? provider != null : !PROVIDER_EDEFAULT.equals(provider);
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- return JTA_DATA_SOURCE_EDEFAULT == null ? jtaDataSource != null : !JTA_DATA_SOURCE_EDEFAULT.equals(jtaDataSource);
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- return NON_JTA_DATA_SOURCE_EDEFAULT == null ? nonJtaDataSource != null : !NON_JTA_DATA_SOURCE_EDEFAULT.equals(nonJtaDataSource);
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return mappingFiles != null && !mappingFiles.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- return jarFiles != null && !jarFiles.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return classes != null && !classes.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- return isSetExcludeUnlistedClasses();
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return properties != null;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- return isSetTransactionType();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (description: ");
- result.append(description);
- result.append(", provider: ");
- result.append(provider);
- result.append(", jtaDataSource: ");
- result.append(jtaDataSource);
- result.append(", nonJtaDataSource: ");
- result.append(nonJtaDataSource);
- result.append(", jarFiles: ");
- result.append(jarFiles);
- result.append(", excludeUnlistedClasses: ");
- if (excludeUnlistedClassesESet) result.append(excludeUnlistedClasses); else result.append("<unset>");
- result.append(", name: ");
- result.append(name);
- result.append(", transactionType: ");
- if (transactionTypeESet) result.append(transactionType); else result.append("<unset>");
- result.append(')');
- return result.toString();
- }
-
-} // XmlPersistenceUnit
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java
deleted file mode 100644
index bbebb80f44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Unit Transaction Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @model
- * @generated
- */
-public enum XmlPersistenceUnitTransactionType implements Enumerator
-{
- /**
- * The '<em><b>JTA</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JTA_VALUE
- * @generated
- * @ordered
- */
- JTA(0, "JTA", "JTA"),
-
- /**
- * The '<em><b>RESOURCE LOCAL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #RESOURCE_LOCAL_VALUE
- * @generated
- * @ordered
- */
- RESOURCE_LOCAL(1, "RESOURCE_LOCAL", "RESOURCE_LOCAL");
-
- /**
- * The '<em><b>JTA</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JTA</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JTA
- * @model
- * @generated
- * @ordered
- */
- public static final int JTA_VALUE = 0;
-
- /**
- * The '<em><b>RESOURCE LOCAL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>RESOURCE LOCAL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #RESOURCE_LOCAL
- * @model
- * @generated
- * @ordered
- */
- public static final int RESOURCE_LOCAL_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Xml Persistence Unit Transaction Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlPersistenceUnitTransactionType[] VALUES_ARRAY =
- new XmlPersistenceUnitTransactionType[]
- {
- JTA,
- RESOURCE_LOCAL,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Persistence Unit Transaction Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlPersistenceUnitTransactionType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitTransactionType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitTransactionType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType get(int value)
- {
- switch (value)
- {
- case JTA_VALUE: return JTA;
- case RESOURCE_LOCAL_VALUE: return RESOURCE_LOCAL;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlPersistenceUnitTransactionType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlPersistenceUnitTransactionType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java
deleted file mode 100644
index e0906944e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlProperties</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlProperties#getProperties <em>Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlProperties extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlProperties()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PROPERTIES;
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlProperties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, PersistencePackage.XML_PROPERTIES__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- return getProperties();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-} // XmlProperties
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java
deleted file mode 100644
index 89ea3f4ebb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.resource.persistence;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.common.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlProperty</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlProperty extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlProperty()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PROPERTY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty_Name()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PROPERTY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty_Value()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- public void setValue(String newValue)
- {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PROPERTY__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- return getName();
- case PersistencePackage.XML_PROPERTY__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- setName((String)newValue);
- return;
- case PersistencePackage.XML_PROPERTY__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case PersistencePackage.XML_PROPERTY__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case PersistencePackage.XML_PROPERTY__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
-
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuilder result = new StringBuilder(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(')');
- return result.toString();
- }
-
-} // XmlProperty
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 a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-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 8fa7db1fac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:22 EST 2008
-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 1d9a3c313c..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.1.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 eae38da018..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, 2008 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.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() {
-
- @Override
- 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;
- 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();
- }
-
- 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 a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-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 84ebb5c739..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:02 EST 2008
-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 ca9921015d..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.1.1.qualifier
-Bundle-Activator: org.eclipse.jpt.db.internal.JptDbPlugin
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jpt.db.internal;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui"
-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 9b1e787d66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Catalog.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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);
- }
-
- public Database database() {
- return this.database;
- }
-
- // ***** 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 2f8bbd222c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Column.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.dbdefinition.PredefinedDataTypeDefinition;
-import org.eclipse.datatools.modelbase.sql.datatypes.DataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType;
-import org.eclipse.jpt.utility.internal.ClassTools;
-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);
-
- private static final JavaType UTIL_DATE_JAVA_TYPE = new JavaType(java.util.Date.class);
- private static final JavaType SQL_DATE_JAVA_TYPE = new JavaType(java.sql.Date.class);
- private static final JavaType SQL_TIME_JAVA_TYPE = new JavaType(java.sql.Time.class);
- private static final JavaType SQL_TIMESTAMP_JAVA_TYPE = new JavaType(java.sql.Timestamp.class);
-
- private static final JavaType BIG_DECIMAL_JAVA_TYPE = new JavaType(java.math.BigDecimal.class);
- private static final JavaType LONG_JAVA_TYPE = new JavaType(long.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 and suitable for use as a
- * primary key field.
- */
- public String primaryKeyJavaTypeDeclaration() {
- return this.primaryKeyJavaType().declaration();
- }
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- public JavaType primaryKeyJavaType() {
- return this.jpaSpecCompliantPrimaryKeyJavaType(this.javaType());
- }
-
- /**
- * The JPA spec [2.1.4] says only the following types are allowed in
- * primary key fields:
- * [variable] primitives
- * [variable] primitive wrappers
- * java.lang.String
- * java.util.Date
- * java.sql.Date
- */
- private JavaType jpaSpecCompliantPrimaryKeyJavaType(JavaType javaType) {
- if (javaType.isVariablePrimitive()
- || javaType.isVariablePrimitiveWrapper()
- || javaType.equals(STRING_JAVA_TYPE)
- || javaType.equals(UTIL_DATE_JAVA_TYPE)
- || javaType.equals(SQL_DATE_JAVA_TYPE)) {
- return javaType;
- }
- if (javaType.equals(BIG_DECIMAL_JAVA_TYPE)) {
- return LONG_JAVA_TYPE; // ??
- }
- if (javaType.equals(SQL_TIME_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- if (javaType.equals(SQL_TIMESTAMP_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- // all the other typical types are pretty much un-mappable - return String(?)
- return STRING_JAVA_TYPE;
- }
-
- /**
- * 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(this.javaType((PredefinedDataType) dataType))
- :
- DEFAULT_JAVA_TYPE;
- }
-
- private JavaType javaType(PredefinedDataType dataType) {
- // this is just a bit hacky: moving from a type declaration to a class name to a type declaration...
- String dtpJavaClassName = this.predefinedDataTypeDefinition(dataType).getJavaClassName();
- return new JavaType(ClassTools.classNameForTypeDeclaration(dtpJavaClassName));
- }
-
- private PredefinedDataTypeDefinition predefinedDataTypeDefinition(PredefinedDataType dataType) {
- return this.database().dtpDefinition().getPredefinedDataTypeDefinition(dataType.getName());
- }
-
- /**
- * 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;
- }
-
- public Database database() {
- return this.table.database();
- }
-
- // ********** 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 514acc58ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Connection.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.internal;
-
-import java.text.Collator;
-
-
-/**
- * Connection wrapper base class.
- */
-abstract class Connection extends DTPWrapper implements Comparable<Connection> {
-
- // ********** constructors **********
-
- /**
- * Create a wrapper for the given IManagedConnection.
- */
- static Connection createConnection( DTPConnectionProfileWrapper profile) {
- return ( profile == null) ? NullConnection.instance() : new DTPConnectionWrapper( profile);
- }
-
- Connection() {
- super();
- }
-
- // ********** listeners **********
-
- abstract void addConnectionListener( ConnectionListener listener);
-
- 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 **********
-
- abstract String getFactoryId();
-
-
- // ********** 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 1b331aef81..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( ConnectionProfile profile);
- public void modified( ConnectionProfile profile);
- public boolean okToClose( ConnectionProfile profile);
- public void aboutToClose( ConnectionProfile profile);
- public void closed( ConnectionProfile profile);
-
- public void databaseChanged( ConnectionProfile profile, Database database);
- public void schemaChanged( ConnectionProfile profile, Schema schema);
- public void tableChanged( ConnectionProfile profile, 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 6a161341dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfile.java
+++ /dev/null
@@ -1,276 +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.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-
-/**
- * ConnectionProfile wrapper base class.
- */
-public abstract class ConnectionProfile extends DTPWrapper implements Comparable<ConnectionProfile> {
-
- 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 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();
- }
-
- @Override
- protected void dispose() {
- this.disengageConnectionListener();
-
- this.disposeDatabase();
- }
-
- private void disposeDatabase() {
- if( this.database != null) {
- this.getDatabase().dispose();
- this.database = null;
- }
- }
-
- /**
- * Saves the state of the connection profile for working in an offline mode.
- * If the connection profile does not support working in an offline mode, no
- * exception is thrown and the method will return immediately.
- */
- public abstract IStatus saveWorkOfflineData();
-
- public abstract IStatus workOffline();
-
- abstract boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile);
-
-
- // ********** queries **********
-
- 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();
-
- /**
- * protected, use defaultSchema() : Schema instead
- */
- protected abstract String getDefaultSchemaName();
-
- public abstract String getInstanceId();
-
- public abstract String getProviderId();
-
- public abstract String getDriverDefinitionId();
-
- public abstract String getDriverJarList();
-
- public abstract boolean isConnected();
-
- public abstract boolean isWorkingOffline();
-
- /**
- * @return true if connection factories associated with this
- * connection profile's provider support working offline.
- */
- public abstract boolean supportsWorkOfflineMode();
-
- /**
- * @return true if this connection profile supports working offline and data
- * has been saved for working offline.
- */
- public abstract boolean canWorkOffline();
-
- /**
- * Return the default Schema for this connection. Can be null.
- */
- public Schema defaultSchema() {
- return getDatabase().schemaNamed(getDefaultSchemaName());
- }
-
- @Override
- protected boolean connectionIsOnline() {
-
- return this.isConnected() && ( ! this.isWorkingOffline());
- }
-
- 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(ConnectionProfile profile) {
- // not interested to this event.
- }
-
- public void closed(ConnectionProfile profile) {
- ConnectionProfile.this.refreshDatabase();
- }
-
- public void modified(ConnectionProfile profile) {
- // not interested to this event.
- return;
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- // not interested to this event.
- return true;
- }
-
- public void opened(ConnectionProfile profile) {
- ConnectionProfile.this.refreshDatabase();
- }
-
- public void databaseChanged(ConnectionProfile profile, final Database db) {
- // not interested to this event.
- return;
- }
-
- public void schemaChanged(ConnectionProfile profile, final Schema schema) {
- // not interested to this event.
- return;
- }
-
- public void tableChanged(ConnectionProfile profile, 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 117816e148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ConnectionProfileRepository.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-
-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.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * ConnectionProfileRepository is a mediator to the DTP ProfileManager.
- */
-public class ConnectionProfileRepository {
- private final ProfileManager dtpProfileManager;
-
- private LocalProfileListener profileListener;
-
- // lazily-initialized
- private Set<ConnectionProfile> profiles;
-
- public static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$
-
- // ********** singleton **********
-
- private static final ConnectionProfileRepository INSTANCE = new ConnectionProfileRepository();
-
- public static ConnectionProfileRepository instance() {
- return INSTANCE;
- }
-
- // ********** constructor **********
-
- private ConnectionProfileRepository() {
- super();
- this.dtpProfileManager = ProfileManager.getInstance();
- }
-
- // ********** behavior **********
-
- public void start() {
- if( this.profileListener == null) {
- this.profileListener = new LocalProfileListener();
- this.dtpProfileManager.addProfileListener( this.profileListener);
- }
- }
-
- public void stop() {
- for( Iterator<ConnectionProfile> stream = this.profiles(); stream.hasNext(); ) {
- stream.next().dispose();
- }
- if( this.profileListener != null) {
- this.dtpProfileManager.removeProfileListener( this.profileListener);
- this.profileListener = null;
- }
- }
-
- @Override
- public String toString() {
- return this.profiles.toString();
- }
-
- // ********** profiles **********
-
- public Iterator<ConnectionProfile> profiles() {
- return new CloneIterator<ConnectionProfile>(this.getProfiles()); // read-only
- }
-
- public Iterator<String> profileNames() {
- return new TransformationIterator<ConnectionProfile, String>( this.profiles()) {
- @Override
- protected String transform( ConnectionProfile profile) {
- return profile.getName();
- }
- };
- }
-
- /**
- * Never return null.
- */
- 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 = Collections.synchronizedSet(new HashSet<ConnectionProfile>( dtpProfiles.length));
- for (IConnectionProfile dtpProfile : dtpProfiles) {
- result.add( ConnectionProfile.createProfile( this, dtpProfile));
- }
- return result;
- }
-
- ConnectionProfile addProfile( IConnectionProfile dtpProfile) {
- ConnectionProfile cp = this.profile(dtpProfile);
- if (cp.isNull()) {
- cp = ConnectionProfile.createProfile(ConnectionProfileRepository.this, dtpProfile);
- this.profiles.add(cp);
- }
- return cp;
- }
-
- ConnectionProfile removeProfile( IConnectionProfile dtpProfile) {
- ConnectionProfile cp = this.profile(dtpProfile);
- this.profiles.remove(cp);
- return cp;
- }
-
- /**
- * Never return null.
- */
- ConnectionProfile profile( IConnectionProfile dtpProfile) {
- for( Iterator<ConnectionProfile> stream = this.profiles(); stream.hasNext(); ) {
- ConnectionProfile profile = stream.next();
- if( profile.wraps( dtpProfile)) {
- return profile;
- }
- }
- return NullConnectionProfile.instance();
- }
-
- // ********** 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 **********
- /**
- * Keep the repository in synch with the DTP profile manager
- * and forward events to the repository's listeners.
- */
- private class LocalProfileListener implements IProfileListener {
- private Vector<ProfileListener> listeners = new Vector<ProfileListener>();
-
- LocalProfileListener() {
- super();
- }
-
- void addProfileListener( ProfileListener listener) {
- this.listeners.add( listener);
- }
-
- void removeProfileListener( ProfileListener listener) {
- this.listeners.remove( listener);
- }
-
- private Iterator<ProfileListener> listeners() {
- return new CloneIterator<ProfileListener>(this.listeners);
- }
-
- // ********** IProfileListener implementation **********
-
- public void profileAdded( IConnectionProfile dtpProfile) {
- // synch the repository then notify listeners
- ConnectionProfile profile = ConnectionProfileRepository.this.addProfile(dtpProfile);
- for (Iterator<ProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().profileReplaced(NullConnectionProfile.instance(), profile);
- }
- }
-
- public void profileChanged( IConnectionProfile dtpProfile) {
- ConnectionProfile profile = ConnectionProfileRepository.this.profile(dtpProfile);
- for (Iterator<ProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().profileChanged(profile);
- }
- }
-
- public void profileDeleted( IConnectionProfile dtpProfile) {
- // synch the repository then notify listeners
- ConnectionProfile profile = ConnectionProfileRepository.this.removeProfile(dtpProfile);
- for (Iterator<ProfileListener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().profileReplaced(profile, NullConnectionProfile.instance());
- }
- }
-
- }
-
-}
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 637290d231..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,323 +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.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo;
-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;
-
- private Connection connection; // Lazy initialized
-
- public static final String LIVE_CONNECTION_TYPE = "java.sql.Connection"; //$NON-NLS-1$
- public static final String OFFLINE_CONNECTION_TYPE = "org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo"; //$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$
-
- public static final String POSTGRESQL_VENDOR = "postgres"; //$NON-NLS-1$
-
- public static final String PUBLIC_SCHEMA = "public"; //$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 **********
-
- IManagedConnection getDTPConnection() {
- return this.dtpConnectionProfile.getManagedConnection( LIVE_CONNECTION_TYPE);
- }
-
- IManagedConnection getDTPOfflineConnection() {
- return this.dtpConnectionProfile.getManagedConnection( OFFLINE_CONNECTION_TYPE);
- }
-
- /**
- * Connect using this profile.
- */
- @Override
- public void connect() {
- if( ! this.connectionIsOnline()) {
-
- 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
- protected void dispose() {
- super.dispose();
-
- this.disposeConnection();
- }
-
- private void disposeConnection() {
- if( this.getConnection() != null) {
- this.getConnection().dispose();
- }
- }
-
- @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);
- }
-
- protected Connection buildConnection() {
-
- return Connection.createConnection( this);
- }
-
- @Override
- protected Database buildDatabase() {
- org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
- if( this.isConnected()) {
- if( this.isWorkingOffline()) {
- ConnectionInfo connectionInfo = ( ConnectionInfo) this.getDTPOfflineConnection().getConnection().getRawConnection();
- dtpDatabase = connectionInfo.getSharedDatabase();
- }
- else {
- //TODO see DTP bug 202306
- //pass connect=true in to ProfileUtil.getDatabase()
- //there is a bug mentioned in a comment:
- // "during the profile connected event notification,
- // IManagedConnection is connected while IConnectionProfile is not"
- //so some hackery here for their hackery
- dtpDatabase = ProfileUtil.getDatabase( new DatabaseIdentifier( this.getName(), this.getDatabaseName()), true);
- }
- return Database.createDatabase( this, dtpDatabase);
- }
- return NullDatabase.instance();
- }
-
- @Override
- public IStatus saveWorkOfflineData() {
- return this.dtpConnectionProfile.saveWorkOfflineData();
- }
-
- @Override
- public IStatus workOffline() {
- return this.dtpConnectionProfile.workOffline();
- }
-
- @Override
- boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return this.dtpConnectionProfile == dtpProfile;
- }
-
-
- // ********** queries **********
-
- @Override
- public boolean isConnected() {
- return this.getDTPConnection().isConnected() || this.isWorkingOffline();
- }
-
- @Override
- public boolean isWorkingOffline() {
- return this.getDTPOfflineConnection().isWorkingOffline();
- }
-
- @Override
- public boolean supportsWorkOfflineMode() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode();
- }
-
- @Override
- public boolean canWorkOffline() {
- return this.dtpConnectionProfile.canWorkOffline();
- }
-
- @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 getDefaultSchemaName() {
- if( this.getDatabase().getVendor().equalsIgnoreCase( POSTGRESQL_VENDOR)) {
- return PUBLIC_SCHEMA;
- }
- return this.getUserName();
- }
-
- @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();
- }
-
- @Override
- public String getDriverDefinitionId() {
- return this.getProperties().getProperty( DTPConnectionProfileWrapper.DRIVER_DEFINITION_PROP_ID);
- }
-
- @Override
- public String getDriverJarList() {
- return DriverManager.getInstance().getDriverInstanceByID( this.getDriverDefinitionId()).getJarList();
- }
-
- private Properties getProperties() {
- return this.dtpConnectionProfile.getBaseProperties();
- }
-
- private Connection getConnection() {
-
- if( this.connection == null) {
- this.connection = this.buildConnection();
- this.engageConnectionListener();
- }
- return this.connection;
- }
-}
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 c9e4673716..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionWrapper.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.datatools.connectivity.ConnectEvent;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.IManagedConnectionOfflineListener;
-
-/**
- * Wraps to two DTP connections (1 for live connection & 1 for offline).
- * The connections are not cached any more, but obtained each time from the ConnectionProfile.
- */
-final class DTPConnectionWrapper extends Connection {
-
- final DTPConnectionProfileWrapper profile;
- private LocalConnectionListener connectionListener;
-
- // ********** constructors **********
-
- DTPConnectionWrapper( DTPConnectionProfileWrapper profile) {
- super();
- this.profile = profile;
- this.initialize();
- }
-
- // ********** behavior **********
-
- protected void initialize() {
- this.connectionListener = new LocalConnectionListener();
- this.getDTPConnection().addConnectionListener( this.connectionListener);
- this.getDTPOfflineConnection().addConnectionListener( this.connectionListener);
- }
-
- @Override
- protected void dispose() {
- this.getDTPConnection().removeConnectionListener( this.connectionListener);
- this.getDTPOfflineConnection().removeConnectionListener( this.connectionListener);
- }
-
- @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);
- }
-
- // ********** queries **********
-
- IManagedConnection getDTPConnection() {
-
- return this.profile.getDTPConnection();
- }
-
- IManagedConnection getDTPOfflineConnection() {
-
- return this.profile.getDTPOfflineConnection();
- }
-
- @Override
- public String getName() {
-
- return this.getDTPConnection().getConnection().getConnectionProfile().getName();
- }
-
- @Override
- String getFactoryId() {
-
- return this.getDTPConnection().getFactoryID();
- }
-
- @Override
- protected boolean connectionIsOnline() {
- return this.profile.connectionIsOnline();
- }
-
- // ********** listeners **********
-
- @Override
- void addConnectionListener( ConnectionListener listener) {
- // hook up the specified listener to our intermediate listeners
- this.connectionListener.addConnectionListener( listener);
- }
-
- @Override
- void removeConnectionListener( ConnectionListener listener) {
-
- this.connectionListener.removeConnectionListener( listener);
- }
-
- // ********** member classes **********
-
- /**
- * This listener translates and forwards IManagedConnectionListener events to ConnectionListeners.
- */
- private class LocalConnectionListener implements IManagedConnectionOfflineListener {
- 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) {
- if( event.getConnection() == DTPConnectionWrapper.this.getDTPConnection()) {
- for (ConnectionListener listener : this.listeners) {
- listener.aboutToClose( DTPConnectionWrapper.this.profile);
- }
- }
- }
-
- public void aboutToDetach( ConnectEvent event) {
- if( event.getConnection() == DTPConnectionWrapper.this.getDTPOfflineConnection()) {
- for (ConnectionListener listener : this.listeners) {
- listener.aboutToClose( DTPConnectionWrapper.this.profile);
- }
- }
- }
-
- public void closed( ConnectEvent event) {
- // There is no DETACHED event, therefore closed is sent twice (i.e. by both connections)
- for (ConnectionListener listener : this.listeners) {
- listener.closed( DTPConnectionWrapper.this.profile);
- }
- }
-
- public boolean okToClose( ConnectEvent event) {
- if( event.getConnection() == DTPConnectionWrapper.this.getDTPConnection()) {
- for (ConnectionListener listener : this.listeners) {
- if( !listener.okToClose( DTPConnectionWrapper.this.profile)) {
- return false;
- }
- }
- }
- return true;
- }
-
- public boolean okToDetach( ConnectEvent event) {
- if( event.getConnection() == DTPConnectionWrapper.this.getDTPOfflineConnection()) {
- for (ConnectionListener listener : this.listeners) {
- if( !listener.okToClose( DTPConnectionWrapper.this.profile)) {
- return false;
- }
- }
- }
- return true;
- }
-
- public void opened( ConnectEvent event) {
- if( event.getConnection() == DTPConnectionWrapper.this.getDTPConnection()) {
- for (ConnectionListener listener : this.listeners) {
- listener.opened( DTPConnectionWrapper.this.profile);
- }
- }
- }
-
- public void workingOffline( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.opened( DTPConnectionWrapper.this.profile);
- }
- }
-
- public void aboutToAttach( ConnectEvent event) {
- // not interested to this event.
- return;
- }
-
- public void modified( ConnectEvent event) {
- for (ConnectionListener listener : this.listeners) {
- listener.modified( DTPConnectionWrapper.this.profile);
- }
- }
-
- void databaseChanged( Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.databaseChanged( DTPConnectionWrapper.this.profile, database);
- }
- }
-
- void schemaChanged( Schema schema, Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.schemaChanged( DTPConnectionWrapper.this.profile, schema);
- }
- }
-
- void tableChanged( Table table, Schema schema, Database database, int eventType) {
- for (ConnectionListener listener : this.listeners) {
- listener.tableChanged( DTPConnectionWrapper.this.profile, 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 017ce94d7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-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.connectionIsOnline();
- }
-
- 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();
- }
-
- @Override
- public DatabaseDefinition dtpDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.dtpDatabase);
- }
-
-
- // ***** 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
- }
- else if( dtpCatalog.getName().equals( this.getName())) {
- return this.getName(); // special catalog with same name as DB (PostgreSQL)
- }
- }
- 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 cf5211ebf2..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() {
- StringBuilder sb = new StringBuilder();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuilder 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 a4f9f2c14d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Database.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.text.Collator;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-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);
- }
-
- public Database database() {
- return this;
- }
-
- public abstract DatabaseDefinition dtpDefinition();
-
- // ********** 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 6493592884..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ForeignKey.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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, Column>(this.baseColumns()) {
- @Override
- protected boolean accept(Column o) {
- return ! ForeignKey.this.getBaseTable().primaryKeyColumnsContains(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());
- }
-
- public Database database() {
- return this.baseTable.database();
- }
-
-
- // ***** 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(this.getBaseTable().getName() + "." + this.getName() +
- " - 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 e677b24a4f..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.start();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- this.connectionProfileRepository.stop();
- 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 ce554dc2b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnection.java
+++ /dev/null
@@ -1,78 +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
- */
-final class NullConnection extends Connection {
-
- private static final NullConnection INSTANCE = new NullConnection();
-
- /**
- * singleton support
- */
- static synchronized Connection instance() {
- 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
- protected boolean connectionIsOnline() {
- return false;
- }
-
- @Override
- String getFactoryId() {
- return "";
- }
-
- @Override
- void addConnectionListener( ConnectionListener listener) {
- // do nothing
- }
-
- @Override
- 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 ba97c88f43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullConnectionProfile.java
+++ /dev/null
@@ -1,206 +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.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * NullConnectionProfile
- */
-public final class NullConnectionProfile extends ConnectionProfile {
-
- private static final NullConnectionProfile INSTANCE = new NullConnectionProfile();
-
- /**
- * singleton support
- */
- static synchronized ConnectionProfile instance() {
- return INSTANCE;
- }
-
- private NullConnectionProfile() {
- super( null);
- }
-
- // ********** behavior **********
-
- @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
- }
-
- @Override
- public IStatus saveWorkOfflineData() {
- return Status.CANCEL_STATUS;
- }
-
- @Override
- public IStatus workOffline() {
- return Status.CANCEL_STATUS;
- }
-
- @Override
- boolean wraps( org.eclipse.datatools.connectivity.IConnectionProfile dtpProfile) {
- return false;
- }
-
-
- // ********** queries **********
-
- @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 getDefaultSchemaName() {
- return "";
- }
-
- @Override
- public String getDriverClass() {
- return "";
- }
-
- @Override
- public String getUrl() {
- return "";
- }
-
- @Override
- public String getInstanceId() {
- return "";
- }
-
- @Override
- public String getProviderId() {
- return "";
- }
-
- @Override
- public String getDriverDefinitionId() {
- return "";
- }
-
- @Override
- public String getDriverJarList() {
- return "";
- }
-
- @Override
- public boolean isConnected() {
- return false;
- }
-
- @Override
- public boolean isWorkingOffline() {
- return false;
- }
-
- @Override
- public boolean supportsWorkOfflineMode() {
- return false;
- }
-
- @Override
- public boolean canWorkOffline() {
- 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 0ba22eb085..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/NullDatabase.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.internal;
-
-import java.util.Collections;
-import java.util.Set;
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * NullDatabase
- */
-public final class NullDatabase extends Database {
-
- private static final NullDatabase INSTANCE = new NullDatabase();
-
- /**
- * singleton support
- */
- static synchronized Database instance() {
- 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 "";
- }
-
- @Override
- public DatabaseDefinition dtpDefinition() {
- return null;
- }
-
- // ***** 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 54ab9e3ce8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/ProfileListener.java
+++ /dev/null
@@ -1,32 +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 old profile has been replaced with the specified
- * new profile.
- */
- public void profileReplaced( ConnectionProfile oldProfile, ConnectionProfile newProfile);
-
- /**
- * 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 de19966414..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Schema.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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);
- }
-
- public Database database() {
- return this.database;
- }
-
-
- // ********** 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 28a096614b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Sequence.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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());
- }
-
- public Database database() {
- return this.schema.database();
- }
-
-}
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 8f7aaf732e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/Table.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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);
- }
-
- public Database database() {
- return this.schema.database();
- }
-
- // ***** 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 4babcd71a8..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.100.qualifier
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm b/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
deleted file mode 100644
index 9f54275f3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
+++ /dev/null
@@ -1,42 +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 = January 22, 2008 9:11:27 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="M5 - Release 2.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="sthref249" name="sthref249"></a>
-<h1>About this content</h1>
-<p>January, 2008</p>
-<a id="sthref250" name="sthref250"></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, 2008,&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/about.html b/jpa/plugins/org.eclipse.jpt.doc.user/about.html
deleted file mode 100644
index 8f21cb851d..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" />
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>About this content</title>
-<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 19b15972fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Understanding OR mappings</h1>
-<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, 2008,&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 5e4bb80c9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
+++ /dev/null
@@ -1,40 +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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Understanding Java persistence</h1>
-<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, 2008,&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 85e88852a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="M5 - Release 2.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>
-<h1>Concepts</h1>
-<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>
-<p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p>
-</li>
-<li>
-<p><a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a></p>
-</li>
-<li>
-<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>
-<p>Eclipse Dali project: <code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code></p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform project: <code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code></p>
-</li>
-<li>
-<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, 2008,&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 feeab298eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
+++ /dev/null
@@ -1,42 +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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Understanding EJB 3.0 Java Persistence API</h1>
-<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, 2008,&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 0a476bf97e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1><a id="sthref46" name="sthref46"></a>The persistence.xml file</h1>
-<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, 2008,&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 aedebedd4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1><a id="sthref47" name="sthref47"></a>The orm.xml file</h1>
-<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, 2008,&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 fe52e9587f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
+++ /dev/null
@@ -1,12 +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="Content-Type" content="text/html; charset=us-ascii" />
-<!-- <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 38c23890b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
+++ /dev/null
@@ -1,49 +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 = January 22, 2008 9:11:13 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="M5 - Release 2.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>
-<h1>Getting started</h1>
-<p>This section provides information on getting started with the Java Persistence Tools.</p>
-<ul>
-<li>
-<p><a href="getting_started001.htm#BABEFHCD">Requirements and installation</a></p>
-</li>
-<li>
-<p><a href="getting_started002.htm#BABIGCJA">Dali quick start</a></p>
-</li>
-<li>
-<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:</p>
-<p><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, 2008,&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 6fc26942f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.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 = January 22, 2008 9:11:13 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Requirements and installation<a id="sthref3" name="sthref3"></a><a id="sthref4" name="sthref4"></a></h1>
-<p>Before installing Dali, ensure that your environment meets the following <span class="italic">minimum</span> requirements:</p>
-<ul>
-<li>
-<p>Eclipse 3.3 (<code><a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a></code>)</p>
-</li>
-<li>
-<p>Java Runtime Environment (JRE) 1.5 (<code><a href="http://java.com">http://java.com</a></code>)</p>
-</li>
-<li>
-<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>
-<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>Dali is included as part of WTP 2.0. No additional installation or configuration is required.</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, 2008,&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 12ffcf66d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.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 = January 22, 2008 9:11:13 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Dali quick start</h1>
-<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>
-<p><a href="getting_started003.htm#BABDFHDA">Creating a new project</a></p>
-</li>
-<li>
-<p><a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity</a></p>
-</li>
-<li>
-<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 />
-<!-- 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, 2008,&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 e262521a1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.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 = January 22, 2008 9:11:13 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new project" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Creating a new project</h1>
-<p><a id="sthref6" name="sthref6"></a>This quick start shows how to create a new JPA project.</p>
-<ol 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 New JPA 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">New 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="" 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 (or select <span class="bold">Generic</span>), 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, 2008,&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 9a656a07cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,105 +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 = January 22, 2008 9:11:13 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a Java persistent entity" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Creating a Java persistent entity</h1>
-<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 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 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">JPA Details</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="" 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, 2008,&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 f47329420c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started005.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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Mapping an entity</h1>
-<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 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>
-<p>For the Map As field, select <span class="bold">Id</span></p>
-</li>
-<li>
-<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, 2008,&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 108183ead1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started006.htm
+++ /dev/null
@@ -1,42 +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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali basic tutorial" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Dali basic tutorial<a id="sthref21" name="sthref21"></a></h1>
-<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, 2008,&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 7ea0a10ce9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started007.htm
+++ /dev/null
@@ -1,209 +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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate the tutorial database schema" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Generate the tutorial database schema</h1>
-<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, 2008,&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 7911855d31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started008.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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create a database connection" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create a database connection</h1>
-<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, 2008,&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 638b66f21b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started009.htm
+++ /dev/null
@@ -1,62 +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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create a JPA project" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create a JPA project</h1>
-<p>In order to begin, you must create a new Java project.</p>
-<ol 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, 2008,&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 245d3fd92d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started010.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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create persistent Java entities" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create persistent Java entities</h1>
-<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 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, 2008,&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 ed73212768..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started011.htm
+++ /dev/null
@@ -1,76 +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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Add fields to the entities" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Add fields to the entities</h1>
-<p>Before mapping the entities to the database, you must add the necessary fields to each entity.</p>
-<ol 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, 2008,&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 e3f5dd0731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started012.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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Associate the entity with a database table" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Associate the entity with a database table</h1>
-<p>Now you must associate each entity with its primary database table.</p>
-<ol 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, 2008,&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 ca0a624c1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started013.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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create OR mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create OR mappings</h1>
-<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>
-<p>ID mappings</p>
-</li>
-<li>
-<p>Basic mappings</p>
-</li>
-<li>
-<p>One-to-one mappings</p>
-</li>
-<li>
-<p>Many-to-one mappings</p>
-</li>
-<li>
-<p>One-to-many mappings</p>
-</li>
-<li>
-<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, 2008,&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 8f314b92f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started014.htm
+++ /dev/null
@@ -1,126 +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 = January 22, 2008 9:11:14 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create ID mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create ID mappings</h1>
-<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 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>
-<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>
-<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, 2008,&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 2565b9aae0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started015.htm
+++ /dev/null
@@ -1,127 +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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create basic mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create basic mappings</h1>
-<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 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>
-<p>Employee entity</p>
-<ul>
-<li>
-<p><span class="bold">lastName</span> field to L_NAME column</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Address Entity</p>
-<ul>
-<li>
-<p><span class="bold">city</span> field to CITY column</p>
-</li>
-<li>
-<p><span class="bold">country</span> field to COUNTRY column</p>
-</li>
-<li>
-<p><span class="bold">postalCode</span> field to P_CODE column</p>
-</li>
-<li>
-<p><span class="bold">stateOrProvice</span> field to PROVINCE column</p>
-</li>
-<li>
-<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="" 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>
-<p>Phone Entity</p>
-<ul>
-<li>
-<p><span class="bold">areaCode</span> field to AREA_CODE column</p>
-</li>
-<li>
-<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="" 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, 2008,&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 aa54d00a2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started016.htm
+++ /dev/null
@@ -1,83 +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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create one-to-one mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create one-to-one mappings</h1>
-<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 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>
-<p>Name: <span class="bold">ADDR_ID</span> (from the EMPLOYEE table)</p>
-</li>
-<li>
-<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, 2008,&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 0c21ecf069..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started017.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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create one-to-many mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create one-to-many mappings</h1>
-<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 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, 2008,&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 92918e88b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started018.htm
+++ /dev/null
@@ -1,83 +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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create many-to-one mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create many-to-one mappings</h1>
-<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 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>
-<p>Name: <span class="bold">EMP_ID</span> (from the PHONE table)</p>
-</li>
-<li>
-<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, 2008,&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 65de1a176d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started019.htm
+++ /dev/null
@@ -1,61 +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 = January 22, 2008 9:11:15 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create version mappings" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create version mappings</h1>
-<p>Use a <span class="bold">Version Mapping</span> to specify the database field used by a persistent entity for optimistic locking.</p>
-<ol 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, 2008,&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 81bcf317e0..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 53f4f73873..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,555 +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#sthref201" /></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#sthref211" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref220" /></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="reference007.htm#sthref217" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference008.htm#sthref219" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref206" /></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#sthref214" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref222" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref208" /></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="reference018.htm#sthref244" /></entry>
- </entry>
- <entry keyword="attribute overrides">
- <entry keyword="Attribute overrides"><topic href="reference004.htm#sthref189" /></entry>
- </entry>
- <entry keyword="Attribute Overrides - in Java Details view">
- <entry keyword="Attribute overrides"><topic href="reference004.htm#sthref191" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref200" /></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="reference007.htm#sthref216" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference008.htm#sthref218" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref202" /></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#sthref231" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref233" /></entry>
- </entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference018.htm#sthref243" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref204" /></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#sthref237" /></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="reference005.htm#sthref194" /></entry>
- </entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref210" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref212" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks019.htm#sthref163" /></entry>
- <entry keyword="Error messages"><topic href="tasks020.htm#sthref168" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference018.htm#sthref245" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref203" /></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#sthref236" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref221" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref223" /></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="reference006.htm#sthref197" /></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="reference006.htm#sthref196" /></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#sthref198" /></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#sthref239" /></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#sthref230" /></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#sthref225" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref205" /></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="tasks019.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#sthref215" /></entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref213" /></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="overrides - JPA attributes">
- <entry keyword="Attribute overrides"><topic href="reference004.htm#sthref190" /></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#sthref232" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref235" /></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#sthref227" /></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#sthref240" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - JPA Options"><topic href="ref_project_properties.htm#sthref229" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks019.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#sthref228" /></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#sthref234" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference005.htm#sthref192" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference005.htm#sthref195" /></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#sthref238" /></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="reference005.htm#sthref193" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <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="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#sthref199" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref224" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks019.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 4b8447dd92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
+++ /dev/null
@@ -1,39 +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 = January 22, 2008 9:11:27 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="M5 - Release 2.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="sthref247" name="sthref247"></a></p>
-<h1>Legal</h1>
-<p><a id="sthref248" name="sthref248"></a></p>
-<p class="subhead2">Notices</p>
-<p>The material in this guide is copyright &copy; 2006, 2008 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, 2008,&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 7846a38f3a..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="2.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 a7562a6199..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Details view (for orm.xml)</h1>
-<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>
-<p><a href="reference009.htm#CACCACGH">General information</a></p>
-</li>
-<li>
-<p><a href="reference010.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, 2008,&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 b30989730d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Facet page</h1>
-<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, 2008,&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 0755c715f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,225 +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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>General information</h1>
-<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-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-<th align="left" valign="bottom" id="r1c4-t7">Available for Mapping Type</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">Define the mapping type for the attribute</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">Basic</td>
-<td align="left" headers="r2c1-t7 r1c4-t7">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t7 r1c2-t7"><a id="sthref201" name="sthref201"></a><a id="sthref202" name="sthref202"></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-t7 r1c3-t7">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t7 r1c4-t7"><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-t7" headers="r1c1-t7">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r4c1-t7 r1c4-t7"><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-t7" headers="r1c1-t7">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r5c1-t7 r1c4-t7"><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-t7" headers="r1c1-t7">&nbsp;&nbsp;Insertable</td>
-<td align="left" headers="r6c1-t7 r1c2-t7">Specifies if the column is always included in <code>SQL INSERT</code> statements.</td>
-<td align="left" headers="r6c1-t7 r1c3-t7">True</td>
-<td align="left" headers="r6c1-t7 r1c4-t7"><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="r7c1-t7" headers="r1c1-t7">&nbsp;&nbsp;Updatable</td>
-<td align="left" headers="r7c1-t7 r1c2-t7">Specifies if this column is always included in <code>SQL UPDATE</code> statements.</td>
-<td align="left" headers="r7c1-t7 r1c3-t7">True</td>
-<td align="left" headers="r7c1-t7 r1c4-t7"><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="r8c1-t7" headers="r1c1-t7"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref203" name="sthref203"></a><a id="sthref204" name="sthref204"></a><a id="sthref205" name="sthref205"></a>Fetch Type</td>
-<td align="left" headers="r8c1-t7 r1c2-t7">Defines how data is loaded from the database:
-<ul>
-<li>
-<p>Eager &ndash; Data is loaded in before it is actually needed.</p>
-</li>
-<li>
-<p>Lazy &ndash; Data is loaded only when required by the transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r8c1-t7 r1c3-t7">Eager</td>
-<td align="left" headers="r8c1-t7 r1c4-t7"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks014.htm#BABFHBCJ">One-to-one 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="r9c1-t7" headers="r1c1-t7">Optional</td>
-<td align="left" headers="r9c1-t7 r1c2-t7">Specifies if this field is can be null.</td>
-<td align="left" headers="r9c1-t7 r1c3-t7">Yes</td>
-<td align="left" headers="r9c1-t7 r1c4-t7"><a href="tasks007.htm#BABBABCE">Basic mapping</a>, <a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t7" headers="r1c1-t7"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref206" name="sthref206"></a>Lob</td>
-<td align="left" headers="r10c1-t7 r1c2-t7">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="r10c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r10c1-t7 r1c4-t7"><a href="tasks007.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t7" headers="r1c1-t7"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a><a id="sthref209" name="sthref209"></a>Temporal</td>
-<td align="left" headers="r11c1-t7 r1c2-t7">Specifies if this field is one of the following:
-<ul>
-<li>
-<p>Date &ndash; <code>java.sql.Date</code></p>
-</li>
-<li>
-<p>Time &ndash; <code>java.sql.Time</code></p>
-</li>
-<li>
-<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="r11c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r11c1-t7 r1c4-t7"><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="r12c1-t7" headers="r1c1-t7"><a id="sthref210" name="sthref210"></a><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a>Enumerated</td>
-<td align="left" headers="r12c1-t7 r1c2-t7">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>
-<p>ordinal</p>
-</li>
-<li>
-<p><code>String</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Enumerated</code> annotation.</p>
-</td>
-<td align="left" headers="r12c1-t7 r1c3-t7">Ordinal</td>
-<td align="left" headers="r12c1-t7 r1c4-t7"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t7" headers="r1c1-t7">Target Entity</td>
-<td align="left" headers="r13c1-t7 r1c2-t7">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r13c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r13c1-t7 r1c4-t7"><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="r14c1-t7" headers="r1c1-t7"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r14c1-t7 r1c2-t7">Specify which operations are propagated throughout the entity.
-<ul>
-<li>
-<p>All &ndash; All operations</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Move</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-<li>
-<p>Refresh</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r14c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r14c1-t7 r1c4-t7"><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="r15c1-t7" headers="r1c1-t7"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r15c1-t7 r1c2-t7">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="r15c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r15c1-t7 r1c4-t7"><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="r16c1-t7" headers="r1c1-t7"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref213" name="sthref213"></a><a id="sthref214" name="sthref214"></a><a id="sthref215" name="sthref215"></a>Order By</td>
-<td align="left" headers="r16c1-t7 r1c2-t7">Specify the default order for objects returned from a query:
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom ordering</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@OrderBy</code> annotation.</p>
-</td>
-<td align="left" headers="r16c1-t7 r1c3-t7">Primary key</td>
-<td align="left" headers="r16c1-t7 r1c4-t7"><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="r17c1-t7" headers="r1c1-t7">Attribute Overrides</td>
-<td align="left" headers="r17c1-t7 r1c2-t7">Overrides <span class="bold">Basic</span> mappings of a mapped superclass (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="r17c1-t7 r1c3-t7"><br /></td>
-<td align="left" headers="r17c1-t7 r1c4-t7"><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, 2008,&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 3e14dd5c78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>New JPA Project page</h1>
-<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, 2008,&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 0fcbc25cba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Create New JPA Project wizard</h1>
-<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>
-<p><a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a></p>
-</li>
-<li>
-<p>Project Facets page</p>
-</li>
-<li>
-<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, 2008,&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 29a93ea067..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Details view (for attributes)</h1>
-<p><a id="sthref198" name="sthref198"></a><a id="sthref199" name="sthref199"></a><a id="sthref200" name="sthref200"></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>
-<p><a href="ref_mapping_general.htm#CACBHFIJ">General information</a></p>
-</li>
-<li>
-<p><a href="reference007.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li>
-<p><a href="reference008.htm#CACFCEJC">Join Columns Information</a></p>
-</li>
-<li>
-<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, 2008,&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 f7a2ba7be4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
+++ /dev/null
@@ -1,49 +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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Structure view</h1>
-<p><a id="sthref224" name="sthref224"></a><a id="sthref225" name="sthref225"></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="sthref226" name="sthref226"></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, 2008,&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 3fc721c93b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Development perspective</h1>
-<p><a id="sthref239" name="sthref239"></a><a id="sthref240" name="sthref240"></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>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-</ul>
-<div class="figure"><a id="sthref241" name="sthref241"></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, 2008,&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 ea1e809510..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>JPA Details view (for entities)</h1>
-<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>
-<p><a href="reference003.htm#CACCAGGC">General information</a></p>
-</li>
-<li>
-<p><a href="reference004.htm#CACIJBGH">Attribute overrides</a></p>
-</li>
-<li>
-<p><a href="reference005.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li>
-<p><a href="reference006.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, 2008,&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 40dc5ace0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
+++ /dev/null
@@ -1,138 +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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Primary Key Generation information</h1>
-<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-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"><a id="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t10 r1c2-t10"><a id="sthref220" name="sthref220"></a><a id="sthref221" name="sthref221"></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-t10 r1c3-t10">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t10 r1c2-t10">
-<ul>
-<li>Auto</li>
-<li>
-<p>Identity &ndash; Values are assigned by the database's <span class="bold">Identity</span> column.</p>
-</li>
-<li>
-<p>Sequence &ndash; Values are assigned by a sequence table (see <a href="#CACFFHEH">Sequence&nbsp;Generator</a>).</p>
-</li>
-<li>
-<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-t10 r1c3-t10">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Unique name of the generated value.</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"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">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-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t10 r1c2-t10">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t10 r1c2-t10">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t10 r1c2-t10">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t10 r1c2-t10">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t10 r1c2-t10">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t10" headers="r1c1-t10"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t10 r1c2-t10"><a id="sthref222" name="sthref222"></a><a id="sthref223" name="sthref223"></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-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t10 r1c2-t10">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t10 r1c3-t10"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t10 r1c2-t10">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-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="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, 2008,&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 da26f10ee3..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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page - JPA Options" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Project Properties page &ndash; JPA Options</h1>
-<p><a id="sthref227" name="sthref227"></a><a id="sthref228" name="sthref228"></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">JPA Details 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-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"><a id="sthref229" name="sthref229"></a><a id="sthref230" name="sthref230"></a><a id="sthref231" name="sthref231"></a><a id="sthref232" name="sthref232"></a>Platform</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13"><a id="sthref233" name="sthref233"></a><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a>Connection</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">The database connection used to map the persistent entities.
-<ul>
-<li>
-<p>To create a new connection, click <span class="bold">Add Connections</span>.</p>
-</li>
-<li>
-<p>To reconnect to an existing connection, click <span class="bold">Reconnect</span>.</p>
-</li>
-</ul>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13">Persistent Class Management</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">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>
-</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="tasks022.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, 2008,&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 d37da96333..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="M5 - Release 2.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>
-<h1>Reference</h1>
-<p>This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:</p>
-<ul>
-<li>
-<p><a href="reference001.htm#CACJJJJH">Wizards</a></p>
-</li>
-<li>
-<p><a href="reference002.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li>
-<p><a href="reference011.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li>
-<p><a href="reference012.htm#CACGEJDA">Dialogs</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p>
-</li>
-<li>
-<p><a href="reference014.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li>
-<p><a href="reference018.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, 2008,&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 0d1857383d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,42 +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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Wizards</h1>
-<p>This section includes information on the following wizards:</p>
-<ul>
-<li>
-<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, 2008,&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 9334100997..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Property pages</h1>
-<p>This section includes information on the following property pages:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-<li>
-<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, 2008,&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 6006dacdff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,97 +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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>General information</h1>
-<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 default database table information for this entity. These fields can be overridden by the information in the <a href="reference004.htm#CACIJBGH">Attribute overrides</a> area.</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">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">The name of the primary database table associated with the entity.</td>
-<td align="left" headers="r5c1-t4 r1c3-t4"><br /></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">&nbsp;&nbsp;Catalog</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">The database catalog 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">&nbsp;&nbsp;Schema</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r7c1-t4 r1c3-t4">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r7c1-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, 2008,&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 660c7a12c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
+++ /dev/null
@@ -1,75 +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 = January 22, 2008 9:11:22 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Attribute overrides</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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Attribute overrides" />
-<meta name="relnum" content="M5 - Release 2.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="CACIJBGH" name="CACIJBGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Attribute overrides</h1>
-<p><a id="sthref189" name="sthref189"></a><a id="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a>Use the <span class="gui-object-title">Attribute Overrides</span> area in the <span class="gui-object-title">Java Details</span> view to override the default settings specified in the <a href="reference003.htm#CACCAGGC">General information</a> area of an attribute.</p>
-<p>This table lists the Attribute override 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-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-<th align="left" valign="bottom" id="r1c4-t5">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">Attribute Overrides</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">Specify a property or field to be overridden (from the default mappings). Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r2c1-t5 r1c3-t5"><br /></td>
-<td align="left" headers="r2c1-t5 r1c4-t5"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">Join Columns</td>
-<td align="left" headers="r3c1-t5 r1c2-t5"><br /></td>
-<td align="left" headers="r3c1-t5 r1c3-t5"><br /></td>
-<td align="left" headers="r3c1-t5 r1c4-t5"><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="reference003.htm#CACCAGGC">General information</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, 2008,&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 2fa25bab90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,47 +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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Secondary table information</h1>
-<p><a id="sthref192" name="sthref192"></a><a id="sthref193" name="sthref193"></a><a id="sthref194" name="sthref194"></a><a id="sthref195" name="sthref195"></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, 2008,&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 751a291869..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,101 +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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Inheritance information</h1>
-<p><a id="sthref196" name="sthref196"></a><a id="sthref197" name="sthref197"></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-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">Strategy</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">Specify the strategy to use when mapping a class or class hierarchy:
-<ul>
-<li>
-<p>Single table &ndash; All classes in the hierarchy are mapped to a single table.</p>
-</li>
-<li>
-<p>Joined &ndash; The root of the hierarchy is mapped to a single table; each child maps to its own table.</p>
-</li>
-<li>
-<p>Table per class &ndash; Each class is mapped to a separate table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">Discriminator Column</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">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-t6 r1c3-t6"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">Discriminator Type</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">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-t6 r1c3-t6">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">Discriminator Value</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">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-t6 r1c3-t6"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t6" headers="r1c1-t6">Primary Key Join Columns</td>
-<td align="left" headers="r6c1-t6 r1c2-t6">Use to override the default primary key join columns. Select <span class="bold">Override Default</span>, then click <span class="bold">Add</span> to select new Join Column.
-<p>This field corresponds with @PrimaryKeyJoinColumn annotation.</p>
-</td>
-<td align="left" headers="r6c1-t6 r1c3-t6"><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, 2008,&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 cf188badfe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Join Table Information</h1>
-<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-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">Name</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8">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-t8" headers="r1c1-t8"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t8 r1c2-t8"><a id="sthref216" name="sthref216"></a><a id="sthref217" name="sthref217"></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-t8 r1c3-t8">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><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="reference013.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, 2008,&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 0f2aaa7b39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Join Columns Information</h1>
-<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-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">Join Column</td>
-<td align="left" headers="r2c1-t9 r1c2-t9"><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></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-t9 r1c3-t9">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="reference013.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, 2008,&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 940456b0ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.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 = January 22, 2008 9:11:23 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>General information</h1>
-<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-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">Package</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</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">Schema</td>
-<td align="left" headers="r3c1-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="r3c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">Catalog</td>
-<td align="left" headers="r4c1-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="r4c1-t11 r1c3-t11"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t11" headers="r1c1-t11">Access</td>
-<td align="left" headers="r5c1-t11 r1c2-t11">Specify the default access method for the variables in the project:
-<ul>
-<li>
-<p>Property</p>
-</li>
-<li>
-<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-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" -->
-<!-- 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, 2008,&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 dd165c0fae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Persistence Unit information</h1>
-<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-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">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t12 r1c2-t12">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-t12 r1c3-t12"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t12" headers="r1c1-t12">Schema</td>
-<td align="left" headers="r3c1-t12 r1c2-t12">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-t12 r1c3-t12"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t12" headers="r1c1-t12">Catalog</td>
-<td align="left" headers="r4c1-t12 r1c2-t12">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-t12 r1c3-t12"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t12" headers="r1c1-t12">Access Type</td>
-<td align="left" headers="r5c1-t12 r1c2-t12">Specify how the entity its access instance variables.
-<ul>
-<li>
-<p>Property &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p>Field &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t12 r1c3-t12">Property</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t12" headers="r1c1-t12">Cascade Persist</td>
-<td align="left" headers="r6c1-t12 r1c2-t12">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-t12 r1c3-t12"><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, 2008,&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/reference011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
deleted file mode 100644
index 68d80306b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
+++ /dev/null
@@ -1,42 +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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Preferences</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<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, 2008,&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 6c846072c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Dialogs</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="task_generate_entities.htm#CACDAFJD">Generate Entities from Tables dialog</a></p>
-</li>
-<li>
-<p><a href="reference013.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, 2008,&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/reference013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
deleted file mode 100644
index cfd6d11325..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Edit Join Columns Dialog</h1>
-<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-t15">Property</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">Name</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Referenced Column Name</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">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="reference007.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference008.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, 2008,&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/reference014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
deleted file mode 100644
index 4d1fa54092..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.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 = January 22, 2008 9:11:25 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Icons and buttons</h1>
-<p>This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.</p>
-<ul>
-<li>
-<p><a href="reference015.htm#CACGEACG">Icons</a></p>
-</li>
-<li>
-<p><a href="reference016.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, 2008,&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/reference015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
deleted file mode 100644
index d0eb37b75c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
+++ /dev/null
@@ -1,110 +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 = January 22, 2008 9:11:25 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Icons</h1>
-<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-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/icon_nonpersistent.png" alt="Nonpersistent class icon" title="Nonpersistent class icon" /><br /></td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Nonpersistent class</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16"><img src="img/icon_persistent.png" alt="Persistent entity icon" title="Persistent entity icon" /><br /></td>
-<td align="left" headers="r3c1-t16 r1c2-t16"><a href="tasks004.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16"><img src="img/icon_embeddable.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r4c1-t16 r1c2-t16"><a href="tasks005.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t16" headers="r1c1-t16"><img src="img/icon_superclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r5c1-t16 r1c2-t16"><a href="tasks006.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t16" headers="r1c1-t16"><img src="img/icon_basicmapping.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t16 r1c2-t16"><a href="tasks007.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t16" headers="r1c1-t16"><img src="img/icon_embeddedmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t16 r1c2-t16"><a href="tasks008.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t16" headers="r1c1-t16"><img src="img/icon_embeddedidmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t16 r1c2-t16"><a href="tasks009.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t16" headers="r1c1-t16"><img src="img/icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r9c1-t16 r1c2-t16"><a href="tasks010.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t16" headers="r1c1-t16"><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-t16 r1c2-t16"><a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t16" headers="r1c1-t16"><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-t16 r1c2-t16"><a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t16" headers="r1c1-t16"><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-t16 r1c2-t16"><a href="tasks013.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t16" headers="r1c1-t16"><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-t16 r1c2-t16"><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t16" headers="r1c1-t16"><img src="img/icon_transientmapping.png" alt="Transient mapping icon" title="Transient mapping icon" /><br /></td>
-<td align="left" headers="r14c1-t16 r1c2-t16"><a href="tasks015.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t16" headers="r1c1-t16"><img src="img/icon_versionmapping.png" alt="Version mapping icon" title="Version mapping icon" /><br /></td>
-<td align="left" headers="r15c1-t16 r1c2-t16"><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="reference014.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, 2008,&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 faa9ad66c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.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 = January 22, 2008 9:11:26 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Buttons</h1>
-<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-t17">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17"><img src="img/button_jpa_perspective.png" alt="Persistence Perspective button" title="Persistence Perspective button" /><br /></td>
-<td align="left" headers="r2c1-t17 r1c2-t17">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="reference014.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, 2008,&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 34fa0a3372..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,38 +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 = January 22, 2008 9:11:26 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="M5 - Release 2.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="sthref242" name="sthref242"></a>
-<h1>Javadoc</h1>
-<p>There is no public API for M5 - Release 2.0.0. Please refer to the <a href="reference018.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, 2008,&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/reference018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
deleted file mode 100644
index 637b315535..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.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 = January 22, 2008 9:11:26 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Dali Developer Documentation</h1>
-<p><a id="sthref243" name="sthref243"></a><a id="sthref244" name="sthref244"></a><a id="sthref245" name="sthref245"></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>
-<p>Dali architecture</p>
-</li>
-<li>
-<p>Plugins that comprise the Dali JPA Eclipse feature</p>
-</li>
-<li>
-<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, 2008,&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 805940a813..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Adding persistence to a class</h1>
-<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>
-<p><a href="tasks004.htm#BABGBIEE">Entity</a></p>
-</li>
-<li>
-<p><a href="tasks005.htm#BABFEICE">Embeddable</a></p>
-</li>
-<li>
-<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, 2008,&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 4f84c6f308..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
+++ /dev/null
@@ -1,70 +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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Specifying additional tables</h1>
-<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 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>
-<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, 2008,&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 c8a2d4eda2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,97 +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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref49" name="sthref49"></a><a id="sthref50" name="sthref50"></a>Use this procedure to create a new JPA project.</p>
-<ol 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="" 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, 2008,&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 d664749f89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_entities.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 = January 22, 2008 9:11:24 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Entities from Tables dialog" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Generate Entities from Tables dialog</h1>
-<p><a id="sthref236" name="sthref236"></a><a id="sthref237" name="sthref237"></a><a id="sthref238" name="sthref238"></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-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">Source Folder</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">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-t14" headers="r1c1-t14">Package</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">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-t14" headers="r1c1-t14">Synchronize Classes in persistence.xml</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">Specify if Dali should update the persistence.xml file to include the generated classes.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Tables</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">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, 2008,&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 7979aaefeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.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 = January 22, 2008 9:11:18 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Specifying entity inheritance</h1>
-<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 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>
-<p>A single table (default)</p>
-</li>
-<li>
-<p>Joined table</p>
-</li>
-<li>
-<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="reference006.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 illustrates a joined subclass inheritance strategy." title="This figure illustrates a joined subclass inheritance strategy." /><br /></div>
-<!-- class="figure" -->
-<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, 2008,&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 901e63a8e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
+++ /dev/null
@@ -1,62 +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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1><a id="sthref68" name="sthref68"></a>Managing the orm.xml file</h1>
-<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, 2008,&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 7b56cdcdfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,62 +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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1><a id="sthref57" name="sthref57"></a>Managing the persistence.xml file</h1>
-<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, 2008,&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 f54a24d855..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.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 = January 22, 2008 9:11:18 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Mapping an entity</h1>
-<p>Dali supports the following mapping types for Java persistent entities:</p>
-<ul>
-<li>
-<p><a href="tasks007.htm#BABBABCE">Basic mapping</a></p>
-</li>
-<li>
-<p><a href="tasks008.htm#BABCBHDF">Embedded mapping</a></p>
-</li>
-<li>
-<p><a href="tasks009.htm#CIHDIAEE">Embedded ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks010.htm#BABGCBHG">ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks011.htm#BABEIEGD">Many-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks012.htm#BABHFAFJ">Many-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks013.htm#BABHGEBD">One-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks014.htm#BABFHBCJ">One-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks015.htm#BABHFHEI">Transient mapping</a></p>
-</li>
-<li>
-<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, 2008,&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 570b91749b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="M5 - Release 2.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>
-<h1>Tasks</h1>
-<p>This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.</p>
-<ul>
-<li>
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p>
-</li>
-<li>
-<p><a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a></p>
-</li>
-<li>
-<p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p>
-</li>
-<li>
-<p><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></p>
-</li>
-<li>
-<p><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></p>
-</li>
-<li>
-<p><a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></p>
-</li>
-<li>
-<p><a href="tasks017.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li>
-<p><a href="tasks019.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li>
-<p><a href="tasks022.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, 2008,&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 a7afdfb802..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,61 +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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with persistence.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Working with persistence.xml file</h1>
-<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 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 XML Editor</p>
-<img src="img/open_persistence_editor.png" alt="This figure shows the Open &gt; XML Editor option for the persistence.xml file." title="This figure shows the Open &gt; 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">XML Editor</span> to edit the <code>persistence.xml</code> file.</p>
-<div class="figure"><a id="sthref64" name="sthref64"></a>
-<p class="titleinfigure">XML Editor</p>
-<img src="img/persistence_xml_editor.png" alt="This figure shows the XML Editor." title="This figure shows the 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, 2008,&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 2b6b3d1ebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
+++ /dev/null
@@ -1,61 +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 = January 22, 2008 9:11:16 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Synchronizing classes</h1>
-<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 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, 2008,&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 efd09ca9f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
+++ /dev/null
@@ -1,62 +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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Working with orm.xml file</h1>
-<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 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, 2008,&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 76cd30ae19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,75 +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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Entity</h1>
-<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>
-<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>
-<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 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, 2008,&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 290b2d244b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
+++ /dev/null
@@ -1,66 +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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Embeddable</h1>
-<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 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, 2008,&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 e621e4bc4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.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 = January 22, 2008 9:11:17 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Mapped superclass</h1>
-<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>
-<p>Abstract or concrete classes</p>
-</li>
-</ul>
-<p>A mapped superclass <span class="italic">cannot be</span>:</p>
-<ul>
-<li>
-<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
-</li>
-<li>
-<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 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, 2008,&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 2f4a6f9334..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,184 +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 = January 22, 2008 9:11:18 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Basic mapping</h1>
-<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>
-<p>Java primitive types and wrappers of the primitive types</p>
-</li>
-<li>
-<p><code>java.lang.String, java.math.BigInteger</code></p>
-</li>
-<li>
-<p><code>java.math.BigDecimal</code></p>
-</li>
-<li>
-<p><code>java.util.Date</code></p>
-</li>
-<li>
-<p><code>java.util.Calendar, java.sql.Date</code></p>
-</li>
-<li>
-<p><code>java.sql.Time</code></p>
-</li>
-<li>
-<p><code>java.sql.Timestamp</code></p>
-</li>
-<li>
-<p><code>byte[]</code></p>
-</li>
-<li>
-<p><code>Byte[]</code></p>
-</li>
-<li>
-<p><code>char[]</code></p>
-</li>
-<li>
-<p><code>Character[]</code></p>
-</li>
-<li>
-<p>enums</p>
-</li>
-<li>
-<p>any other type that implements <code>Serializable</code></p>
-</li>
-</ul>
-<p>To create a basic mapping:</p>
-<ol 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.</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>
-<p>Eager</p>
-</li>
-<li>
-<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>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<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, 2008,&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 918bb11fe2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,107 +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 = January 22, 2008 9:11:18 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Embedded mapping</h1>
-<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 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>
-<p>Name &ndash; Name of the database column.</p>
-</li>
-<li>
-<p>Table &ndash; Name of the database table.</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, 2008,&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 f0b6b54570..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
+++ /dev/null
@@ -1,87 +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 = January 22, 2008 9:11:18 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Embedded ID mapping</h1>
-<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 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, 2008,&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 8d0f6ca25c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.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 = January 22, 2008 9:11:19 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>ID mapping</h1>
-<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 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>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<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>
-<p>Auto</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Identity</p>
-</li>
-<li>
-<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, 2008,&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 a25b6a340a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,172 +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 = January 22, 2008 9:11:19 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Many-to-many mapping</h1>
-<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 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>
-<p>Eager</p>
-</li>
-<li>
-<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>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<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="reference007.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, 2008,&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 40418a43d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,127 +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 = January 22, 2008 9:11:19 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Many-to-one mapping</h1>
-<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 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>
-<p>Eager</p>
-</li>
-<li>
-<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="reference008.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, 2008,&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 761aacc13d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,162 +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 = January 22, 2008 9:11:19 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>One-to-many mapping</h1>
-<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 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>
-<p>Eager</p>
-</li>
-<li>
-<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>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<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="reference007.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, 2008,&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 838ea66af9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.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 = January 22, 2008 9:11:20 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>One-to-one mapping</h1>
-<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 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>
-<p>Eager</p>
-</li>
-<li>
-<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="reference008.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, 2008,&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 b04bd2817a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.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 = January 22, 2008 9:11:20 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Transient mapping</h1>
-<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 field of the entity class that <span class="italic">is not</span> persistent.</p>
-<p>To create a transient mapping:</p>
-<ol 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, 2008,&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 ee3eba0533..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,128 +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 = January 22, 2008 9:11:20 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Version mapping</h1>
-<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>
-<p><code>int</code></p>
-</li>
-<li>
-<p><code>Integer</code></p>
-</li>
-<li>
-<p><code>short, Short</code></p>
-</li>
-<li>
-<p><code>long, Long</code></p>
-</li>
-<li>
-<p><code>Timestamp</code></p>
-</li>
-</ul>
-<p>To create a version mapping:</p>
-<ol 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>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<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, 2008,&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 db2f5ec785..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,66 +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 = January 22, 2008 9:11:21 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Generating entities from tables</h1>
-<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 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 tables." title="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-<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></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, 2008,&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 29ecb4451c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
+++ /dev/null
@@ -1,40 +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 = January 22, 2008 9:11:21 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generating DDL from 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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating DDL from Entities" />
-<meta name="relnum" content="M5 - Release 2.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="CIHJIGBE" name="CIHJIGBE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating DDL from Entities</h1>
-<p>When using a vendor-specific platform, you can create a DDL script from your persistent entities.</p>
-<p><span class="italic">InformationPending</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, 2008,&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/tasks019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
deleted file mode 100644
index f9716c4513..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.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 = January 22, 2008 9:11:21 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="M5 - Release 2.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">
-<h1>Validating mappings and reporting problems</h1>
-<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>
-<p><a href="tasks020.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li>
-<p><a href="tasks021.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, 2008,&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/tasks020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
deleted file mode 100644
index 05114b838c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.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 = January 22, 2008 9:11:21 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Error messages<a id="sthref168" name="sthref168"></a></h1>
-<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 a sequence generator in the persistence unit. Either define the generator by using an annotation or including it in the XML mapping file.</p>
-<a id="sthref177" name="sthref177"></a>
-<p class="subhead2">No persistence unit defined.</p>
-<p>There is no persistence unit defined in the <code>persistence.xml</code> file. Use the &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>" tag to define the persistent unit.</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="reference007.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, 2008,&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 ebd6d3b7c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
+++ /dev/null
@@ -1,49 +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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Warning messages</h1>
-<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="tasks022.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, 2008,&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/tasks022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
deleted file mode 100644
index c2581bb73a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
+++ /dev/null
@@ -1,83 +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 = January 22, 2008 9:11:22 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="M5 - Release 2.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" -->
-<h1>Modifying persistent project properties</h1>
-<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 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, 2008,&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 5d56f4fad7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.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 = January 22, 2008 9:11:26 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="M5 - Release 2.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>
-<h1>Tips and tricks</h1>
-<p>The following tips and tricks give some helpful ideas for increasing your productivity.</p>
-<ul>
-<li>
-<p><a href="#BABFIIHA"><span class="bold">Database Connections</span></a></p>
-</li>
-<li>
-<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, 2008,&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 c3be9cc71b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- User Guide -->
- <toc 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#CIHJIGBE" label="Generating DDL from Entities" />
- <topic href="tasks019.htm#BABFAIBA" label="Validating mappings and reporting problems">
- <topic href="tasks020.htm#CIHFEDEI" label="Error messages" />
- <topic href="tasks021.htm#CIHGEAIJ" label="Warning messages" />
- </topic>
- <topic href="tasks022.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#CACIJBGH" label="Attribute overrides" />
- <topic href="reference005.htm#CACBHIDA" label="Secondary table information" />
- <topic href="reference006.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="reference007.htm#CACBAEBC" label="Join Table Information" />
- <topic href="reference008.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="reference009.htm#CACCACGH" label="General information" />
- <topic href="reference010.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="reference013.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="reference015.htm#CACGEACG" label="Icons" />
- <topic href="reference016.htm#CACDJCEI" label="Buttons" />
- </topic>
- <topic href="reference017.htm#sthref242" label="Javadoc" />
- <topic href="reference018.htm#CACBBDIB" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks" />
- <topic href="legal.htm" label=" Legal">
- <topic href="about.htm#sthref249" label="About this content" />
- </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 bd286dfe00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,40 +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 = January 22, 2008 9:11:26 -->
-<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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="M5 - Release 2.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="sthref246" name="sthref246"></a> What's new</p>
-<p>This section contains descriptions of the following new feature and significant changes made to the Dali OR Mapping Tool for M5 - Release 2.0.0:</p>
-<ul>
-<li>
-<p><a href="whats_new001.htm#CEGIDCCE">Generate DDL from Entities 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, 2008,&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 f469ab0e8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.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 = January 22, 2008 9:11:26 -->
-<meta name="OAC_IGNORE_SKIP_NAV" content="true" />
-<title>Generate DDL from Entities 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 (Mode = ohj/ohw) - Version 5.0" />
-<meta name="date" content="2005-07-10T12:57:20+08:00" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate DDL from Entities wizard" />
-<meta name="relnum" content="M5 - Release 2.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="CEGIDCCE" name="CEGIDCCE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generate DDL from Entities wizard</h1>
-<p>Use the <span class="gui-object-title">Generate DDL</span> wizard to quickly create DDL scripts from your persistent entities.</p>
-<p><span class="italic">InformationPending</span></p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks018.htm#CIHJIGBE">Generating DDL from Entities</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, 2008,&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 455826bdea..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" />
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create and Manage the persistence.xml file</title>
-<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 b75c0a95fb..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" />
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-<title>Create and Manage the orm.xml file</title>
-<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 a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
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 1f15ff2b4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:07 EST 2008
-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 2ffda1a396..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.1.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.utility,
- org.eclipse.jpt.db,
- org.eclipse.jpt.core
-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 1ffb911c0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/EntityGenerator.java
+++ /dev/null
@@ -1,1517 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.core.runtime.SubProgressMonitor;
-import org.eclipse.jdt.core.IJavaModelStatusConstants;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.resource.java.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;
- private final String pkClassName;
-
-
- // ********** 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;
- this.pkClassName = this.entityClassName + "PK"; // hack
- }
-
-
- // ********** code gen **********
-
- private void generateEntity() {
- int totalWork = pkClassIsGenerated() ? 40 : 20;
- try {
- this.monitor.beginTask("", totalWork);
- this.generateEntity_();
- } catch (JavaModelException ex) {
- throw new RuntimeException(ex);
- }
- finally {
- this.monitor.done();
- }
- }
-
- private void generateEntity_() throws JavaModelException {
- // build the body source first so we can gather up the import statements
- this.generateSourceFile(this.entityClassName, this.entityName() + ".java", this.buildSource(this.buildBodySource()));
- if (this.pkClassIsGenerated()) {
- this.generateSourceFile(this.pkClassName, this.pkName() + ".java", this.buildSource(this.buildPKBodySource()));
- }
-
- }
-
- private void generateSourceFile(String className, String fileName, String source) throws JavaModelException {
- try {
- this.packageFragment.createCompilationUnit(fileName, source, false, new SubProgressMonitor(this.monitor, 10));
- } catch (JavaModelException ex) {
- if (ex.getJavaModelStatus().getCode() == IJavaModelStatusConstants.NAME_COLLISION) {
- if (this.overwriteConfirmer.overwrite(className)) {
- this.packageFragment.createCompilationUnit(fileName, source, true, new SubProgressMonitor(this.monitor, 0));
- }
- } 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(BodySource bodySource) {
- StringWriter sw = new StringWriter(bodySource.length() + 1000);
- PrintWriter pw = new PrintWriter(sw);
- this.printPackageAndImportsOn(pw, bodySource);
- pw.print(bodySource.source());
- this.monitor.worked(10);
- return sw.toString();
- }
-
- private BodySource buildBodySource() {
- EntitySourceWriter pw = new EntitySourceWriter(this.packageName(), this.entityClassName);
- this.printBodySourceOn(pw);
- return pw;
- }
-
- private BodySource buildPKBodySource() {
- EntitySourceWriter pw = new EntitySourceWriter(this.packageName(), this.pkClassName);
- this.printPrimaryKeyClassOn(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);
- }
- 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.pkClassIsGenerated() && this.config.generateIdClassForCompoundPK()) {
- pw.printAnnotation(JPA.ID_CLASS);
- pw.print('(');
- pw.printTypeDeclaration(pkClassName);
- pw.print(".class)");
- pw.println();
- }
- }
-
- private void printEntityPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- if (this.pkClassIsGenerated() && 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.pkClassName);
- pw.print(' ');
- pw.print(this.genTable.fieldNameForEmbeddedId());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- private void printEntityReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printReadOnlyPrimaryKeyFieldsOn(pw, true); // true=print ID annotation on fields
- }
-
- private void printReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) {
- this.printReadOnlyPrimaryKeyFieldOn(stream.next(), pw, printIdAnnotation);
- }
- }
-
- // TODO if the field's type is java.util.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the field must be an integral type
- private void printReadOnlyPrimaryKeyFieldOn(Column column, EntitySourceWriter pw, boolean printIdAnnotation) {
- String fieldName = this.genTable.fieldNameFor(column);
- if (this.config.fieldAccessType()) {
- if (printIdAnnotation) {
- 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.primaryKeyJavaTypeDeclaration());
- 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) {
- this.printWritablePrimaryKeyFieldsOn(pw, true); // true=print ID annotation on fields
- }
-
- private void printWritablePrimaryKeyFieldsOn(EntitySourceWriter pw, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) {
- this.printWritablePrimaryKeyFieldOn(stream.next(), pw, printIdAnnotation);
- }
- }
-
- // TODO if the field's type is java.util.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the field must be an integral type
- private void printWritablePrimaryKeyFieldOn(Column column, EntitySourceWriter pw, boolean printIdAnnotation) {
- String fieldName = this.genTable.fieldNameFor(column);
- if (this.config.fieldAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- if ( ! column.matchesJavaFieldName(fieldName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
- pw.printVisibility(this.config.fieldVisibility());
- pw.printTypeDeclaration(column.primaryKeyJavaTypeDeclaration());
- 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.pkClassIsGenerated() && 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.pkClassName, this.config.methodVisibility());
- }
-
- private void printEntityReadOnlyPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- this.printReadOnlyPrimaryKeyGettersAndSettersOn(pw, true); // true=print ID annotation on fields
- }
-
- private void printReadOnlyPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.genTable.readOnlyPrimaryKeyColumns(); stream.hasNext(); ) {
- this.printReadOnlyPrimaryKeyGetterAndSetterOn(stream.next(), pw, printIdAnnotation);
- }
- }
-
- // TODO if the property's type is java.util.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the property must be an integral type
- private void printReadOnlyPrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw, boolean printIdAnnotation) {
- String propertyName = this.genTable.fieldNameFor(column);
- if (this.config.propertyAccessType()) {
- if (printIdAnnotation) {
- 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.primaryKeyJavaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printEntityWritablePrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- this.printWritablePrimaryKeyGettersAndSettersOn(pw, true); // true=print ID annotation on fields
- }
-
- private void printWritablePrimaryKeyGettersAndSettersOn(EntitySourceWriter pw, boolean printIdAnnotation) {
- for (Iterator<Column> stream = this.genTable.writablePrimaryKeyColumns(); stream.hasNext(); ) {
- this.printWritablePrimaryKeyGetterAndSetterOn(stream.next(), pw, printIdAnnotation);
- }
- }
-
- // TODO if the property's type is java.util.Date, it needs @Temporal(DATE)
- // TODO if the primary key is auto-generated, the property must be an integral type
- private void printWritablePrimaryKeyGetterAndSetterOn(Column column, EntitySourceWriter pw, boolean printIdAnnotation) {
- String propertyName = this.genTable.fieldNameFor(column);
- if (this.config.propertyAccessType()) {
- if (printIdAnnotation) {
- pw.printAnnotation(JPA.ID);
- pw.println();
- }
- if ( ! column.matchesJavaFieldName(propertyName)) {
- this.printColumnAnnotationOn(column.getName(), pw);
- }
- }
-
- pw.printGetterAndSetter(propertyName, column.primaryKeyJavaTypeDeclaration(), 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.config.generateEmbeddedIdForCompoundPK()) {
- pw.printAnnotation(JPA.EMBEDDABLE);
- pw.println();
- }
- pw.print("public class ");
- pw.printTypeDeclaration(this.pkClassName);
- pw.print(" implements ");
- pw.printTypeDeclaration(Serializable.class.getName());
- pw.print(" {");
- pw.println();
-
- pw.indent();
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyFieldsOn(pw);
- this.printEmbeddableWritablePrimaryKeyFieldsOn(pw);
- } else {
- this.printIdFieldsOn(pw);
- }
- this.printSerialVersionUID(pw);
- pw.println();
- this.printZeroArgumentConstructorOn(this.pkName(), "public", pw);
-
- if (this.config.propertyAccessType() || this.config.generateGettersAndSetters()) {
- if (this.config.generateEmbeddedIdForCompoundPK()) {
- this.printEmbeddableReadOnlyPrimaryKeyGettersAndSettersOn(pw);
- this.printEmbeddableWritablePrimaryKeyGettersAndSettersOn(pw);
- } else {
- this.printIdGettersAndSettersOn(pw);
- }
- }
-
- this.printPrimaryKeyEqualsMethodOn(this.pkName(), this.table().primaryKeyColumns(), pw);
- this.printPrimaryKeyHashCodeMethodOn(this.table().primaryKeyColumns(), pw);
- pw.undent();
-
- pw.print('}');
- pw.println();
- }
-
- private void printEmbeddableReadOnlyPrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printReadOnlyPrimaryKeyFieldsOn(pw, false); // false=do not print ID annotation on fields
- }
-
- private void printEmbeddableWritablePrimaryKeyFieldsOn(EntitySourceWriter pw) {
- this.printWritablePrimaryKeyFieldsOn(pw, false); // false=do not print ID annotation on fields
- }
-
- 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.primaryKeyJavaTypeDeclaration());
- pw.print(' ');
- pw.print(fieldName);
- pw.print(';');
- pw.println();
- }
-
- private void printEmbeddableReadOnlyPrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- this.printReadOnlyPrimaryKeyGettersAndSettersOn(pw, false); // false=do not print ID annotation on fields
- }
-
- private void printEmbeddableWritablePrimaryKeyGettersAndSettersOn(EntitySourceWriter pw) {
- this.printWritablePrimaryKeyGettersAndSettersOn(pw, false); // false=do not print ID annotation on fields
- }
-
- 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.primaryKeyJavaTypeDeclaration(), this.config.methodVisibility());
- }
-
- private void printPrimaryKeyEqualsMethodOn(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.printPrimaryKeyEqualsClauseOn(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 printPrimaryKeyEqualsClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- JavaType javaType = column.primaryKeyJavaType();
- 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 printPrimaryKeyHashCodeMethodOn(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.printPrimaryKeyHashCodeClauseOn(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 printPrimaryKeyHashCodeClauseOn(Column column, EntitySourceWriter pw) {
- String fieldName = this.genTable.fieldNameFor(column);
- JavaType javaType = column.primaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.elementTypeName(), 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();
- }
-
- private String pkName() {
- return this.entityName() + "PK"; // hack
- }
-
- private boolean pkClassIsGenerated() {
- return this.table().primaryKeyColumnsSize() > 1;
- }
-
-
- // ********** 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
- * class source code.
- */
- private static class EntitySourceWriter extends IndentingPrintWriter implements BodySource {
- final String packageName;
- final String className;
- // key = short class name; value = package name
- private final Map<String, String> imports = new HashMap<String, String>();
-
- EntitySourceWriter(String packageName, String className) {
- super(new StringWriter(20000));
- this.packageName = packageName;
- this.className = className;
- }
-
- 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.className.length())
- && typeDeclaration.startsWith(this.className)
- && (typeDeclaration.charAt(this.className.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>, Map.Entry<String, String>>(this.sortedImportEntries()) {
- @Override
- protected boolean accept(Map.Entry<String, String> next) {
- String pkg = 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 98a088bc6c..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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, GenTable>(this.tables()) {
- @Override
- protected boolean accept(GenTable next) {
- return ! 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, GenTable>(this.tables()) {
- @Override
- protected boolean accept(GenTable next) {
- return 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 f97f43bd7c..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column column) {
- return GenTable.this.foreignKeyColumnsContains(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, Column>(this.table.primaryKeyColumns()) {
- @Override
- protected boolean accept(Column column) {
- return ! GenTable.this.foreignKeyColumnsContains(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, Column>(this.table.columns()) {
- @Override
- protected boolean accept(Column column) {
- return ! (GenTable.this.primaryKeyColumnsContains(column)
- || GenTable.this.foreignKeyColumnsContains(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 a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.options b/jpa/plugins/org.eclipse.jpt.ui/.options
deleted file mode 100644
index 37e1229856..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.options
+++ /dev/null
@@ -1,14 +0,0 @@
-# Debugging options for org.eclipse.jpt.ui plug-in
-
-# Turn on debugging for the org.eclipse.jpt.ui plugin.
-org.eclipse.jpt.ui/debug=false
-
-# Turn on debugging for unit-tests
-org.eclipse.jpt.ui/debug/unit-tests=false
-
-# Turn on debugging for events occurring in the UI panes
-org.eclipse.jpt.ui/debug/ui/layout=false
-org.eclipse.jpt.ui/debug/ui/detailsView=false
-
-# Turn on debugging for events coming from ConnectionProfile
-org.eclipse.jpt.ui/debug/ui/db=false
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 2c6dda4a74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:14 EST 2008
-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 66d17318bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,66 +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: 2.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.ui.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,
- org.eclipse.ui.navigator
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jpt.ui,
- org.eclipse.jpt.ui.details,
- 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.java.details;x-internal:=true,
- org.eclipse.jpt.ui.internal.jface;x-internal:=true,
- org.eclipse.jpt.ui.internal.listeners;x-internal:=true,
- org.eclipse.jpt.ui.internal.mappings;x-internal:=true,
- org.eclipse.jpt.ui.internal.mappings.db;x-internal:=true,
- org.eclipse.jpt.ui.internal.mappings.details;x-internal:=true,
- org.eclipse.jpt.ui.internal.navigator;x-internal:=true,
- org.eclipse.jpt.ui.internal.orm;x-internal:=true,
- org.eclipse.jpt.ui.internal.orm.details;x-internal:=true,
- org.eclipse.jpt.ui.internal.perspective;x-internal:=true,
- org.eclipse.jpt.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.ui.internal.platform.base;x-internal:=true,
- org.eclipse.jpt.ui.internal.platform.generic;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.swt;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.views.structure;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.java.details
-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/jpa-content.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-content.gif
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-content.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gif b/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.gif
deleted file mode 100644
index b4e9f4724b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/icons/full/obj16/jpa-file.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 564291f6db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.properties
+++ /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
-###############################################################################
-
-# ====================================================================
-# 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"
-
-jpaNavigatorContent=JPA Content
-
-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 56083236e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/plugin.xml
+++ /dev/null
@@ -1,384 +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.JpaSelectionParticipant"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.ui.IEditorPart"
- class="org.eclipse.jpt.ui.internal.JpaFileAdapterFactory">
- <adapter type="org.eclipse.jpt.core.JpaFile"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.jpt.core.context.PersistentAttribute"
- class="org.eclipse.jpt.ui.internal.actions.PersistentAttributeActionFilter$Factory">
- <adapter
- type="org.eclipse.ui.IActionFilter"/>
- </factory>
-
- <factory
- adaptableType="org.eclipse.jpt.core.context.orm.OrmPersistentAttribute"
- class="org.eclipse.jpt.ui.internal.actions.OrmPersistentAttributeActionFilter$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.platform.generic.GenericPlatformUi"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.viewer">
-
- <viewerContentBinding
- viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.jpt.ui.*"/>
- </includes>
- </viewerContentBinding>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <navigatorContent
- id="org.eclipse.jpt.ui.jpaNavigatorContent"
- name="%jpaNavigatorContent"
- priority="higher"
- icon="icons/full/obj16/jpa-content.gif"
- activeByDefault="true"
- contentProvider="org.eclipse.jpt.ui.internal.navigator.JpaNavigatorContentProvider"
- labelProvider="org.eclipse.jpt.ui.internal.navigator.JpaNavigatorLabelProvider">
-
- <triggerPoints>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa" />
- </adapt>
- </and>
- </triggerPoints>
-
- <!--
-
- <possibleChildren>
- <or>
- <and>
- <instanceof value="org.eclipse.emf.ecore.EObject" />
- <or>
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.emfworkbench.integration.emfPackage"
- value="ejb.xmi" />
- </or>
- </and>
- <instanceof value="org.eclipse.jst.j2ee.internal.ejb.provider.J2EEJavaClassProviderHelper"/>
- <instanceof value="org.eclipse.jst.j2ee.internal.ejb.provider.GroupedEJBItemProvider"/>
- </or>
- <instanceof value="org.eclipse.jst.j2ee.navigator.internal.LoadingDDNode"/>
- </possibleChildren>
-
- <commonSorter
- id="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter"
- class="org.eclipse.jst.j2ee.navigator.internal.J2EEViewerSorter" />
-
- -->
-
- </navigatorContent>
-
- </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.context.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.ormPersistentTypeActions"
- objectClass="org.eclipse.jpt.core.context.orm.OrmPersistentType">
- <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.ormPersistentAttributeActions1"
- objectClass="org.eclipse.jpt.core.context.orm.OrmPersistentAttribute">
-
- <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.ormPersistentAttributeActions2"
- objectClass="org.eclipse.jpt.core.context.orm.OrmPersistentAttribute">
-
- <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.ormPersistentAttributeActions3"
- objectClass="org.eclipse.jpt.core.context.orm.OrmPersistentAttribute">
-
- <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.structure.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.JpaJavaCompletionProposalComputer"
- 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 29ac0bfada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties
+++ /dev/null
@@ -1,88 +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
-
-AddRemovePane_AddButtonText=Add...
-AddRemovePane_RemoveButtonText=Remove
-
-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>
-
-EnumComboViewer_default=Default ()
-EnumComboViewer_defaultWithDefault=Default ({0})
-
-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_structureNotAvailable=JPA structure is not available.
-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
-
-OrmItemLabelProviderFactory_entityMappingsLabel=Entity Mappings
-
-PersistenceItemLabelProviderFactory_persistenceLabel=Persistence
-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 db53478a40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_mappings.properties
+++ /dev/null
@@ -1,237 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the terms of
-# the Eclipse Public License v1.0, which accompanies this distribution and is available at
-# http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-Boolean_True=True
-Boolean_False=False
-NoneSelected=Default ()
-
-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_optionalLabelDefault=Optional ({0})
-BasicGeneralSection_lobLabel=Lob
-BasicGeneralSection_temporalLabel=Temporal:
-BasicGeneralSection_enumeratedLabel=Enumerated:
-
-DefaultBasicMappingUiProvider_Default=Default ({0})
-DefaultEmbeddedMappingUiProvider_Default=Default ({0})
-
-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...
-TargetEntityChooser_selectTypeTitle=Select Type
-
-NonOwningMapping_mappedByLabel=Mapped By:
-
-JoinTableComposite_add=Add...
-JoinTableComposite_defaultEmpty=Default ()
-JoinTableComposite_defaultWithOneParam=Default ({0})
-JoinTableComposite_edit=Edit...
-JoinTableComposite_inverseJoinColumn=Inverse Join Columns
-
-JoinColumnDialogPane_true=True
-JoinColumnDialogPane_false=False
-
-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
-
-JoinColumnDialog_addJoinColumnDescriptionTitle=Create New Join Column
-JoinColumnDialog_addJoinColumnTitle=Add Join Column
-JoinColumnDialog_description=Specify a mapped column for joining an entity association.
-JoinColumnDialog_defaultEmpty=Default ()
-JoinColumnDialog_defaultWithOneParam=Default ({0})
-JoinColumnDialog_editJoinColumnDescriptionTitle=Edit Join Column
-JoinColumnDialog_editJoinColumnTitle=Edit Join Column
-JoinColumnDialog_insertable=&Insertable
-JoinColumnDialog_insertableWithDefault=&Insertable
-JoinColumnDialog_name=&Name:
-JoinColumnDialog_referencedColumnName=&Referenced Column Name:
-JoinColumnDialog_table=&Table:
-JoinColumnDialog_updatable=&Updatable
-JoinColumnDialog_updatableWithDefault=&Updatable
-
-InverseJoinColumnDialog_editInverseJoinColumnTitle=Edit Inverse Join Column
-
-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_insertableWithDefault=Insertable ({0})
-ColumnComposite_updatable=Updatable
-ColumnComposite_updatableWithDefault=Updatable ({0})
-
-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_edit=Edit...
-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_overrideDefault=Override Default
-
-OverridesComposite_association=Override Association
-OverridesComposite_attribute=Override Attribute
-OverridesComposite_noName=<Name not set>
-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:
-GeneratedValueComposite_auto=Auto
-GeneratedValueComposite_identity=Identity
-GeneratedValueComposite_sequence=Sequence
-GeneratedValueComposite_table=Table
-
-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_edit=Edit...
-
-SecondaryTableDialog_editSecondaryTable=Edit Secondary Table
-SecondaryTableDialog_name=Name:
-SecondaryTableDialog_catalog=Catalog:
-SecondaryTableDialog_schema=Schema:
-SecondaryTableDialog_defaultSchema=Default ({0})
-SecondaryTableDialog_defaultCatalog=Default ({0})
-
-AccessTypeCombo_default=Default
-MetaDataCompleteCombo_Default=Default ({0})
-JoinColumnDialog_defaultTrue=Default ({0})
-InheritanceComposite_defaultDiscriminatorType=Default ({0})
-
-OptionalComposite_false=False
-OptionalComposite_true=True
-
-EnumTypeComposite_ordinal=Ordinal
-EnumTypeComposite_string=String
-
-FetchTypeComposite_eager=Eager
-FetchTypeComposite_lazy=Lazy
-
-TemporalTypeComposite_date=Date
-TemporalTypeComposite_time=Time
-TemporalTypeComposite_timestamp=Timestamp
-
-CascadeComposite_all=All
-CascadeComposite_cascadeTitle=Cascade
-CascadeComposite_merge=Merge
-CascadeComposite_persist=Persist
-CascadeComposite_refresh=Refresh
-CascadeComposite_remove=Remove
-
-InheritanceComposite_joined=Joined
-InheritanceComposite_single_table=Single Table
-InheritanceComposite_table_per_class=Table Per Class
-InheritanceComposite_char=Character
-InheritanceComposite_integer=Integer
-InheritanceComposite_string=String
-
-MetaDataCompleteComboViewer_true=True
-MetaDataCompleteComboViewer_false=False
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_orm.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_orm.properties
deleted file mode 100644
index e9f0f962e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_orm.properties
+++ /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
-###############################################################################
-
-PersistentTypePage_javaClassLabel=Java Class:
-PersistentTypePage_MetadataCompleteLabel=Metadata Complete:
-PersistentTypePage_AccessLabel=Access:
-
-PersistenceUnitMetadataSection_SchemaDefault=Default
-PersistenceUnitMetadataSection_CatalogDefault=Default
-
-PersistentAttributePage_javaAttributeLabel=Java Attribute:
-
-EntityMappingsDetailsPage_package=Package:
-EntityMappingsPage_XmlMappingMetadataCompleteCheckBox=XML Mapping Metadata Complete
-EntityMappingsPage_CascadePersistCheckBox=Cascade Persist
-EntityMappingsPage_PersistenceUnitSection=Persistence Unit
-EntityMappingsPage_SchemaDefault=Default ({0})
-EntityMappingsPage_SchemaNoDefaultSpecified=Default
-EntityMappingsPage_CatalogDefault=Default ({0})
-EntityMappingsPage_CatalogNoDefaultSpecified=Default
-OrmSchemaChooser_SchemaChooser=Schema:
-OrmCatalogChooser_CatalogChooser=Catalog:
-OrmJavaClassChooser_browse=Browse...
-OrmJavaClassChooser_XmlJavaClassDialog_title=Class Selection
-OrmJavaClassChooser_XmlJavaClassDialog_message=Choose a type:
-OrmPackageChooser_PackageDialog_title=Package Selection
-OrmPackageChooser_PackageDialog_message=Choose a folder:
-AccessTypeComposite_field=Field
-AccessTypeComposite_property=Property
-
-EntityMappingsDetailsPage_field=Field
-EntityMappingsDetailsPage_property=Property
-PersistenceUnitMetadataComposite_field=Field
-PersistenceUnitMetadataComposite_property=Property
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/JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUi.java
deleted file mode 100644
index dacc9d3b3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaPlatformUi.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.structure.JpaStructureProvider;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * JPA UI functionality. This is intended to work in conjunction with a core
- * JPA platform ({@link JpaPlatform}) implementation with the same ID.
- * <p>
- * Any implementation should be <i>stateless</i> in nature.
- * <p>
- * The "generic" extension supplies UI for the core platform extension with the same
- * ID.
- *
- * @see the org.eclipse.jpt.ui.jpaPlatform extension point
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaPlatformUi
-{
- /**
- * Return a *new* navigator content provider. There will be (at most) one
- * of these per view that uses it.
- */
- ICommonContentProvider buildNavigatorContentProvider();
-
- /**
- * Return a *new* navigator label provider. There will be (at most) one
- * of these per view that uses it.
- */
- ICommonLabelProvider buildNavigatorLabelProvider();
-
- /**
- * Return a *new* structure provider for the given JPA file
- */
- // TODO - binary java type support
- JpaStructureProvider buildStructureProvider(JpaFile jpaFile);
-
- JpaDetailsProvider detailsProvider(JpaStructureNode contextNode);
-
- void generateDDL(JpaProject project, IStructuredSelection selection);
-
- void generateEntities(JpaProject project, IStructuredSelection selection);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaUiFactory.java
deleted file mode 100644
index 509f53aaab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JpaUiFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Use {@link JpaFactory} to create any {@link JavaTypeMapping} or {@link JavaAttributeMapping}s. This is necessary
- * so that platforms can extend the java model with their own annotations.
- * {@link JavaTypeMappingProvider} and {@link JavaAttributeMappingProvider} use this factory.
- * See {@link JpaPlatform#javaTypeMappingProviders()} and {@link JpaPlatform#javaAttributeMappingProviders()
- * for creating new mappings types.
- * @see org.eclipse.jpt.ui.internal.BaseJpaUiFactory
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaUiFactory
-{
- JpaComposite<BasicMapping> createBasicMappingComposite(PropertyValueModel<BasicMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<Embeddable> createEmbeddableComposite(PropertyValueModel<Embeddable> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<EmbeddedIdMapping> createEmbeddedIdMappingComposite(PropertyValueModel<EmbeddedIdMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<EmbeddedMapping> createEmbeddedMappingComposite(PropertyValueModel<EmbeddedMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<Entity> createEntityComposite(PropertyValueModel<Entity> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<IdMapping> createIdMappingComposite(PropertyValueModel<IdMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<ManyToManyMapping> createManyToManyMappingComposite(PropertyValueModel<ManyToManyMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<ManyToOneMapping> createManyToOneMappingComposite(PropertyValueModel<ManyToOneMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<MappedSuperclass> createMappedSuperclassComposite(PropertyValueModel<MappedSuperclass> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<OneToManyMapping> createOneToManyMappingComposite(PropertyValueModel<OneToManyMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<OneToOneMapping> createOneToOneMappingComposite(PropertyValueModel<OneToOneMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<TransientMapping> createTransientMappingComposite(PropertyValueModel<TransientMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-
- JpaComposite<VersionMapping> createVersionMappingComposite(PropertyValueModel<VersionMapping> subjectHolder, Composite parent, TabbedPropertySheetWidgetFactory widgetFactory);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java
deleted file mode 100644
index 61be7097c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/JptUiPlugin.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public 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));
- }
-
-
- // **************** Image API **********************************************
-
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- public static Image getImage(String key) {
- ImageDescriptor desc = getImageDescriptor(key);
- return (desc == null) ? null : desc.createImage();
- }
-
-
- // **************** Construction *******************************************
-
- public JptUiPlugin() {
- super();
- INSTANCE = this;
- }
-
-
- /**
- * Return the JPA platform UI corresponding to the given JPA platform
- */
- public JpaPlatformUi jpaPlatformUi(JpaPlatform jpaPlatform) {
- return JpaPlatformUiRegistry.instance().jpaPlatform(jpaPlatform.getId());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java
deleted file mode 100644
index c0d8eef0bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.details;
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A {@link JpaComposite} defines the common behavior of the JPA related
- * widgets.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaComposite<T> {
-
- /**
- * Notifies this composite it should populates its widgets using the given
- * model object.
- *
- * @param model The model used to retrieve the information to be displayed
- */
- void populate();
-
- /**
- * Returns the actual <code>Composite</code>.
- *
- * @return This composite's actual widget
- */
- Control getControl();
-
- /**
- * Notifies this composite it should dispose any resources.
- */
- void dispose();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java
deleted file mode 100644
index 52a79edb76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsPage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.details;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A details page is used to show the propery pane for a given context node. The
- * {@link JpaDetailsProvider} is responsible for creating the pane.
- *
- * @see JpaDetailsProvider
- *
- * @version 2.0
- * @since 2.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaDetailsPage<T extends JpaStructureNode>
-{
- /**
- * Returns this details' page's widget.
- *
- * @return The container of the widgets shown by this details page
- */
- Control getControl();
-
- /**
- * Sets the subject for this details page.
- *
- * @param subject Either the new subject or <code>null</code> if the subject
- * needs to be removed
- */
- void setSubject(T subject);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java
deleted file mode 100644
index 93d078f328..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/details/JpaDetailsProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.details;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This provider is responsible to create the {@link JpaDetailsPage}
- * responsible to show the information for a given content node id.
- *
- * @see JpaDetailsPage
- *
- * @version 2.0
- * @since 2.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaDetailsProvider
-{
- /**
- * Creates a new details page based on the given content node id.
- *
- * @param parent The parent container
- * @param contentNodeId The unique identifier used to determine which details
- * page to create
- * @param widgetFactory The factory used to create various widgets
- */
- JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(
- Composite parent,
- Object contentNodeId,
- TabbedPropertySheetWidgetFactory widgetFactory);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AsynchronousUiCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AsynchronousUiCommandExecutor.java
deleted file mode 100644
index 95cf471acd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/AsynchronousUiCommandExecutor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This implementation of CommandExecutor can be used by a non-UI
- * thread to asynchronously modify a JPA project with any objects associated
- * with documents that are currently displayed in the UI.
- */
-public final class AsynchronousUiCommandExecutor
- implements CommandExecutor
-{
- public static final CommandExecutor INSTANCE = new AsynchronousUiCommandExecutor();
-
- public static CommandExecutor instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private AsynchronousUiCommandExecutor() {
- super();
- }
-
- public void execute(Command command) {
- this.display().asyncExec(this.buildRunnable(command));
- }
-
- private Runnable buildRunnable(final Command command) {
- return new Runnable() {
- public void run() {
- command.execute();
- }
- };
- }
-
- private Display display() {
- Display display = Display.getCurrent();
- return (display != null) ? display : Display.getDefault();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaUiFactory.java
deleted file mode 100644
index a5b86619b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/BaseJpaUiFactory.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.BasicMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddableComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedIdMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddedMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.EntityComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.IdMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.ManyToManyMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.ManyToOneMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.MappedSuperclassComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.OneToManyMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.OneToOneMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.TransientMappingComposite;
-import org.eclipse.jpt.ui.internal.mappings.details.VersionMappingComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JpaUiFactory
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class BaseJpaUiFactory implements JpaUiFactory
-{
- /*
- * (non-Javadoc)
- */
- public JpaComposite<BasicMapping> createBasicMappingComposite(
- PropertyValueModel<BasicMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new BasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<Embeddable> createEmbeddableComposite(
- PropertyValueModel<Embeddable> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<EmbeddedIdMapping> createEmbeddedIdMappingComposite(
- PropertyValueModel<EmbeddedIdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<EmbeddedMapping> createEmbeddedMappingComposite(
- PropertyValueModel<EmbeddedMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<Entity> createEntityComposite(
- PropertyValueModel<Entity> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<IdMapping> createIdMappingComposite(
- PropertyValueModel<IdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new IdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<ManyToManyMapping> createManyToManyMappingComposite(
- PropertyValueModel<ManyToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new ManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<ManyToOneMapping> createManyToOneMappingComposite(
- PropertyValueModel<ManyToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new ManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<MappedSuperclass> createMappedSuperclassComposite(
- PropertyValueModel<MappedSuperclass> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new MappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<OneToManyMapping> createOneToManyMappingComposite(
- PropertyValueModel<OneToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new OneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<OneToOneMapping> createOneToOneMappingComposite(
- PropertyValueModel<OneToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new OneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<TransientMapping> createTransientMappingComposite(
- PropertyValueModel<TransientMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<VersionMapping> createVersionMappingComposite(
- PropertyValueModel<VersionMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new VersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaUiFactory.java
deleted file mode 100644
index b81c6f50e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/GenericJpaUiFactory.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JpaUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class GenericJpaUiFactory extends BaseJpaUiFactory
-{
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaFileAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaFileAdapterFactory.java
deleted file mode 100644
index 898c07597f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaFileAdapterFactory.java
+++ /dev/null
@@ -1,55 +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 org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-
-public class JpaFileAdapterFactory
- implements IAdapterFactory
-{
- @SuppressWarnings("unchecked")
- private static final Class[] ADAPTER_LIST =
- new Class[] { JpaFile.class };
-
- @SuppressWarnings("unchecked")
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (! (adaptableObject instanceof IEditorPart)) {
- return null;
- }
-
- IEditorInput editorInput = ((IEditorPart) adaptableObject).getEditorInput();
-
- if (! (editorInput instanceof IFileEditorInput)) {
- return null;
- }
-
- IFile file = ((IFileEditorInput) editorInput).getFile();
- JpaProject jpaProject = JptCorePlugin.jpaProject(file.getProject());
-
- if (jpaProject == null) {
- return null;
- }
-
- return jpaProject.jpaFile(file);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
deleted file mode 100644
index d41f835b44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaHelpContextIds.java
+++ /dev/null
@@ -1,111 +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 org.eclipse.jpt.ui.JptUiPlugin;
-
-
-/**
- * Help context ids for the Dali JPA UI.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- *
- */
-public interface JpaHelpContextIds {
-
-
- //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/JpaJavaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java
deleted file mode 100644
index a5c829d961..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-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.core.dom.CompilationUnit;
-import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
-import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * JPA Java code-completion proposal computer
- */
-public class JpaJavaCompletionProposalComputer implements IJavaCompletionProposalComputer {
-
- public JpaJavaCompletionProposalComputer() {
- super();
- }
-
- public void sessionStarted() {
- // do nothing
- }
-
- @SuppressWarnings("unchecked")
- public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return (context instanceof JavaContentAssistInvocationContext) ?
- this.computeCompletionProposals((JavaContentAssistInvocationContext) context)
- :
- Collections.emptyList();
- }
-
- 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();
- }
-
- JpaFile jpaFile = JptCorePlugin.jpaFile((IFile) cu.getCorrespondingResource());
- if (jpaFile == null) {
- return Collections.emptyList();
- }
- // TODO use interface
- JavaResourceModel javaResourceModel = (JavaResourceModel) jpaFile.getResourceModel();
-
- if (javaResourceModel.rootStructureNodesSize() == 0) {
- return Collections.emptyList();
- }
-
- //TODO A bit of hackery for now just to get this compiling and working good enough,
- //we need to have a way to get the context model given an IFile or IJpaFile
- //instead of having to ask the IResourceModel for it
- JavaPersistentType structureNode = (JavaPersistentType) javaResourceModel.rootStructureNodes().next();
- 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 + "<=");
-
- CompilationUnit astRoot = JDTTools.buildASTRoot(cu);
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- for (Iterator<String> stream = structureNode.javaCompletionProposals(context.getInvocationOffset(), filter, astRoot); stream.hasNext(); ) {
- String s = stream.next();
- proposals.add(new CompletionProposal(s, tokenStart, tokenEnd - tokenStart + 1, s.length()));
- }
- return proposals;
- }
-
- @SuppressWarnings("unchecked")
- public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return Collections.emptyList();
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- public void sessionEnded() {
- // do nothing
- }
-
- private static class IgnoreCasePrefixFilter implements Filter<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/JpaMappingImageHelper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java
deleted file mode 100644
index 4ad40adb32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JpaMappingImageHelper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-public class JpaMappingImageHelper
-{
- public static Image imageForTypeMapping(String mappingKey) {
- if (MappingKeys.NULL_TYPE_MAPPING_KEY == mappingKey) {
- return JptUiPlugin.getImage(JptUiIcons.NULL_TYPE_MAPPING);
- }
- else if (MappingKeys.ENTITY_TYPE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.ENTITY);
- }
- else if (MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.EMBEDDABLE);
- }
- else if (MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.MAPPED_SUPERCLASS);
- }
- return null;
- }
-
- public static Image imageForAttributeMapping(String mappingKey) {
- if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptUiPlugin.getImage(JptUiIcons.NULL_ATTRIBUTE_MAPPING);
- }
- else if (MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.BASIC);
- }
- else if (MappingKeys.ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.ID);
- }
- else if (MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.VERSION);
- }
- else if (MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.EMBEDDED_ID);
- }
- else if (MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.EMBEDDED);
- }
- else if (MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.ONE_TO_ONE);
- }
- else if (MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.ONE_TO_MANY);
- }
- else if (MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.MANY_TO_ONE);
- }
- else if (MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.MANY_TO_MANY);
- }
- else if (MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiPlugin.getImage(JptUiIcons.TRANSIENT);
- }
- return null;
- }
-}
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 f3958a8fb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiIcons.java
+++ /dev/null
@@ -1,84 +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 org.eclipse.draw2d.ImageUtilities;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-public class JptUiIcons
-{
- public static Image ghost(Image image) {
- Color lightgray = new Color(image.getDevice(), 223, 223, 223);
- ImageData imageData = ImageUtilities.createShadedImage(image, lightgray);
- return new Image(image.getDevice(), new Image(image.getDevice(), imageData), SWT.IMAGE_GRAY);
- }
-
-
- // **************** General JPA icons **************************************
-
- public static final String JPA_WIZ_BANNER = "full/wizban/jpa_facet_wizban"; //$NON-NLS-1$
-
- public static final String JPA_CONTENT = "full/obj16/jpa-content"; //$NON-NLS-1$
-
- public static final String JPA_FILE = "full/obj16/jpa-file"; //$NON-NLS-1$
-
-
- // **************** Persistence icons **************************************
-
- public static final String PERSISTENCE = "full/obj16/persistence"; //$NON-NLS-1$
-
- public static final String PERSISTENCE_UNIT = "full/obj16/persistence-unit"; //$NON-NLS-1$
-
- public static final String MAPPING_FILE_REF = "full/obj16/jpa-file"; //$NON-NLS-1$
-
- public static final String CLASS_REF = "full/obj16/null-type-mapping"; //$NON-NLS-1$
-
-
- // **************** Orm icons **********************************************
-
- public static final String ENTITY_MAPPINGS = "full/obj16/entity-mappings"; //$NON-NLS-1$
-
-
- // **************** Orm/Java common icons **********************************
-
- public static final String ENTITY = "full/obj16/entity"; //$NON-NLS-1$
-
- public static final String EMBEDDABLE = "full/obj16/embeddable"; //$NON-NLS-1$
-
- public static final String MAPPED_SUPERCLASS = "full/obj16/mapped-superclass"; //$NON-NLS-1$
-
- public static final String NULL_TYPE_MAPPING = "full/obj16/null-type-mapping"; //$NON-NLS-1$
-
- public static final String BASIC = "full/obj16/basic"; //$NON-NLS-1$
-
- public static final String VERSION = "full/obj16/version"; //$NON-NLS-1$
-
- public static final String ID = "full/obj16/id"; //$NON-NLS-1$
-
- public static final String EMBEDDED_ID = "full/obj16/embedded-id"; //$NON-NLS-1$
-
- public static final String EMBEDDED = "full/obj16/embedded"; //$NON-NLS-1$
-
- public static final String ONE_TO_ONE = "full/obj16/one-to-one"; //$NON-NLS-1$
-
- public static final String ONE_TO_MANY = "full/obj16/one-to-many"; //$NON-NLS-1$
-
- public static final String MANY_TO_ONE = "full/obj16/many-to-one"; //$NON-NLS-1$
-
- public static final String MANY_TO_MANY = "full/obj16/many-to-many"; //$NON-NLS-1$
-
- public static final String TRANSIENT = "full/obj16/transient"; //$NON-NLS-1$
-
- public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping"; //$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 95ed06f070..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The resource strings used by the JPT UI classes.
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class JptUiMessages extends NLS
-{
- private static final String BUNDLE_NAME = "jpt_ui";
-
- public static String AddPersistentAttributeDialog_attributeLabel;
- public static String AddPersistentAttributeDialog_mappingLabel;
- public static String AddPersistentAttributeDialog_noMappingKeyError;
- public static String AddPersistentAttributeDialog_title;
- public static String AddPersistentClassDialog_classDialog_message;
- public static String AddPersistentClassDialog_classDialog_title;
- public static String AddPersistentClassDialog_classLabel;
- public static String AddPersistentClassDialog_classNotFoundWarning;
- public static String AddPersistentClassDialog_duplicateClassWarning;
- public static String AddPersistentClassDialog_mappingLabel;
- public static String AddPersistentClassDialog_noClassError;
- public static String AddPersistentClassDialog_noMappingKeyError;
- public static String AddPersistentClassDialog_title;
- public static String AddRemovePane_AddButtonText;
- public static String AddRemovePane_RemoveButtonText;
- public static String DatabaseReconnectWizardPage_addConnectionLink;
- public static String DatabaseReconnectWizardPage_connection;
- public static String DatabaseReconnectWizardPage_database;
- public static String DatabaseReconnectWizardPage_databaseConnection;
- public static String DatabaseReconnectWizardPage_reconnectLink;
- public static String DatabaseReconnectWizardPage_reconnectToDatabase;
- public static String DatabaseReconnectWizardPage_schema;
- public static String DatabaseReconnectWizardPage_schemaInfo;
- public static String EnumComboViewer_default;
- public static String EnumComboViewer_defaultWithDefault;
- 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_entityNameColumn;
- public static String GenerateEntitiesWizardPage_generateEntities;
- public static String GenerateEntitiesWizardPage_synchronizeClasses;
- public static String GenerateEntitiesWizardPage_tableColumn;
- public static String GenerateEntitiesWizardPage_tables;
- public static String GenericPlatformUiDialog_notSupportedMessageText;
- public static String GenericPlatformUiDialog_notSupportedMessageTitle;
- public static String JpaDetailsView_viewNotAvailable;
- public static String JpaFacetWizardPage_connectionLabel;
- public static String JpaFacetWizardPage_connectionLink;
- public static String JpaFacetWizardPage_createOrmXmlButton;
- public static String JpaFacetWizardPage_description;
- public static String JpaFacetWizardPage_discoverClassesButton;
- public static String JpaFacetWizardPage_jpaImplementationLabel;
- public static String JpaFacetWizardPage_jpaPrefsLink;
- public static String JpaFacetWizardPage_listClassesButton;
- public static String JpaFacetWizardPage_persistentClassManagementLabel;
- public static String JpaFacetWizardPage_platformLabel;
- public static String JpaFacetWizardPage_specifyLibLabel;
- public static String JpaFacetWizardPage_title;
- public static String JpaFacetWizardPage_userLibsLink;
- public static String JpaFacetWizardPage_userServerLibLabel;
- public static String JpaPreferencePage_defaultJpaLib;
- public static String JpaPreferencePage_invalidJpaLib;
- public static String JpaPreferencePage_userLibsLink;
- public static String JpaStructureView_linkWithEditorDesc;
- public static String JpaStructureView_linkWithEditorText;
- public static String JpaStructureView_linkWithEditorTooltip;
- public static String JpaStructureView_structureNotAvailable;
- public static String NewJpaProjectWizard_firstPage_description;
- public static String NewJpaProjectWizard_firstPage_title;
- public static String NewJpaProjectWizard_title;
- public static String OrmItemLabelProviderFactory_entityMappingsLabel;
- public static String OverwriteConfirmerDialog_text;
- public static String OverwriteConfirmerDialog_title;
- public static String PersistenceItemLabelProviderFactory_persistenceLabel;
- public static String PersistentAttributePage_mapAs;
- public static String PersistentTypePage_mapAs;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiMessages.class);
- }
-
- private JptUiMessages() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/SynchronousUiCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/SynchronousUiCommandExecutor.java
deleted file mode 100644
index 8f93d27515..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/SynchronousUiCommandExecutor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This implementation of CommandExecutor can be used by a non-UI
- * thread to synchronously modify a JPA project with any objects associated
- * with documents that are currently displayed in the UI.
- */
-public final class SynchronousUiCommandExecutor
- implements CommandExecutor
-{
- public static final CommandExecutor INSTANCE = new SynchronousUiCommandExecutor();
-
- public static CommandExecutor instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private SynchronousUiCommandExecutor() {
- super();
- }
-
- public void execute(Command command) {
- this.display().syncExec(this.buildRunnable(command));
- }
-
- private Runnable buildRunnable(final Command command) {
- return new Runnable() {
- public void run() {
- command.execute();
- }
- };
- }
-
- private Display display() {
- Display display = Display.getCurrent();
- return (display != null) ? display : Display.getDefault();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java
deleted file mode 100644
index 3d138638e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/Tracing.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.ui.JptUiPlugin;
-
-/**
- * This tracing class manages to convert the string value into boolean values or
- * integer values that are associated with the tracing debug flags. Those flags
- * are specified in the .options file. The supported keys are defined here as
- * constants for quick reference.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class Tracing
-{
- /**
- * A constant used to retrieve the value associated with "/debug".
- */
- public static final String DEBUG = "/debug";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/db".
- */
- public static final String UI_DB = "/debug/ui/db";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/detailsView".
- */
- public static final String UI_DETAILS_VIEW = "/debug/ui/detailsView";
-
- /**
- * A constant used to retrieve the value associated with "/debug/ui/layout".
- */
- public static final String UI_LAYOUT = "/debug/ui/layout";
-
- /**
- * A constant used to retrieve the value associated with "/unit-tests".
- */
- public static final String UNIT_TESTS = "/unit-tests";
-
- /**
- * Can't instantiate this <code>Tracing</code> class.
- */
- private Tracing()
- {
- super();
- throw new UnsupportedOperationException("Tracing cannot be instantiated");
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default
- * value is <code>false</code>.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return <code>true</code> if the given flag is active; <code>false</code>
- * otherwise
- */
- public static boolean booleanDebugOption(String flag)
- {
- return booleanDebugOption(flag, false);
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return <code>true</code> if the given flag is active; <code>false</code>
- * otherwise
- */
- public static boolean booleanDebugOption(String flag, boolean defaultValue)
- {
- String result = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
-
- if (result == null)
- {
- return defaultValue;
- }
-
- return Boolean.valueOf(result.trim());
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default value
- * is 0.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static int intDebugOption(String flag)
- {
- return intDebugOption(flag, 0);
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static int intDebugOption(String flag, int defaultValue)
- {
- String result = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
-
- if (result == null)
- {
- return defaultValue;
- }
-
- return Integer.valueOf(result);
- }
-
- /**
- * Logs the given messages, appends it with this plug-in id.
- *
- * @param message The message to be logged
- */
- public static void log(String message)
- {
- System.out.print("[" + JptUiPlugin.PLUGIN_ID + "] ");
- System.out.println(message);
- }
-
- /**
- * Retrieves the debug value associated with the given flag. The default value
- * is an empty string.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static String stringDebugOption(String flag)
- {
- return stringDebugOption(flag, "");
- }
-
- /**
- * Retrieves the debug value associated with the given flag.
- *
- * @param flag The flag to retrieve the debug value, which should be
- * contained in the .options file, the flag should start with "/"
- * @param defaultValue The default value if the value associated with the
- * given flag could not be found
- * @return The value associated with the given flag, or the given default
- * value
- */
- public static String stringDebugOption(String flag, String defaultValue)
- {
- String result = Platform.getDebugOption(JptUiPlugin.PLUGIN_ID + flag);
-
- if (result == null)
- {
- result = defaultValue;
- }
-
- return result;
- }
-}
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 a0d31ac8d9..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.context.orm.OrmPersistentAttribute;
-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<OrmPersistentAttribute> i = ((StructuredSelection) selection).iterator(); i.hasNext(); ) {
- OrmPersistentAttribute ormPersistentAttribute = i.next();
- ormPersistentAttribute.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 3199648b23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/AddPersistentAttributeToXmlAndMapAction.java
+++ /dev/null
@@ -1,48 +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.context.orm.OrmPersistentAttribute;
-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 OrmPersistentAttribute unmappedOrmAttribute;
-
-
- public AddPersistentAttributeToXmlAndMapAction() {
- super();
- }
-
- public void run(IAction action) {
- AddPersistentAttributeToXmlAndMapDialog dialog = new AddPersistentAttributeToXmlAndMapDialog(shell, this.unmappedOrmAttribute);
-
- dialog.create();
- dialog.setBlockOnOpen(true);
- dialog.open();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.unmappedOrmAttribute = (OrmPersistentAttribute) ((StructuredSelection) selection).getFirstElement();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.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 ad86bb7428..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.context.orm.EntityMappings;
-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 EntityMappings 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) {
- this.entityMappings = (EntityMappings) ((StructuredSelection) selection).getFirstElement();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.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 f291733d5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateDDLAction.java
+++ /dev/null
@@ -1,26 +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.JpaProject;
-
-/**
- * GenerateDDLAction
- */
-public class GenerateDDLAction extends ProjectAction {
-
- public GenerateDDLAction() {
- super();
- }
-
- protected void execute(JpaProject project) {
- this.jpaPlatformUi(project).generateDDL(project, this.getCurrentSelection());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java
deleted file mode 100644
index e1e10bb5b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/GenerateEntitiesAction.java
+++ /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
-*******************************************************************************/
-package org.eclipse.jpt.ui.internal.actions;
-
-import org.eclipse.jpt.core.JpaProject;
-
-/**
- * GenerateEntitiesAction
- */
-public class GenerateEntitiesAction extends ProjectAction {
- public GenerateEntitiesAction() {
- super();
- }
-
- protected void execute(JpaProject project) {
- this.jpaPlatformUi(project).generateEntities(project, this.getCurrentSelection());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OrmPersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OrmPersistentAttributeActionFilter.java
deleted file mode 100644
index eba6511783..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/OrmPersistentAttributeActionFilter.java
+++ /dev/null
@@ -1,59 +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.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.ui.IActionFilter;
-
-public class OrmPersistentAttributeActionFilter
- extends PersistentAttributeActionFilter
-{
- public static final String IS_VIRTUAL = "isVirtual";
-
-
- @Override
- 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 ((OrmPersistentAttribute) 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 OrmPersistentAttributeActionFilter();
- } 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/PersistentAttributeActionFilter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java
deleted file mode 100644
index fa0329a444..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/PersistentAttributeActionFilter.java
+++ /dev/null
@@ -1,60 +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.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-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 = ((PersistentAttribute) target).mappingKey() != MappingKeys.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();
- }
- 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 d47d61e59b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/ProjectAction.java
+++ /dev/null
@@ -1,94 +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.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Override any of the #execute() methods.
- */
-public abstract class ProjectAction implements IObjectActionDelegate {
-
- private ISelection currentSelection;
-
-
- public ProjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- protected IStructuredSelection getCurrentSelection() {
- if (this.currentSelection instanceof IStructuredSelection) {
- return (IStructuredSelection) this.currentSelection;
- }
- return null;
- }
-
- public void run(IAction action) {
- if (this.currentSelection instanceof IStructuredSelection) {
- for (Iterator stream = ((IStructuredSelection) this.currentSelection).iterator(); stream.hasNext(); ) {
- this.execute(stream.next());
- }
- }
- }
-
- protected void execute(Object selection) {
- IProject project = this.projectFromSelection(selection);
- if (project != null) {
- this.execute(project);
- }
- }
-
- protected IProject projectFromSelection(Object selection) {
- if (selection instanceof IProject) {
- return (IProject) selection;
- }
- if (selection instanceof IJavaProject) {
- return ((IJavaProject) selection).getProject();
- }
- return null;
- }
-
- protected JpaPlatformUi jpaPlatformUi(JpaProject project) {
- String coreJpaPlatformId = project.jpaPlatform().getId();
- return JpaPlatformUiRegistry.instance().jpaPlatform(coreJpaPlatformId);
- }
-
- protected void execute(IProject project) {
- JpaProject jpaProject = JptCorePlugin.jpaProject(project);
- if (jpaProject == null) {
- return;
- }
- this.execute(jpaProject);
- }
-
- protected void execute(JpaProject project) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.java
deleted file mode 100644
index 045097624e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentAttributeFromXmlAction.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.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.context.orm.OrmPersistentAttribute;
-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<OrmPersistentAttribute> i = ((StructuredSelection) this.selection).iterator(); i.hasNext(); ) {
- OrmPersistentAttribute ormPersistentAttribute = i.next();
- ormPersistentAttribute.setVirtual(true);
- }
- }
- }
-
-}
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 b8c1d7a5a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/actions/RemovePersistentClassAction.java
+++ /dev/null
@@ -1,41 +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.context.orm.OrmPersistentType;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class RemovePersistentClassAction
- implements IObjectActionDelegate
-{
- private OrmPersistentType persistentType;
-
-
- public RemovePersistentClassAction() {
- super();
- }
-
- public void run(IAction action) {
- this.persistentType.entityMappings().removeOrmPersistentType(this.persistentType);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.persistentType = (OrmPersistentType) ((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/details/AbstractJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractJpaDetailsPage.java
deleted file mode 100644
index d849da9d8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/AbstractJpaDetailsPage.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.details;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The base class for the details view.
- *
- * @see JpaContextNode
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class AbstractJpaDetailsPage<T extends JpaStructureNode>
- extends AbstractFormPane<T>
- implements JpaDetailsPage<T>
-{
- /**
- * Creates a new <code>BaseJpaDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJpaDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(new SimplePropertyValueModel<T>(), parent, widgetFactory);
- }
-
- /**
- * There is an issue with <code>ScrolledForm</code>, it doesn't repaint the
- * entire content, this will retrieve it by going up the hierarchy of the
- * given <code>Composite</code> and force a reflow on it.
- *
- * @param container The container used to find the <code>ScrolledForm</code>
- */
- protected final void repaintDetailsView(Composite container) {
-
- while (container != null &&
- !(container instanceof ScrolledForm))
- {
- container = container.getParent();
- }
-
- if (container != null) {
- ScrolledForm scrolledForm = (ScrolledForm) container;
- scrolledForm.reflow(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public final void setSubject(T subject) {
-
- SimplePropertyValueModel<T> subjectHolder = (SimplePropertyValueModel<T>) getSubjectHolder();
-
- // Populate this page with the new subject
- if (subject != null) {
- subjectHolder.setValue(subject);
- populate();
- }
- // Dispose this page
- else {
- disengageListeners();
- subjectHolder.setValue(null);
- }
- }
-} \ No newline at end of file
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 993b8f88f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PageBookManager.java
+++ /dev/null
@@ -1,165 +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.HashMap;
-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<Object, Composite> 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<Object, Composite>();
- 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 = 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 = 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 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 pageRecords.get(key);
- }
-
- /**
- * @return The currently active composite
- */
- public Composite getActive() {
- if(this.active == null) {
- return this.defaultComposite;
- } else {
- return 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);
- }
- }
-
- @Override
- public void dispose() {
- super.dispose();
- for (Composite pane : this.pageRecords.values()) {
- pane.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 7aa04d9099..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.details;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-import org.eclipse.jface.viewers.ComboViewer;
-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.context.AttributeMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.Tracing;
-import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.FilteringPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-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;
-
-/**
- * The abstract definition of the details page responsible to show the
- * information for an persistent attribute.
- *
- * @see PersistentAttribute
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public abstract class PersistentAttributeDetailsPage<T extends PersistentAttribute> extends AbstractJpaDetailsPage<T>
-{
- private JpaComposite<AttributeMapping> currentMappingComposite;
- private String currentMappingKey;
- private ComboViewer mappingCombo;
- private Map<String, JpaComposite<AttributeMapping>> mappingComposites;
- private PageBook mappingPageBook;
-
- /**
- * Creates a new <code>PersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected PersistentAttributeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistentAttribute.DEFAULT_MAPPING_PROPERTY);
- propertyNames.add(PersistentAttribute.SPECIFIED_MAPPING_PROPERTY);
- }
-
- protected AttributeMappingUiProvider<? extends AttributeMapping> attributeMappingUiProvider(String key) {
- for (ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> i = attributeMappingUiProviders(); i.hasNext(); ) {
- AttributeMappingUiProvider<? extends AttributeMapping> provider = i.next();
- if (provider.attributeMappingKey() == key) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Unsupported attribute mapping UI provider key: ");
- }
-
- protected abstract ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>>
- attributeMappingUiProviders();
-
- protected abstract AttributeMappingUiProvider<? extends AttributeMapping>[]
- attributeMappingUiProvidersFor(PersistentAttribute persistentAttribute);
-
- private IContentProvider buildContentProvider() {
- return new IStructuredContentProvider() {
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- if (inputElement == null) {
- return new Object[0];
- }
- return attributeMappingUiProvidersFor((PersistentAttribute) inputElement);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- };
- }
-
- private PropertyAspectAdapter<PersistentAttribute, AttributeMapping> buildGenericMappingHolder() {
- return new PropertyAspectAdapter<PersistentAttribute, AttributeMapping>(
- getSubjectHolder(),
- PersistentAttribute.DEFAULT_MAPPING_PROPERTY,
- PersistentAttribute.SPECIFIED_MAPPING_PROPERTY)
- {
- @Override
- protected AttributeMapping buildValue_() {
- return subject.getMapping();
- }
- };
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((AttributeMappingUiProvider<?>) element).label();
- }
- };
- }
-
- protected ComboViewer buildMappingCombo(Composite parent) {
-
- this.mappingCombo = buildCComboViewer(parent, buildLabelProvider());
- this.mappingCombo.getCCombo().setVisibleItemCount(Integer.MAX_VALUE);
- this.mappingCombo.setContentProvider(buildContentProvider());
- this.mappingCombo.addSelectionChangedListener(buildMappingComboModifyListener());
- return this.mappingCombo;
- }
-
- private ISelectionChangedListener buildMappingComboModifyListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- mappingChanged(e);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected JpaComposite<AttributeMapping> buildMappingComposite(PageBook pageBook,
- String key) {
-
- AttributeMappingUiProvider<AttributeMapping> uiProvider = (AttributeMappingUiProvider<AttributeMapping>) mappingUIProvider(key);
-
- return uiProvider.buildAttributeMappingComposite(
- jpaUiFactory(),
- buildMappingHolder(key),
- pageBook,
- getFormWidgetFactory()
- );
- }
-
- private Filter<AttributeMapping> buildMappingFilter(final String key) {
- return new Filter<AttributeMapping>() {
- public boolean accept(AttributeMapping value) {
- return (value == null) || key.equals(value.getKey());
- }
- };
- }
-
- private PropertyValueModel<AttributeMapping> buildMappingHolder(final String key) {
- return new FilteringPropertyValueModel<AttributeMapping>(
- buildGenericMappingHolder(),
- buildMappingFilter(key)
- );
- }
-
- protected Label buildMappingLabel(Composite parent) {
- return buildLabel(parent, JptUiMessages.PersistentAttributePage_mapAs);
- }
-
- protected PageBook buildMappingPageBook(Composite parent) {
- this.mappingPageBook = new PageBook(parent, SWT.NONE);
- return this.mappingPageBook;
- }
-
- protected abstract AttributeMappingUiProvider<? extends AttributeMapping>
- defaultAttributeMappingUiProvider(String key);
-
- protected abstract ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>>
- defaultAttributeMappingUiProviders();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doDispose() {
- log(Tracing.UI_DETAILS_VIEW, "PersistentAttributeDetailsPage.doDispose()");
-
- if (this.currentMappingComposite != null) {
- this.currentMappingComposite.dispose();
- this.currentMappingComposite = null;
- }
-
-// for (IJpaComposite<IAttributeMapping> composite : this.mappingComposites.values()) {
-// try {
-// composite.dispose();
-// }
-// catch (Exception e) {
-// JptUiPlugin.log(e);
-// }
-// }
-
- this.mappingComposites.clear();
- super.doDispose();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateMappingComboAndPage();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- this.mappingComposites = new HashMap<String, JpaComposite<AttributeMapping>>();
- }
-
- protected JpaPlatformUi jpaPlatformUi() {
- String platformId = subject().jpaProject().jpaPlatform().getId();
- return JpaPlatformUiRegistry.instance().jpaPlatform(platformId);
- }
-
- protected JpaUiFactory jpaUiFactory() {
- // TODO: Remove the type cast, used for testing
- return ((BaseJpaPlatformUi) jpaPlatformUi()).getJpaUiFactory();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void log(String flag, String message) {
- super.log(flag, message);
-
- if (Tracing.UI_DETAILS_VIEW.equals(flag) &&
- Tracing.booleanDebugOption(Tracing.UI_DETAILS_VIEW))
- {
- Tracing.log(message);
- }
- }
-
- private void mappingChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof StructuredSelection) {
- AttributeMappingUiProvider<?> provider = (AttributeMappingUiProvider<?>) ((StructuredSelection) event.getSelection()).getFirstElement();
- String key = (CollectionTools.contains(defaultAttributeMappingUiProviders(), provider) ? null : provider.attributeMappingKey());
- this.subject().setSpecifiedMappingKey(key);
- }
- }
-
- private JpaComposite<AttributeMapping> mappingCompositeFor(String key) {
- JpaComposite<AttributeMapping> composite = this.mappingComposites.get(key);
- if (composite != null) {
- return composite;
- }
-
- composite = buildMappingComposite(this.mappingPageBook, key);
-
- if (composite != null) {
- this.mappingComposites.put(key, composite);
- }
-
- return composite;
- }
-
- private AttributeMappingUiProvider<? extends AttributeMapping> mappingUIProvider(String key) {
-
- if (this.subject().getMapping() == null ||
- this.subject().getMapping().isDefault()) {
-
- return defaultAttributeMappingUiProvider(key);
- }
-
- return attributeMappingUiProvider(key);
- }
-
- private void populateMapAsCombo() {
- if (this.subject() != this.mappingCombo.getInput()) {
- this.mappingCombo.setInput(this.subject());
- }
- if (this.subject() != null) {
- if (this.subject().getMapping() == null || this.subject().getMapping().isDefault()) {
- this.mappingCombo.setSelection(new StructuredSelection(this.mappingCombo.getElementAt(0)));
- }
- else {
- AttributeMappingUiProvider<? extends AttributeMapping> provider = attributeMappingUiProvider(this.subject().mappingKey());
- if (provider != null && ! provider.equals(((StructuredSelection) this.mappingCombo.getSelection()).getFirstElement())) {
- this.mappingCombo.setSelection(new StructuredSelection(provider));
- }
- }
- }
- }
-
- private void populateMappingComboAndPage() {
- populateMapAsCombo();
- updateMappingPage();
- }
-
- private void populateMappingPage(String mappingKey) {
-
- // Nothing to update
- if (this.currentMappingKey == mappingKey) {
- return;
- }
- // Dispose the existing mapping pane
- else if (this.currentMappingComposite != null) {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentAttributeDetailsPage.populateMappingPage() disposing of current page: " + this.currentMappingKey
- );
-
- try {
- this.currentMappingComposite.dispose();
- this.currentMappingComposite = null;
- }
- catch (Exception e) {
- JptUiPlugin.log(e);
- }
- }
-
- this.currentMappingKey = mappingKey;
-
- // Change the current mapping pane with the new one
- if (this.currentMappingKey != null) {
- this.currentMappingComposite = mappingCompositeFor(mappingKey);
-
- try {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentAttributeDetailsPage.populateMappingPage() populating new page: " + this.currentMappingKey
- );
-
- this.currentMappingComposite.populate();
- this.mappingPageBook.showPage(this.currentMappingComposite.getControl());
- this.repaintDetailsView(this.mappingPageBook);
- }
- catch (Exception e) {
- JptUiPlugin.log(e);
-
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentAttributeDetailsPage.populateMappingPage() error encountered"
- );
-
- // An error was encountered either during the population, dispose it
- try {
- this.currentMappingComposite.dispose();
- }
- catch (Exception exception) {
- JptUiPlugin.log(e);
- }
-
- this.mappingComposites.remove(this.currentMappingComposite);
- this.currentMappingComposite = null;
-
- // Show an error message
- // TODO: Replace the blank label with the error page
- this.mappingPageBook.showPage(new Label(this.mappingPageBook, SWT.NULL));
- }
- }
- else {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentAttributeDetailsPage.populateMappingPage() no page to show"
- );
-
- this.mappingPageBook.showPage(new Label(this.mappingPageBook, SWT.NULL));
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == PersistentAttribute.DEFAULT_MAPPING_PROPERTY ||
- propertyName == PersistentAttribute.SPECIFIED_MAPPING_PROPERTY) {
-
- populateMappingComboAndPage();
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected boolean repopulateWithNullSubject() {
- return false;
- }
-
-//TODO focus??
-// public boolean setFocus() {
-// super.setFocus();
-// return mappingCombo.getCombo().setFocus();
-// }
-
- private void updateMappingPage() {
- AttributeMapping mapping = (this.subject() != null) ? this.subject().getMapping() : null;
- populateMappingPage(mapping == null ? null : mapping.getKey());
- }
-} \ No newline at end of file
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 4dba922b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.details;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.ListIterator;
-import java.util.Map;
-import org.eclipse.jface.viewers.ComboViewer;
-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.context.PersistentType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.Tracing;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.FilteringPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-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;
-
-/**
- * The abstract definition of the details page responsible to show the
- * information for an persistent type.
- *
- * @see PersistentType
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public abstract class PersistentTypeDetailsPage<T extends PersistentType> extends AbstractJpaDetailsPage<T>
-{
- private JpaComposite<TypeMapping> currentMappingComposite;
- private String currentMappingKey;
- private Map<String, JpaComposite<TypeMapping>> mappingComposites;
- private ComboViewer typeMappingCombo;
- private PageBook typeMappingPageBook;
-
- /**
- * Creates a new <code>PersistentTypeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PersistentTypeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistentType.MAPPING_PROPERTY);
- }
-
- private IContentProvider buildContentProvider() {
- return new IStructuredContentProvider() {
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object inputElement) {
- return (subject() == null) ?
- new String[] {}:
- CollectionTools.array(PersistentTypeDetailsPage.this.typeMappingUiProviders());
- }
-
- public void inputChanged(
- Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- };
- }
-
- private PropertyAspectAdapter<PersistentType, TypeMapping> buildGenericMappingHolder() {
- return new PropertyAspectAdapter<PersistentType, TypeMapping>(getSubjectHolder(), PersistentType.MAPPING_PROPERTY) {
- @Override
- protected TypeMapping buildValue_() {
- return subject.getMapping();
- }
- };
- }
-
- private IBaseLabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((TypeMappingUiProvider<?>) element).label();
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected JpaComposite<TypeMapping> buildMappingComposite(PageBook pageBook,
- String key) {
-
- TypeMappingUiProvider<TypeMapping> uiProvider =
- (TypeMappingUiProvider<TypeMapping>) typeMappingUiProvider(key);
-
- return uiProvider.buildPersistentTypeMappingComposite(
- buildMappingHolder(key),
- pageBook,
- getFormWidgetFactory()
- );
- }
-
- private Filter<TypeMapping> buildMappingFilter(final String key) {
- return new Filter<TypeMapping>() {
- public boolean accept(TypeMapping value) {
- return (value == null) || key.equals(value.getKey());
- }
- };
- }
-
- private PropertyValueModel<TypeMapping> buildMappingHolder(String key) {
- return new FilteringPropertyValueModel<TypeMapping>(
- buildGenericMappingHolder(),
- buildMappingFilter(key)
- );
- }
-
- protected ComboViewer buildTypeMappingCombo(Composite parent) {
- CCombo combo = buildCCombo(parent);
- this.typeMappingCombo = new ComboViewer(combo);
- this.typeMappingCombo.getCCombo().setVisibleItemCount(Integer.MAX_VALUE);
- this.typeMappingCombo.setContentProvider(buildContentProvider());
- this.typeMappingCombo.setLabelProvider(buildLabelProvider());
- this.typeMappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- typeMappingChanged(event);
- }
- });
- return this.typeMappingCombo;
- }
-
- protected Label buildTypeMappingLabel(Composite parent) {
- return buildLabel(parent, JptUiMessages.PersistentTypePage_mapAs);
- }
-
- protected PageBook buildTypeMappingPageBook(Composite parent) {
- this.typeMappingPageBook = new PageBook(parent, SWT.NONE);
- return this.typeMappingPageBook;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doDispose() {
- log(Tracing.UI_DETAILS_VIEW, "PersistentTypeDetailsPage.doDispose()");
-
- if (this.currentMappingComposite != null) {
- this.currentMappingComposite.dispose();
- this.currentMappingComposite = null;
- }
-
- this.mappingComposites.clear();
- super.doDispose();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateMappingComboAndPage();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- this.mappingComposites = new HashMap<String, JpaComposite<TypeMapping>>();
- }
-
- private JpaComposite<TypeMapping> mappingCompositeFor(String key) {
- JpaComposite<TypeMapping> mappingComposite = this.mappingComposites.get(key);
- if (mappingComposite != null) {
- return mappingComposite;
- }
-
- mappingComposite = buildMappingComposite(this.typeMappingPageBook, key);
-
- if (mappingComposite != null) {
- this.mappingComposites.put(key, mappingComposite);
- }
-
- return mappingComposite;
- }
-
- private void populateMapAsCombo() {
- if (this.subject() != this.typeMappingCombo.getInput()) {
- this.typeMappingCombo.setInput(this.subject());
- }
- if (this.subject() != null) {
- if (this.subject().getMapping() == null) {
- this.typeMappingCombo.setSelection(new StructuredSelection(this.typeMappingCombo.getElementAt(0)));
- }
- else {
- TypeMappingUiProvider<? extends TypeMapping> provider = typeMappingUiProvider(this.subject().mappingKey());
- if (provider != null && ! provider.equals(((StructuredSelection) this.typeMappingCombo.getSelection()).getFirstElement())) {
- this.typeMappingCombo.setSelection(new StructuredSelection(provider));
- }
- }
- }
- }
-
- private void populateMappingComboAndPage() {
- populateMapAsCombo();
- updateMappingPage();
- }
-
- private void populateMappingPage(String mappingKey) {
-
- // Nothing to update
- if (this.currentMappingKey == mappingKey) {
- return;
- }
- // Dispose the existing mapping pane
- else if (this.currentMappingComposite != null) {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentTypeDetailsPage.populateMappingPage() disposing of current page: " + this.currentMappingKey
- );
-
- try {
- this.currentMappingComposite.dispose();
- this.currentMappingComposite = null;
- }
- catch (Exception e) {
- JptUiPlugin.log(e);
- }
- }
-
- this.currentMappingKey = mappingKey;
-
- // Change the current mapping pane with the new one
- if (this.currentMappingKey != null) {
- this.currentMappingComposite = mappingCompositeFor(mappingKey);
-
- // Show the new mapping pane
- try {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentTypeDetailsPage.populateMappingPage() populating new page: " + this.currentMappingKey
- );
-
- this.currentMappingComposite.populate();
- this.typeMappingPageBook.showPage(this.currentMappingComposite.getControl());
- this.repaintDetailsView(this.typeMappingPageBook);
- }
- catch (Exception e) {
- JptUiPlugin.log(e);
-
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentTypeDetailsPage.populateMappingPage() error encountered"
- );
-
- // An error was encountered either during the population, dispose it
- try {
- this.currentMappingComposite.dispose();
- }
- catch (Exception exception) {
- JptUiPlugin.log(e);
- }
-
- this.mappingComposites.remove(this.currentMappingComposite);
- this.currentMappingComposite = null;
-
- // Show an error message
- // TODO: Replace the blank label with the error page
- this.typeMappingPageBook.showPage(new Label(this.typeMappingPageBook, SWT.NULL));
- }
- }
- // Clear the mapping pane and show a blank page
- else {
- this.log(
- Tracing.UI_DETAILS_VIEW,
- "PersistentTypeDetailsPage.populateMappingPage() no page to show"
- );
-
- this.typeMappingPageBook.showPage(new Label(this.typeMappingPageBook, SWT.NULL));
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == PersistentType.MAPPING_PROPERTY) {
- populateMappingComboAndPage();
- }
- }
-
- private void typeMappingChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof StructuredSelection) {
- TypeMappingUiProvider<?> provider = (TypeMappingUiProvider<?>) ((StructuredSelection) event.getSelection()).getFirstElement();
- this.subject().setMappingKey(provider.mappingKey());
- }
- }
-
- private TypeMappingUiProvider<? extends TypeMapping> typeMappingUiProvider(String key) {
- for (ListIterator<TypeMappingUiProvider<? extends TypeMapping>> iter = this.typeMappingUiProviders(); iter.hasNext();) {
- TypeMappingUiProvider<? extends TypeMapping> provider = iter.next();
- if (provider.mappingKey() == key) {
- return provider;
- }
- }
- throw new IllegalArgumentException("Unsupported type mapping UI provider key: " + key);
- }
-
-//TODO focus??
-// public boolean setFocus() {
-// super.setFocus();
-// return typeMappingCombo.getCombo().setFocus();
-// }
-
- protected abstract ListIterator<TypeMappingUiProvider<? extends TypeMapping>> typeMappingUiProviders();
-
- private void updateMappingPage() {
- TypeMapping mapping = (this.subject() != null) ? this.subject().getMapping() : null;
- populateMappingPage(mapping == null ? null : mapping.getKey());
- }
-} \ No newline at end of file
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 8c44302bde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java
+++ /dev/null
@@ -1,182 +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.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.java.details.BasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedIdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.IdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.TransientMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.VersionMappingUiProvider;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-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 OrmPersistentAttribute unmappedPersistentAttribute;
- private Text attributeText;
- private ComboViewer mappingCombo;
-
- public AddPersistentAttributeToXmlAndMapDialog(Shell parentShell, OrmPersistentAttribute unmappedPersistentAttribute) {
- super(parentShell);
- this.unmappedPersistentAttribute = unmappedPersistentAttribute;
- setTitle(JptUiMessages.AddPersistentAttributeDialog_title);
- }
-
- @Override
- 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());
-
- 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);
-
- 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(),
- EmbeddedMappingUiProvider.instance(),
- EmbeddedIdMappingUiProvider.instance(),
- IdMappingUiProvider.instance(),
- ManyToManyMappingUiProvider.instance(),
- ManyToOneMappingUiProvider.instance(),
- OneToManyMappingUiProvider.instance(),
- OneToOneMappingUiProvider.instance(),
- TransientMappingUiProvider.instance(),
- VersionMappingUiProvider.instance()
- };
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((AttributeMappingUiProvider) 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;
- }
-
- public String getAttributeName() {
- return attributeText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((AttributeMappingUiProvider) selection.getFirstElement()).attributeMappingKey();
- }
-
- 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 188ff4952a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/dialogs/AddPersistentClassDialog.java
+++ /dev/null
@@ -1,275 +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.JpaProject;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.MappedSuperclassUiProvider;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-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 EntityMappings entityMappings;
-
- private Text classText;
-
- private Button classBrowseButton;
-
- private ComboViewer mappingCombo;
-
-
- public AddPersistentClassDialog(Shell parentShell, EntityMappings entityMappings) {
- super(parentShell);
- this.entityMappings = entityMappings;
- setTitle(JptUiMessages.AddPersistentClassDialog_title);
- }
-
- @Override
- 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));
-
- createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_classLabel);
-
- this.classText = createText(composite, 1);
- this.classText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- }
- );
-
- this.classBrowseButton = createButton(composite, 1, JptUiMessages.General_browse);
- this.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);
- }
- });
-
- createLabel(composite, 2, JptUiMessages.AddPersistentClassDialog_mappingLabel);
-
- this.mappingCombo = new ComboViewer(createCombo(composite, 2));
- this.mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return new Object[] {
- MappedSuperclassUiProvider.instance(),
- EntityUiProvider.instance(),
- EmbeddableUiProvider.instance()
- };
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- this.mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((TypeMappingUiProvider<?>) element).label();
- }
- });
- this.mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- this.mappingCombo.setInput("FOO");
- this.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 JpaProject getJpaProject() {
- return this.entityMappings.jpaProject();
- }
-
- public String getClassName() {
- return this.classText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) this.mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((TypeMappingUiProvider<?>) selection.getFirstElement()).mappingKey();
- }
-
- protected IType chooseType() {
- IJavaElement[] elements= new IJavaElement[] { getJpaProject().javaProject() };
- 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().javaProject().findType(className);
- }
- catch (JavaModelException jme) {
- type = null;
- }
-
- if (type == null) {
- updateStatus(
- new Status(
- IStatus.WARNING, JptUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_classNotFoundWarning));
- return;
- }
-
- if (this.entityMappings.containsPersistentType(className)) {
- 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() {
- this.entityMappings.addOrmPersistentType(getMappingKey(), getClassName());
- super.okPressed();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/BasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/BasicMappingUiProvider.java
deleted file mode 100644
index 0d705242d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/BasicMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class BasicMappingUiProvider
- implements AttributeMappingUiProvider<BasicMapping>
-{
-
- // singleton
- private static final BasicMappingUiProvider INSTANCE = new BasicMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<BasicMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private BasicMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_BasicLabel;
- }
-
- public JpaComposite<BasicMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<BasicMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultBasicMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultBasicMappingUiProvider.java
deleted file mode 100644
index f7c47a6c1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultBasicMappingUiProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class DefaultBasicMappingUiProvider
- implements AttributeMappingUiProvider<BasicMapping>
-{
- // singleton
- private static final DefaultBasicMappingUiProvider INSTANCE = new DefaultBasicMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<BasicMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DefaultBasicMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return NLS.bind(
- JptUiMappingsMessages.DefaultBasicMappingUiProvider_Default,
- JptUiMappingsMessages.PersistentAttributePage_BasicLabel
- );
- }
-
- public JpaComposite<BasicMapping> buildAttributeMappingComposite(JpaUiFactory factory,
- PropertyValueModel<BasicMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultEmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultEmbeddedMappingUiProvider.java
deleted file mode 100644
index 617e5987e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/DefaultEmbeddedMappingUiProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class DefaultEmbeddedMappingUiProvider
- implements AttributeMappingUiProvider<EmbeddedMapping>
-{
- // singleton
- private static final DefaultEmbeddedMappingUiProvider INSTANCE = new DefaultEmbeddedMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<EmbeddedMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private DefaultEmbeddedMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return NLS.bind(
- JptUiMappingsMessages.DefaultEmbeddedMappingUiProvider_Default,
- JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel
- );
- }
-
- public JpaComposite<EmbeddedMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<EmbeddedMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddableUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddableUiProvider.java
deleted file mode 100644
index 7819aee6f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddableUiProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EmbeddableComposite;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddableUiProvider implements TypeMappingUiProvider<Embeddable>
-{
- // singleton
- private static final EmbeddableUiProvider INSTANCE = new EmbeddableUiProvider();
-
- /**
- * Return the singleton.
- */
- public static TypeMappingUiProvider<Embeddable> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddableUiProvider() {
- super();
- }
-
- public String mappingKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_EmbeddableLabel;
- }
-
- public JpaComposite<Embeddable> buildPersistentTypeMappingComposite(
- PropertyValueModel<Embeddable> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedIdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedIdMappingUiProvider.java
deleted file mode 100644
index 07ae34384e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedIdMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedIdMappingUiProvider
- implements AttributeMappingUiProvider<EmbeddedIdMapping>
-{
-
- // singleton
- private static final EmbeddedIdMappingUiProvider INSTANCE = new EmbeddedIdMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<EmbeddedIdMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedIdMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_EmbeddedIdLabel;
- }
-
- public JpaComposite<EmbeddedIdMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<EmbeddedIdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedMappingUiProvider.java
deleted file mode 100644
index 35c0374774..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EmbeddedMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EmbeddedMappingUiProvider
- implements AttributeMappingUiProvider<EmbeddedMapping>
-{
-
- // singleton
- private static final EmbeddedMappingUiProvider INSTANCE = new EmbeddedMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<EmbeddedMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EmbeddedMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_EmbeddedLabel;
- }
-
- public JpaComposite<EmbeddedMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<EmbeddedMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EntityUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EntityUiProvider.java
deleted file mode 100644
index a6b8242f68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/EntityUiProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.EntityComposite;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class EntityUiProvider implements TypeMappingUiProvider<Entity>
-{
- // singleton
- private static final EntityUiProvider INSTANCE = new EntityUiProvider();
-
- /**
- * Return the singleton.
- */
- public static TypeMappingUiProvider<Entity> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private EntityUiProvider() {
- super();
- }
-
- public String mappingKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_EntityLabel;
- }
-
- public JpaComposite<Entity> buildPersistentTypeMappingComposite(
- PropertyValueModel<Entity> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new EntityComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IdMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IdMappingUiProvider.java
deleted file mode 100644
index 16bffc7982..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/IdMappingUiProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class IdMappingUiProvider
- implements AttributeMappingUiProvider<IdMapping>
-{
- // singleton
- private static final IdMappingUiProvider INSTANCE = new IdMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<IdMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private IdMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_IdLabel;
- }
-
- public JpaComposite<IdMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<IdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createIdMappingComposite(subjectHolder, parent, 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 39dc3c5ea1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaDetailsProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This provider is responsible for creating the <code>IJpaDetailsPage</code>
- * when the information comes from the Java source file.
- *
- * @version 2.0
- * @since 1.0
- */
-public class JavaDetailsProvider
- implements JpaDetailsProvider
-{
- /**
- * Creates a new <code>JavaDetailsProvider</code>.
- */
- public JavaDetailsProvider() {
- super();
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(
- Composite parent,
- Object contentNodeId,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- if (contentNodeId == JavaStructureNodes.PERSISTENT_TYPE_ID) {
- return new JavaPersistentTypeDetailsPage(parent, widgetFactory);
- }
-
- if (contentNodeId == JavaStructureNodes.PERSISTENT_ATTRIBUTE_ID) {
- return new JavaPersistentAttributeDetailsPage(parent, widgetFactory);
- }
-
- return null;
- }
-} \ No newline at end of file
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 1167a7fcb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentAttributeDetailsPage.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.java.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The default implementation of the details page used for the Java persistent
- * attribute.
- *
- * @see PersistentAttribute
- *
- * @version 2.0
- * @since 2.0
- */
-public class JavaPersistentAttributeDetailsPage extends PersistentAttributeDetailsPage<JavaPersistentAttribute>
-{
- /**
- * Creates a new <code>JavaPersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaPersistentAttributeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> attributeMappingUiProviders() {
- // TODO
- return ((BaseJpaPlatformUi) jpaPlatformUi()).javaAttributeMappingUiProviders();
- }
-
- /**
- * 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 nullAttributeMappingUiProvider 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 attributeMapping.
- */
- @Override
- protected AttributeMappingUiProvider<? extends AttributeMapping>[] attributeMappingUiProvidersFor(PersistentAttribute persistentAttribute) {
- AttributeMappingUiProvider<? extends AttributeMapping>[] providers = new AttributeMappingUiProvider<?>[CollectionTools.size(attributeMappingUiProviders()) + 1];
- providers[0] = defaultAttributeMappingUiProvider(persistentAttribute.defaultMappingKey());
- int i = 1;
- for (ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> iterator = attributeMappingUiProviders(); iterator.hasNext(); ) {
- providers[i++] = iterator.next();
- }
- return providers;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AttributeMappingUiProvider<? extends AttributeMapping> defaultAttributeMappingUiProvider(String key) {
- for (ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> i = defaultAttributeMappingUiProviders(); i.hasNext(); ) {
- AttributeMappingUiProvider<? extends AttributeMapping> provider = i.next();
- if (provider.attributeMappingKey() == key) {
- return provider;
- }
- }
- return this.nullAttributeMappingUiProvider();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> defaultAttributeMappingUiProviders() {
- // TODO
-// return jpaPlatformUi().defaultJavaAttributeMappingUiProviders();
- return ((BaseJpaPlatformUi) jpaPlatformUi()).defaultJavaAttributeMappingUiProviders();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Note: The combo's parent is a container fixing the issue with the
- // border not being painted
- buildLabeledComposite(
- container,
- buildMappingLabel(container),
- buildMappingCombo(container).getControl().getParent()
- );
-
- PageBook mappingPane = buildMappingPageBook(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- mappingPane.setLayoutData(gridData);
- }
-
- protected AttributeMappingUiProvider<AttributeMapping> nullAttributeMappingUiProvider() {
- return NullAttributeMappingUiProvider.instance();
- }
-} \ No newline at end of file
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 a887137d6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/JavaPersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The default implementation of the details page used for the Java persistent
- * type.
- *
- * @see JavaPersistentType
- *
- * @version 2.0
- * @since 2.0
- */
-public class JavaPersistentTypeDetailsPage extends PersistentTypeDetailsPage<JavaPersistentType>
-{
- /**
- * Creates a new <code>JavaPersistentTypeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaPersistentTypeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- protected JpaPlatformUi jpaPlatformUi() {
- String platformId = subject().jpaProject().jpaPlatform().getId();
- return JpaPlatformUiRegistry.instance().jpaPlatform(platformId);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ListIterator<TypeMappingUiProvider<? extends TypeMapping>> typeMappingUiProviders() {
- // TODO
- return ((BaseJpaPlatformUi) jpaPlatformUi()).javaTypeMappingUiProviders();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Entity Type widgets
- buildLabeledComposite(
- container,
- buildTypeMappingLabel(container),
- buildTypeMappingCombo(container).getControl().getParent()
- );
-
- PageBook typeMappingPageBook = buildTypeMappingPageBook(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- typeMappingPageBook.setLayoutData(gridData);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToManyMappingUiProvider.java
deleted file mode 100644
index d0bb7be537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToManyMappingUiProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToManyMappingUiProvider
- implements AttributeMappingUiProvider<ManyToManyMapping>
-{
- // singleton
- private static final ManyToManyMappingUiProvider INSTANCE = new ManyToManyMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<ManyToManyMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToManyMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_ManyToManyLabel;
- }
-
- public JpaComposite<ManyToManyMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<ManyToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToOneMappingUiProvider.java
deleted file mode 100644
index 57022d3469..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/ManyToOneMappingUiProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class ManyToOneMappingUiProvider
- implements AttributeMappingUiProvider<ManyToOneMapping>
-{
- // singleton
- private static final ManyToOneMappingUiProvider INSTANCE = new ManyToOneMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<ManyToOneMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private ManyToOneMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_ManyToOneLabel;
- }
-
- public JpaComposite<ManyToOneMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<ManyToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/MappedSuperclassUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/MappedSuperclassUiProvider.java
deleted file mode 100644
index 1fe5539410..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/MappedSuperclassUiProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.MappedSuperclassComposite;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class MappedSuperclassUiProvider implements TypeMappingUiProvider<MappedSuperclass>
-{
- // singleton
- private static final MappedSuperclassUiProvider INSTANCE = new MappedSuperclassUiProvider();
-
- /**
- * Return the singleton.
- */
- public static TypeMappingUiProvider<MappedSuperclass> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private MappedSuperclassUiProvider() {
- super();
- }
-
- public String mappingKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentTypePage_MappedSuperclassLabel;
- }
-
- public JpaComposite<MappedSuperclass> buildPersistentTypeMappingComposite(
- PropertyValueModel<MappedSuperclass> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new MappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullAttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullAttributeMappingUiProvider.java
deleted file mode 100644
index 420d5b632e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullAttributeMappingUiProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-@SuppressWarnings("nls")
-public class NullAttributeMappingUiProvider
- implements AttributeMappingUiProvider<AttributeMapping>
-{
-
- // singleton
- private static final NullAttributeMappingUiProvider INSTANCE = new NullAttributeMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<AttributeMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NullAttributeMappingUiProvider() {
- super();
- }
-
-
- /*
- * (non-Javadoc)
- */
- public String attributeMappingKey() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- public String label() {
- return "";
- }
-
- /*
- * (non-Javadoc)
- */
- public JpaComposite<AttributeMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<AttributeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new NullComposite(subjectHolder, parent, widgetFactory);
- }
-
- public static class NullComposite extends AbstractFormPane<AttributeMapping>
- implements JpaComposite<AttributeMapping>{
-
- NullComposite(PropertyValueModel<AttributeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullTypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullTypeMappingUiProvider.java
deleted file mode 100644
index 88c68970f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/NullTypeMappingUiProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-@SuppressWarnings("nls")
-public class NullTypeMappingUiProvider implements TypeMappingUiProvider<TypeMapping>
-{
- // singleton
- private static final NullTypeMappingUiProvider INSTANCE = new NullTypeMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static TypeMappingUiProvider<TypeMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private NullTypeMappingUiProvider() {
- super();
- }
-
- public String mappingKey() {
- return null;
- }
-
- public String label() {
- return "";
- }
-
- public JpaComposite<TypeMapping> buildPersistentTypeMappingComposite(
- PropertyValueModel<TypeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return new NullComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- public static class NullComposite extends AbstractFormPane<TypeMapping>
- implements JpaComposite<TypeMapping>
- {
- NullComposite(PropertyValueModel<TypeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToManyMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToManyMappingUiProvider.java
deleted file mode 100644
index fc749dd924..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToManyMappingUiProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToManyMappingUiProvider
- implements AttributeMappingUiProvider<OneToManyMapping>
-{
- // singleton
- private static final OneToManyMappingUiProvider INSTANCE = new OneToManyMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<OneToManyMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToManyMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_OneToManyLabel;
- }
-
- public JpaComposite<OneToManyMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<OneToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToOneMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToOneMappingUiProvider.java
deleted file mode 100644
index 37c7a2f617..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/OneToOneMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class OneToOneMappingUiProvider
- implements AttributeMappingUiProvider<OneToOneMapping>
-{
-
- // singleton
- private static final OneToOneMappingUiProvider INSTANCE = new OneToOneMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<OneToOneMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private OneToOneMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_OneToOneLabel;
- }
-
- public JpaComposite<OneToOneMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<OneToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/TransientMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/TransientMappingUiProvider.java
deleted file mode 100644
index 232786b748..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/TransientMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class TransientMappingUiProvider
- implements AttributeMappingUiProvider<TransientMapping>
-{
-
- // singleton
- private static final TransientMappingUiProvider INSTANCE = new TransientMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<TransientMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private TransientMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_TransientLabel;
- }
-
- public JpaComposite<TransientMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<TransientMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createTransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/VersionMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/VersionMappingUiProvider.java
deleted file mode 100644
index 1f58da2876..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/details/VersionMappingUiProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.java.details;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-public class VersionMappingUiProvider
- implements AttributeMappingUiProvider<VersionMapping>
-{
-
- // singleton
- private static final VersionMappingUiProvider INSTANCE = new VersionMappingUiProvider();
-
- /**
- * Return the singleton.
- */
- public static AttributeMappingUiProvider<VersionMapping> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private VersionMappingUiProvider() {
- super();
- }
-
- public String attributeMappingKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String label() {
- return JptUiMappingsMessages.PersistentAttributePage_VersionLabel;
- }
-
- public JpaComposite<VersionMapping> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<VersionMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- return factory.createVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractItemLabelProvider.java
deleted file mode 100644
index b5e2715119..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractItemLabelProvider.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Implementation of {@link ItemLabelProvider} that provides updating
- * label information for a Model object.
- *
- * The typical subclass will override the following methods:
- * #buildTextModel()
- * return a {@link PropertyValueModel} that represents the text for the represented
- * model object.
- * #buildImageModel()
- * return a {@link PropertyValueModel} that represents the image for the represented
- * model object
- *
- * Other methods may be overridden, but take care to preserve the logic provided
- * by this class.
- */
-public abstract class AbstractItemLabelProvider implements ItemLabelProvider
-{
- private DelegatingContentAndLabelProvider labelProvider;
-
- private Model model;
-
- private PropertyValueModel<String> textModel;
-
- private PropertyValueModel<Image> imageModel;
-
- private PropertyChangeListener labelChangeListener;
-
-
- protected AbstractItemLabelProvider(
- Model model, DelegatingContentAndLabelProvider labelProvider) {
- this.model = model;
- this.labelProvider = labelProvider;
- this.labelChangeListener = buildLabelChangeListener();
- }
-
-
- /**
- * Construct a listener to update the viewer (through the label provider)
- * if the text or image changes
- */
- protected PropertyChangeListener buildLabelChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- labelProvider().updateLabel(model());
- }
- };
- }
-
- /**
- * Return the text value model
- * (lazy and just-in-time initialized)
- */
- protected PropertyValueModel<String> textModel() {
- if (textModel == null) {
- textModel = buildTextModel();
- engageTextModel();
- }
- return textModel;
- }
-
- /**
- * Construct a text value model
- */
- protected abstract PropertyValueModel<String> buildTextModel();
-
- /**
- * Should only be overridden with a call to super.engageTextModel() before
- * subclass logic
- */
- protected void engageTextModel() {
- textModel.addPropertyChangeListener(PropertyValueModel.VALUE, labelChangeListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageTextModel() after
- * subclass logic
- */
- protected void disengageTextModel() {
- if (textModel != null) {
- textModel.removePropertyChangeListener(PropertyValueModel.VALUE, labelChangeListener);
- }
- }
-
- /**
- * Return the image value model
- * (lazy and just-in-time initialized)
- */
- protected PropertyValueModel<Image> imageModel() {
- if (imageModel == null) {
- imageModel = buildImageModel();
- engageImageModel();
- }
- return imageModel;
- }
-
- /**
- * Construct an image model
- */
- protected abstract PropertyValueModel<Image> buildImageModel();
-
- /**
- * Should only be overridden with a call to super.engageImageModel() before
- * subclass logic
- */
- protected void engageImageModel() {
- imageModel.addPropertyChangeListener(PropertyValueModel.VALUE, labelChangeListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageImageModel() after
- * subclass logic
- */
- protected void disengageImageModel() {
- if (imageModel != null) {
- imageModel.removePropertyChangeListener(PropertyValueModel.VALUE, labelChangeListener);
- }
- }
-
- /**
- * Return the model object represented by this item
- */
- public Model model() {
- return model;
- }
-
- /**
- * Return the label provider that delegates to this item
- */
- public DelegatingContentAndLabelProvider labelProvider() {
- return labelProvider;
- }
-
- public String text() {
- return textModel().value();
- }
-
- public Image image() {
- return imageModel().value();
- }
-
- public void dispose() {
- disengageTextModel();
- disengageImageModel();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractTreeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractTreeItemContentProvider.java
deleted file mode 100644
index a276e65c9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/AbstractTreeItemContentProvider.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * Implementation of {@link TreeItemContentProvider} that provides updating
- * children information for a Model object.
- *
- * The typical subclass will override the following methods:
- * #getParent()
- * the default behavior for this method is to return null. there is no
- * property value model for this as this should not be changing for a given
- * node. all such changes will be provided by the parent side of the relationship.
- * #buildChildrenModel()
- * return a {@link ListValueModel} that represents the children for the represented
- * model object. #buildChildrenModel(CollectionValueModel) and
- * #buildChildrenModel(PropertyValueModel) are provided if the children are more
- * easily represented as a collection or as a property (single child)
- * the default behavior is to return a {@link NullListValueModel}
- *
- * Other methods may be overridden, but take care to preserve the logic provided
- * by this class.
- */
-public abstract class AbstractTreeItemContentProvider<E>
- implements TreeItemContentProvider
-{
- private DelegatingTreeContentAndLabelProvider treeContentProvider;
-
- private Model model;
-
- private ListValueModel<E> childrenModel;
-
- private ListChangeListener childrenListener;
-
-
- protected AbstractTreeItemContentProvider(
- Model model, DelegatingTreeContentAndLabelProvider treeContentProvider) {
- this.model = model;
- this.treeContentProvider = treeContentProvider;
- this.childrenListener = buildChildrenListener();
- }
-
- /**
- * Construct a listener to refresh the tree (through the tree content provider)
- * if the children change
- */
- protected ListChangeListener buildChildrenListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- }
-
- public void itemsMoved(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- for (Iterator<?> stream = event.items(); stream.hasNext(); ) {
- treeContentProvider().dispose(stream.next());
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- for (Iterator<?> stream = event.replacedItems(); stream.hasNext(); ) {
- treeContentProvider().dispose(stream.next());
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- // in the case of a list changed event, we don't have
- // access to the removed objects, so we can't dispose them.
- // keep a watch on this to see if this becomes a problem.
- }
-
- public void listCleared(ListChangeEvent event) {
- treeContentProvider().updateContent(model());
- // in the case of a list cleared event, we don't have
- // access to the removed objects, so we can't dispose them.
- // keep a watch on this to see if this becomes a problem.
- }
- };
- }
-
- /**
- * Return the children model
- * (lazy and just-in-time initialized)
- */
- protected ListValueModel<E> childrenModel() {
- if (childrenModel == null) {
- childrenModel = buildChildrenModel();
- engageChildren();
- }
- return childrenModel;
- }
-
- /**
- * Construct a children model
- */
- @SuppressWarnings("unchecked")
- protected ListValueModel<E> buildChildrenModel() {
- return new NullListValueModel();
- }
-
- /**
- * Utility method that can be used if the children model is better represented
- * as a collection.
- * This wraps the children collection model and uses it internally as a list
- * model.
- */
- protected ListValueModel<E> buildChildrenModel(CollectionValueModel<E> childrenModel) {
- return new CollectionListValueModelAdapter<E>(childrenModel);
- }
-
- /**
- * Utility method that can be used if the children model is better represented
- * as a single value property.
- * This wraps the children (child) property model and uses it internally as a list
- * model.
- */
- protected ListValueModel<E> buildChildrenModel(PropertyValueModel<E> childrenModel) {
- return buildChildrenModel(new PropertyCollectionValueModelAdapter<E>(childrenModel));
- }
-
- /**
- * Return the model object represented by this node
- */
- public Model model() {
- return model;
- }
-
- /**
- * Return the tree content provider that delegates to this node
- */
- public DelegatingTreeContentAndLabelProvider treeContentProvider() {
- return treeContentProvider;
- }
-
- public Object getParent() {
- return null;
- }
-
- public Object[] getElements() {
- return getChildren();
- }
-
- public Object[] getChildren() {
- return CollectionTools.array(childrenModel().listIterator());
- }
-
- /**
- * Override with potentially more efficient logic
- */
- public boolean hasChildren() {
- return childrenModel().listIterator().hasNext();
- }
-
- /**
- * Should only be overridden with a call to super.dispose()
- */
- public void dispose() {
- for (Object child : getChildren()) {
- treeContentProvider().dispose(child);
- }
- disengageChildren();
- }
-
- /**
- * Should only be overridden with a call to super.engageChildren() before
- * subclass logic
- */
- protected void engageChildren() {
- childrenModel.addListChangeListener(ListValueModel.LIST_VALUES, childrenListener);
- }
-
- /**
- * Should only be overridden with a call to super.disengageChildren() after
- * subclass logic
- */
- protected void disengageChildren() {
- if (childrenModel != null) {
- childrenModel.removeListChangeListener(ListValueModel.LIST_VALUES, childrenListener);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingContentAndLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingContentAndLabelProvider.java
deleted file mode 100644
index ea9b8afc2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingContentAndLabelProvider.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Implementation of {@link IStructuredContentProvider} and {@link ILabelProvider} that
- * maintains a collection (Map, actually) of {@link ItemContentProvider}
- * delegates that perform the function of providing content and label information
- * for each represented item
- *
- * NB: This class, if used as a label provider *MUST* be used as a content provider
- * for the same viewer. It may be used as a content provider with a different
- * label provider, however.
- */
-public abstract class DelegatingContentAndLabelProvider extends BaseLabelProvider
- implements IStructuredContentProvider, ILabelProvider
-{
- private final ItemContentProviderFactory itemContentProviderFactory;
-
- private final ItemLabelProviderFactory itemLabelProviderFactory;
-
- private final Map<Object, ItemContentProvider> itemContentProviders;
-
- private final Map<Object, ItemLabelProvider> itemLabelProviders;
-
- private StructuredViewer viewer;
-
-
- protected DelegatingContentAndLabelProvider(
- ItemContentProviderFactory itemContentProviderFactory) {
- this(itemContentProviderFactory, null);
- }
-
- protected DelegatingContentAndLabelProvider(
- ItemContentProviderFactory itemContentProviderFactory,
- ItemLabelProviderFactory itemLabelProviderFactory) {
- super();
- this.itemContentProviderFactory = itemContentProviderFactory;
- this.itemLabelProviderFactory = itemLabelProviderFactory;
- this.itemContentProviders = new HashMap<Object, ItemContentProvider>();
- this.itemLabelProviders = new HashMap<Object, ItemLabelProvider>();
- }
-
-
- protected ItemContentProvider itemContentProvider(Object item) {
- ItemContentProvider itemContentProvider = itemContentProviders.get(item);
- if (itemContentProvider != null) {
- return itemContentProvider;
- }
- itemContentProvider = itemContentProviderFactory.buildItemContentProvider(item, this);
- if (itemContentProvider == null) {
- return null;
- }
- itemContentProviders.put(item, itemContentProvider);
- return itemContentProvider;
- }
-
- protected ItemLabelProvider itemLabelProvider(Object item) {
- if (viewer == null) {
- throw new IllegalStateException(
- "This provider must be used as a content" +
- "provider *as well as* a label provider.");
- }
- ItemLabelProvider itemLabelProvider = itemLabelProviders.get(item);
- if (itemLabelProvider != null) {
- return itemLabelProvider;
- }
- itemLabelProvider = itemLabelProviderFactory.buildItemLabelProvider(item, this);
- if (itemLabelProvider == null) {
- return null;
- }
- itemLabelProviders.put(item, itemLabelProvider);
- return itemLabelProvider;
- }
-
-
- public Object[] getElements(Object inputElement) {
- return itemContentProvider(inputElement).getElements();
- }
-
- public Image getImage(Object element) {
- return itemLabelProvider(element).image();
- }
-
- public String getText(Object element) {
- return itemLabelProvider(element).text();
- }
-
- /**
- * Disposes all items
- */
- public void dispose() {
- // coded this way to allow some item providers to dispose of their child
- // elements without disrupting the entire process
- while (! itemContentProviders.isEmpty()) {
- dispose(itemContentProviders.keySet().iterator().next());
- }
- // this catches any items that weren't disposed from the content providers,
- // though there most likely won't be any items represented here that
- // haven't already been disposed
- while (! itemLabelProviders.isEmpty()) {
- dispose(itemLabelProviders.keySet().iterator().next());
- }
- }
-
- /**
- * Disposes item
- */
- protected void dispose(Object item) {
- if (itemContentProviders.containsKey(item)) {
- itemContentProviders.get(item).dispose();
- itemContentProviders.remove(item);
- }
- if (itemLabelProviders.containsKey(item)) {
- itemLabelProviders.get(item).dispose();
- itemLabelProviders.remove(item);
- }
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (oldInput != newInput) {
- dispose();
- }
- this.viewer = (StructuredViewer) viewer;
- }
-
- /**
- * Update the content for the given item
- */
- public void updateContent(final Object item) {
- Runnable runnable = new Runnable() {
- public void run() {
- if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- viewer.refresh(item);
- }
- }
- };
- viewer.getControl().getDisplay().asyncExec(runnable);
- }
-
- /**
- * Update the label for the given item
- */
- public void updateLabel(final Object item) {
- Runnable runnable = new Runnable() {
- public void run() {
- if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
- fireLabelProviderChanged(new LabelProviderChangedEvent(DelegatingContentAndLabelProvider.this, item));
- }
- }
- };
- viewer.getControl().getDisplay().asyncExec(runnable);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingTreeContentAndLabelProvider.java
deleted file mode 100644
index ae8498c934..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/DelegatingTreeContentAndLabelProvider.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.jface;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-
-/**
- * Extension of {@link DelegatingContentAndLabelProvider} that provides an extension
- * to provide tree content
- */
-public class DelegatingTreeContentAndLabelProvider extends DelegatingContentAndLabelProvider
- implements ITreeContentProvider
-{
- public DelegatingTreeContentAndLabelProvider(
- TreeItemContentProviderFactory treeItemContentProviderFactory) {
- super(treeItemContentProviderFactory);
- }
-
- public DelegatingTreeContentAndLabelProvider(
- TreeItemContentProviderFactory treeItemContentProviderFactory,
- ItemLabelProviderFactory itemLabelProviderFactory) {
- super(treeItemContentProviderFactory, itemLabelProviderFactory);
- }
-
-
- protected TreeItemContentProvider itemContentProvider(Object item) {
- return (TreeItemContentProvider) super.itemContentProvider(item);
- }
-
- public Object[] getChildren(Object parentElement) {
- return itemContentProvider(parentElement).getChildren();
- }
-
- public Object getParent(Object element) {
- return itemContentProvider(element).getParent();
- }
-
- public boolean hasChildren(Object element) {
- return itemContentProvider(element).hasChildren();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProvider.java
deleted file mode 100644
index 042775643d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProvider.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-/**
- * Marker interface used in conjunction with DelegatingContentProvider to return
- * content information for a particular item.
- * @see DelegatingContentProvider
- * @see ItemContentProviderFactory
- */
-public interface ItemContentProvider
-{
- /**
- * Return the elements of the represented item.
- * Note that when this is called, the represented item is an input element.
- */
- Object[] getElements();
-
- /**
- * Dispose of this content provider, cleaning up all references, listeners, etc.
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProviderFactory.java
deleted file mode 100644
index c6154da54f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemContentProviderFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-/**
- * Factory interface used to describe how to build {@link ItemContentProvider}s
- * for a {@link DelegatingContentAndLabelProvider}
- */
-public interface ItemContentProviderFactory
-{
- ItemContentProvider buildItemContentProvider(Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProvider.java
deleted file mode 100644
index b9b76b83c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Interface used in conjunction with DelegatingLabelProvider to return
- * label information for a particular item.
- * @see DelegatingLabelProvider
- * @see ItemLabelProviderFactory
- */
-public interface ItemLabelProvider
-{
- /**
- * Return the image for the item
- */
- Image image();
-
- /**
- * Return the text for the item
- */
- public String text();
-
- /**
- * Dispose of this label provider, cleaning up all references, listeners, etc.
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProviderFactory.java
deleted file mode 100644
index bc37fb0fcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/ItemLabelProviderFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-/**
- * Factory interface used to describe how to build IItemLabelProviders
- * for a DelegatingContentAndLabelProvider
- */
-public interface ItemLabelProviderFactory
-{
- ItemLabelProvider buildItemLabelProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
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 22fad41590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullLabelProvider.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.ui.internal.jface;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Null implementation of the ILabelProvider interface.
- * Implemented as a singleton.
- */
-public final class NullLabelProvider
- implements ILabelProvider
-{
- public static final NullLabelProvider INSTANCE = new NullLabelProvider();
-
- public static ILabelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure a single instance.
- */
- private NullLabelProvider() {
- super();
- }
-
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return null;
- }
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
-}
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 2a53f274de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/NullTreeContentProvider.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.ui.internal.jface;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Null implementation of the ILabelProvider interface.
- * Implemented as a singleton.
- */
-public final class NullTreeContentProvider
- implements ITreeContentProvider
-{
- private static final Object[] EMPTY_ARRAY = new Object[0];
- public static final NullTreeContentProvider INSTANCE = new NullTreeContentProvider();
-
- public static ITreeContentProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure a single instance.
- */
- private NullTreeContentProvider() {
- super();
- }
-
- public Object[] getChildren(Object parentElement) {
- return EMPTY_ARRAY;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- return EMPTY_ARRAY;
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/StructuredContentProviderAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/StructuredContentProviderAdapter.java
deleted file mode 100644
index 1a2a9f09d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/StructuredContentProviderAdapter.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.jface;
-
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This adapter can be used to keep an AbstractListViewer
- * (e.g. a ListViewer or ComboViewer) in synch with a ListValueModel
- * (or a CollectionValueModel).
- */
-public class StructuredContentProviderAdapter
- implements IStructuredContentProvider
-{
- /** The underlying model list. */
- protected ListValueModel listHolder;
-
- /** The list viewer we keep in synch with the model list. */
- protected final AbstractListViewer listViewer;
-
- /** A listener that allows us to forward changes made to the underlying model list. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** static **********
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, ListValueModel listHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, listHolder);
- }
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, collectionHolder);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, ListValueModel listHolder) {
- super();
- this.listChangeListener = this.buildListChangeListener();
- this.listViewer = listViewer;
- this.listViewer.setContentProvider(this);
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- this(listViewer, new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.itemsAdded(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.itemsRemoved(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.itemsReplaced(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.itemsMoved(e);
- }
- public void listCleared(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- // ********** IStructuredContentProvider implementation **********
-
- public Object[] getElements(Object inputElement) {
- if (inputElement != this.listHolder) {
- throw new IllegalArgumentException("invalid input element: " + inputElement);
- }
- return this.listHolder.toArray();
- }
-
- /**
- * This is called by the list viewer, so don't update the list viewer here.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (viewer != this.listViewer) {
- throw new IllegalArgumentException("invalid viewer: " + viewer);
- }
- if (oldInput != this.listHolder) {
- throw new IllegalArgumentException("invalid old input: " + oldInput);
- }
- this.modelChanged((ListValueModel) oldInput, (ListValueModel) newInput);
- }
-
- public void dispose() {
- // do nothing - listeners should've already been removed in #inputChanged(Viewer, Object, Object)
- }
-
-
- // ********** internal methods **********
-
- protected void modelChanged(ListValueModel oldModel, ListValueModel newModel) {
- if (oldModel != null) {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- this.listHolder = newModel;
- if (newModel != null) {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel listHolder) {
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Set the underlying collection model.
- */
- public void setModel(CollectionValueModel collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsAdded(ListChangeEvent e) {
- int i = e.index();
- for (@SuppressWarnings("unchecked") ListIterator stream = e.items(); stream.hasNext(); i++) {
- this.listViewer.insert(stream.next(), i);
- }
- }
-
- /**
- * Items were removed from the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsRemoved(ListChangeEvent e) {
- this.listViewer.remove(CollectionTools.array(e.items(), e.itemsSize()));
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsReplaced(ListChangeEvent e) {
- this.listViewer.remove(CollectionTools.array(e.replacedItems(), e.itemsSize()));
- int i = e.index();
- for (@SuppressWarnings("unchecked") ListIterator stream = e.items(); stream.hasNext(); i++) {
- this.listViewer.insert(stream.next(), i);
- }
- }
-
- /**
- * Items were moved in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsMoved(ListChangeEvent e) {
- int len = e.moveLength();
- Object[] items = new Object[len];
- int offset = e.sourceIndex();
- for (int i = 0; i < len; i++) {
- items[i] = this.listHolder.get(offset + i);
- }
- this.listViewer.remove(items);
-
- offset = e.targetIndex();
- for (int i = 0; i < len; i++) {
- this.listViewer.insert(items[i], offset + i);
- }
- }
-
- /**
- * The underlying model list was cleared.
- * Synchronize the list viewer.
- */
- protected void listCleared() {
- this.listViewer.refresh();
- }
-
- /**
- * The underlying model list has changed "dramatically".
- * Synchronize the list viewer.
- */
- protected void listChanged() {
- this.listViewer.refresh();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProvider.java
deleted file mode 100644
index 2a3a2e6dc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProvider.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.jface;
-
-/**
- * Interface used in conjunction with DelegatingTreeContentProvider to return
- * tree information for a particular item.
- * @see DelegatingTreeContentProvider
- * @see TreeItemContentProviderFactory
- */
-public interface TreeItemContentProvider extends ItemContentProvider
-{
- /**
- * Return the parent of the represented item
- */
- Object getParent();
-
- /**
- * Return whether the represented item has children
- */
- boolean hasChildren();
-
- /**
- * Return the children of the represented item
- */
- Object[] getChildren();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProviderFactory.java
deleted file mode 100644
index b06d2dbfc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jface/TreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,21 +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.jface;
-
-/**
- * Extension of {@link ItemContentProviderFactory} that extends functionality
- * for tree content
- */
-public interface TreeItemContentProviderFactory extends ItemContentProviderFactory
-{
- public TreeItemContentProvider buildItemContentProvider(Object item,
- DelegatingContentAndLabelProvider contentAndLabelProvider);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java
deleted file mode 100644
index d83e78a62c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTCollectionChangeListenerWrapper.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.listeners;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another collection change listener and forward events to it on the SWT
- * UI thread.
- */
-public class SWTCollectionChangeListenerWrapper
- implements CollectionChangeListener
-{
- private final CollectionChangeListener listener;
-
- public SWTCollectionChangeListenerWrapper(CollectionChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnUIThread(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared";
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTCollectionChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed";
- }
- };
- }
-
- private boolean isExecutingUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * Display#asyncExec(Runnable) seems to work OK;
- * but using #syncExec(Runnable) can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void itemsAdded_(CollectionChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(CollectionChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void collectionCleared_(CollectionChangeEvent event) {
- this.listener.collectionCleared(event);
- }
-
- void collectionChanged_(CollectionChangeEvent event) {
- this.listener.collectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTListChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTListChangeListenerWrapper.java
deleted file mode 100644
index 2343c62cb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTListChangeListenerWrapper.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.listeners;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another list change listener and forward events to it on the SWT
- * UI thread.
- */
-public class SWTListChangeListenerWrapper
- implements ListChangeListener
-{
- private final ListChangeListener listener;
-
- public SWTListChangeListenerWrapper(ListChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnUIThread(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnUIThread(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnUIThread(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnUIThread(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved";
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced";
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared";
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTListChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed";
- }
- };
- }
-
- private boolean isExecutingUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * Display#asyncExec(Runnable) seems to work OK;
- * but using #syncExec(Runnable) can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void itemsAdded_(ListChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(ListChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void itemsMoved_(ListChangeEvent event) {
- this.listener.itemsMoved(event);
- }
-
- void itemsReplaced_(ListChangeEvent event) {
- this.listener.itemsReplaced(event);
- }
-
- void listCleared_(ListChangeEvent event) {
- this.listener.listCleared(event);
- }
-
- void listChanged_(ListChangeEvent event) {
- this.listener.listChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java
deleted file mode 100644
index 99f0a6ff58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.listeners;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another property change listener and forward events to it on the SWT
- * UI thread.
- */
-public class SWTPropertyChangeListenerWrapper
- implements PropertyChangeListener
-{
- private final PropertyChangeListener listener;
-
- public SWTPropertyChangeListenerWrapper(PropertyChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.propertyChanged_(event);
- } else {
- this.executeOnUIThread(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTPropertyChangeListenerWrapper.this.propertyChanged_(event);
- }
- };
- }
-
- private boolean isExecutingUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * Display#asyncExec(Runnable) seems to work OK;
- * but using #syncExec(Runnable) can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void propertyChanged_(PropertyChangeEvent event) {
- this.listener.propertyChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTStateChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTStateChangeListenerWrapper.java
deleted file mode 100644
index 4a941336c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTStateChangeListenerWrapper.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.listeners;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another state change listener and forward events to it on the SWT
- * UI thread.
- */
-public class SWTStateChangeListenerWrapper
- implements StateChangeListener
-{
- private final StateChangeListener listener;
-
- public SWTStateChangeListenerWrapper(StateChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void stateChanged(StateChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.stateChanged_(event);
- } else {
- this.executeOnUIThread(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTStateChangeListenerWrapper.this.stateChanged_(event);
- }
- };
- }
-
- private boolean isExecutingUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * Display#asyncExec(Runnable) seems to work OK;
- * but using #syncExec(Runnable) can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void stateChanged_(StateChangeEvent event) {
- this.listener.stateChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTTreeChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTTreeChangeListenerWrapper.java
deleted file mode 100644
index 71e8cd0966..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/listeners/SWTTreeChangeListenerWrapper.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.listeners;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Wrap another tree change listener and forward events to it on the SWT
- * UI thread.
- */
-public class SWTTreeChangeListenerWrapper
- implements TreeChangeListener
-{
- private final TreeChangeListener listener;
-
- public SWTTreeChangeListenerWrapper(TreeChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void nodeAdded(TreeChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.nodeAdded_(event);
- } else {
- this.executeOnUIThread(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnUIThread(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnUIThread(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (this.isExecutingUIThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnUIThread(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildNodeAddedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added";
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed";
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared";
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- SWTTreeChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed";
- }
- };
- }
-
- private boolean isExecutingUIThread() {
- return Display.getCurrent() != null;
- }
-
- /**
- * Display#asyncExec(Runnable) seems to work OK;
- * but using #syncExec(Runnable) can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnUIThread(Runnable r) {
- Display.getDefault().asyncExec(r);
-// Display.getDefault().syncExec(r);
- }
-
- void nodeAdded_(TreeChangeEvent event) {
- this.listener.nodeAdded(event);
- }
-
- void nodeRemoved_(TreeChangeEvent event) {
- this.listener.nodeRemoved(event);
- }
-
- void treeCleared_(TreeChangeEvent event) {
- this.listener.treeCleared(event);
- }
-
- void treeChanged_(TreeChangeEvent event) {
- this.listener.treeChanged(event);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener.toString() + ")";
- }
-
-}
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 8cd682e7ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsMessages.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.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 NoneSelected;
-
- public static String Boolean_True;
- public static String Boolean_False;
-
- 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_optionalLabelDefault;
- public static String BasicGeneralSection_lobLabel;
- public static String BasicGeneralSection_temporalLabel;
- public static String BasicGeneralSection_enumeratedLabel;
-
- public static String DefaultBasicMappingUiProvider_Default;
- public static String DefaultEmbeddedMappingUiProvider_Default;
-
- 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 TargetEntityChooser_selectTypeTitle;
-
- 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_addJoinColumnDescriptionTitle;
- public static String JoinColumnDialog_addJoinColumnTitle;
- public static String JoinColumnDialog_description;
- public static String JoinColumnDialog_defaultEmpty;
- public static String JoinColumnDialog_defaultWithOneParam;
- public static String JoinColumnDialog_editJoinColumnDescriptionTitle;
- public static String JoinColumnDialog_editJoinColumnTitle;
- public static String JoinColumnDialog_name;
- public static String JoinColumnDialog_insertable;
- public static String JoinColumnDialog_insertableWithDefault;
- public static String JoinColumnDialog_referencedColumnName;
- public static String JoinColumnDialog_table;
- public static String JoinColumnDialog_updatable;
- public static String JoinColumnDialog_updatableWithDefault;
-
- public static String JoinColumnDialogPane_true;
- public static String JoinColumnDialogPane_false;
-
- public static String InverseJoinColumnDialog_editInverseJoinColumnTitle;
-
- 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_insertableWithDefault;
- public static String ColumnComposite_updatable;
- public static String ColumnComposite_updatableWithDefault;
-
- 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_edit;
- 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_overrideDefault;
-
- public static String OverridesComposite_association;
- public static String OverridesComposite_attribute;
- public static String OverridesComposite_noName;
- 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_edit;
-
- 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 MetaDataCompleteCombo_Default;
- public static String JoinColumnDialog_defaultTrue;
- public static String InheritanceComposite_defaultDiscriminatorType;
- public static String GeneratedValueComposite_auto;
- public static String GeneratedValueComposite_identity;
- public static String GeneratedValueComposite_sequence;
- public static String GeneratedValueComposite_table;
-
- public static String OptionalComposite_false;
- public static String OptionalComposite_true;
-
- public static String EnumTypeComposite_ordinal;
- public static String EnumTypeComposite_string;
-
- public static String TemporalTypeComposite_date;
- public static String TemporalTypeComposite_time;
- public static String TemporalTypeComposite_timestamp;
-
- public static String FetchTypeComposite_eager;
- public static String FetchTypeComposite_lazy;
-
- public static String CascadeComposite_all;
- public static String CascadeComposite_cascadeTitle;
- public static String CascadeComposite_merge;
- public static String CascadeComposite_persist;
- public static String CascadeComposite_refresh;
- public static String CascadeComposite_remove;
-
- public static String InheritanceComposite_single_table;
- public static String InheritanceComposite_joined;
- public static String InheritanceComposite_table_per_class;
- public static String InheritanceComposite_string;
- public static String InheritanceComposite_char;
- public static String InheritanceComposite_integer;
-
- public static String MetaDataCompleteComboViewer_true;
- public static String MetaDataCompleteComboViewer_false;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiMappingsMessages.class);
- }
-
- private JptUiMappingsMessages() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/AbstractDatabaseObjectCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/AbstractDatabaseObjectCombo.java
deleted file mode 100644
index 0de0bb12a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/AbstractDatabaseObjectCombo.java
+++ /dev/null
@@ -1,587 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.JpaProject;
-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.Tracing;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This abstract implementation keeps a combo in sync with the database objects
- * when a connection is active.
- *
- * @see CatalogCombo
- * @see ColumnCombo
- * @see SchemaCombo
- * @see TableCombo
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class AbstractDatabaseObjectCombo<T extends JpaNode> extends AbstractFormPane<T>
-{
- /**
- * The main widget of this pane.
- */
- private CCombo combo;
-
- /**
- * The listener added to the <code>ConnectionProfile</code> responsible to
- * keep the combo in sync with the database metadata.
- */
- private ConnectionListener connectionListener;
-
- /**
- * Creates a new <code>AbstractDatabaseObjectCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- protected AbstractDatabaseObjectCombo(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>AbstractDatabaseObjectCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- protected AbstractDatabaseObjectCombo(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>AbstractDatabaseObjectCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractDatabaseObjectCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory)
- {
- super(subjectHolder, parent, widgetFactory);
- }
-
- private ConnectionListener buildConnectionListener() {
-
- return new ConnectionListener() {
-
- public void aboutToClose(ConnectionProfile profile) {
- log(Tracing.UI_DB, "aboutToClose");
- }
-
- public void closed(ConnectionProfile profile) {
-
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- log(Tracing.UI_DB, "closed");
-
- if (!getCombo().isDisposed()) {
- AbstractDatabaseObjectCombo.this.repopulate();
- }
- }
- });
- }
-
- public void databaseChanged(ConnectionProfile profile,
- Database database) {
-
- log(Tracing.UI_DB, "databaseChanged");
- }
-
- public void modified(ConnectionProfile profile) {
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- log(Tracing.UI_DB, "modified");
-
- if (!getCombo().isDisposed()) {
- AbstractDatabaseObjectCombo.this.repopulate();
- }
- }
- });
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- log(Tracing.UI_DB, "okToClose");
- return true;
- }
-
- public void opened(ConnectionProfile profile) {
-
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- log(Tracing.UI_DB, "opened");
-
- if (!getCombo().isDisposed()) {
- AbstractDatabaseObjectCombo.this.repopulate();
- }
- }
- });
- }
-
- public void schemaChanged(ConnectionProfile profile,
- final Schema schema) {
-
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- log(Tracing.UI_DB, "schemaChanged: " + schema.getName());
-
- if (!getCombo().isDisposed()) {
- AbstractDatabaseObjectCombo.this.schemaChanged(schema);
- }
- }
- });
- }
-
- public void tableChanged(ConnectionProfile profile,
- final Table table) {
-
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- log(Tracing.UI_DB, "tableChanged: " + table.getName());
-
- if (!getCombo().isDisposed()) {
- AbstractDatabaseObjectCombo.this.tableChanged(table);
- }
- }
- });
- }
- };
- }
-
- private FocusListener buildFocusListener() {
-
- return new FocusListener() {
-
- public void focusGained(FocusEvent e) {
-
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
-
- if (combo.getSelectionIndex() == 0) {
- setPopulating(true);
-
- try {
- combo.setText("");
- }
- finally {
- setPopulating(false);
- }
- }
- }
- }
-
- public void focusLost(FocusEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
-
- if (combo.getText().length() == 0) {
- setPopulating(true);
-
- try {
- combo.select(0);
- }
- finally {
- setPopulating(false);
- }
- }
- }
- }
- };
- }
-
- private ModifyListener buildModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
- valueChanged(combo.getText());
- }
- }
- };
- }
-
- /**
- * If the value changes but the subject is null, then is invoked in order to
- * create the subject.
- */
- protected void buildSubject() {
- }
-
- /**
- * Returns the JPA project's connection profile, which is never
- * <code>null</code>.
- *
- * @return The connection set in the project's properties or <code>null</code>
- * if it could not being retrieved
- */
- protected final ConnectionProfile connectionProfile() {
- JpaProject jpaProject = jpaProject();
-
- if (jpaProject != null) {
- return jpaProject.connectionProfile();
- }
-
- return null;
- }
-
- /**
- * Returns the database associated with the active connection profile.
- *
- * @return The online database or a <code>null</code> instance if no
- * connection profile was set or the
- */
- protected final Database database() {
- return connectionProfile().getDatabase();
- }
-
- /**
- * Returns the default value, or <code>null</code> if no default is
- * specified.
- *
- * @return The value that represents the default when no value was specified
- */
- protected abstract String defaultValue();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void disengageListeners(T subject) {
- super.disengageListeners(subject);
-
- JpaProject jpaProject = jpaProject();
-
- if (jpaProject != null) {
- jpaProject.connectionProfile().removeConnectionListener(this.connectionListener);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
-
- super.doPopulate();
- populateCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
-
- super.enableWidgets(enabled);
-
- if (!this.combo.isDisposed()) {
- this.combo.setEnabled(enabled);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void engageListeners(T subject) {
- super.engageListeners(subject);
-
- JpaProject jpaProject = jpaProject();
-
- if (jpaProject != null) {
- jpaProject.connectionProfile().addConnectionListener(this.connectionListener);
- }
- }
-
- public final CCombo getCombo() {
- return this.combo;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- this.connectionListener = buildConnectionListener();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- this.combo = buildEditableCCombo(container);
- this.combo.addModifyListener(buildModifyListener());
- this.combo.addFocusListener(buildFocusListener());
- }
-
- /**
- * Determines if the subject should be created when the value changes.
- *
- * @return <code>false</code> is the default behavior
- */
- protected boolean isBuildSubjectAllowed() {
- return false;
- }
-
- /**
- * Retrives the <code>IJpaProject</code> that is required to register a
- * <code>ConnectionListener</code> in order to keep the combo in sync with
- * the associated online database.
- *
- * @return The JPA project
- */
- protected JpaProject jpaProject() {
- return subject() == null ? null : subject().jpaProject();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void log(String flag, String message) {
-
- super.log(flag, message);
-
- if (Tracing.UI_DB.equals(flag) &&
- Tracing.booleanDebugOption(Tracing.UI_DB))
- {
- Class<?> thisClass = getClass();
- String className = ClassTools.shortNameFor(thisClass);
-
- if (thisClass.isAnonymousClass()) {
- className = className.substring(0, className.indexOf('$'));
- className += "->" + ClassTools.shortNameFor(thisClass.getSuperclass());
- }
-
- Tracing.log(className + ": " + message);
- }
- }
-
- /**
- * Populates the combo's list by adding first the default value is available
- * and then the possible choices.
- */
- private void populateCombo() {
-
- combo.removeAll();
- populateDefaultValue();
-
- ConnectionProfile connectionProfile = connectionProfile();
-
- if ((connectionProfile != null) && connectionProfile.isConnected()) {
-
- for (Iterator<String> iter = CollectionTools.sort(values()); iter.hasNext(); ) {
- combo.add(iter.next());
- }
- }
-
- updateSelectedItem();
- }
-
- /**
- * Adds the default value to the combo if one exists.
- */
- private void populateDefaultValue() {
-
- String defaultValue = (subject() != null) ? defaultValue() : null;
-
- if (defaultValue != null) {
- combo.add(NLS.bind(
- JptUiMappingsMessages.ColumnComposite_defaultWithOneParam,
- defaultValue
- ));
- }
- else {
- combo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- updateSelectedItem();
- }
-
- /**
- * The
- *
- * @param schema
- */
- protected void schemaChanged(Schema schema) {
- }
-
- /**
- * Sets the given value as the new value.
- *
- * @param value The new value to send to the model object
- */
- protected abstract void setValue(String value);
-
- /**
- * The
- *
- * @param catalog
- */
- protected void tableChanged(Table table) {
- }
-
- /**
- * Updates the selected item by selected the current value, if not
- * <code>null</code>, or select the default value if one is available,
- * otherwise remove the selection.
- * <p>
- * <b>Note:</b> It seems the text can be shown as truncated, changing the
- * selection to (0, 0) makes the entire text visible.
- */
- private void updateSelectedItem() {
-
- T subject = subject();
-
- String value = (subject != null) ? value() : null;
- String defaultValue = (subject != null) ? defaultValue() : null;
- String displayString = JptUiMappingsMessages.ColumnComposite_defaultEmpty;
-
- if (defaultValue != null) {
- displayString = NLS.bind(
- JptUiMappingsMessages.ColumnComposite_defaultWithOneParam,
- defaultValue
- );
- }
-
- // Make sure the default value is up to date
- if (!combo.getItem(0).equals(displayString)) {
- combo.remove(0);
- combo.add(displayString, 0);
- }
-
- // Select the new value
- if (value != null) {
- combo.setText(value);
- }
- // Select the default value
- else {
- combo.select(0);
- }
-
- combo.setSelection(new Point(0, 0));
- }
-
- /**
- * Requests the current value from the model object.
- *
- * @return The current value
- */
- protected abstract String value();
-
- /**
- * The selection has changed, update the model if required.
- *
- * @param value The new value
- */
- protected void valueChanged(String value) {
-
- JpaNode subject = subject();
-
- if ((subject == null) && !isBuildSubjectAllowed()) {
- return;
- }
-
- String oldValue = (subject != null) ? value() : null;
-
- // Check for null value
- if (StringTools.stringIsEmpty(value)) {
- value = null;
-
- if (StringTools.stringIsEmpty(oldValue)) {
- return;
- }
- }
-
- // Convert the default value to null
- if (value != null &&
- getCombo().getItemCount() > 0 &&
- value.equals(getCombo().getItem(0)))
- {
- value = null;
- }
-
- // Nothing to change
- if ((oldValue == value) && value == null) {
- return;
- }
-
- // Build the subject before setting the value
- if (subject == null) {
- buildSubject();
- }
-
- // Set the new value
- if ((value != null) && (oldValue == null) ||
- ((oldValue != null) && !oldValue.equals(value))) {
-
- setPopulating(true);
-
- try {
- setValue(value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- /**
- * Retrieves the possible values, which will be added to the combo during
- * population.
- *
- * @return A non-<code>null</code> <code>Iterator</code> of the possible
- * choices to be added to the combo
- */
- protected abstract Iterator<String> values();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/CatalogCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/CatalogCombo.java
deleted file mode 100644
index 7595e570e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/CatalogCombo.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This database object combo handles showing the database's catalogs.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class CatalogCombo<T extends JpaNode> extends AbstractDatabaseObjectCombo<T>
-{
- /**
- * Creates a new <code>CatalogCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public CatalogCombo(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>CatalogCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public CatalogCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Iterator<String> values() {
-
- Database database = database();
-
- if (database != null) {
- return database.catalogNames();
- }
-
- return EmptyIterator.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/ColumnCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/ColumnCombo.java
deleted file mode 100644
index 404769fcd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/ColumnCombo.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This database object combo handles showing a table's columns.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class ColumnCombo<T extends JpaNode> extends AbstractDatabaseObjectCombo<T>
-{
- /**
- * Creates a new <code>ColumnCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public ColumnCombo(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>ColumnCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public ColumnCombo(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>ColumnCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ColumnCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- protected abstract Table table();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void tableChanged(Table table) {
- super.tableChanged(table);
-
- if (table == table()) {
- this.doPopulate();
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Iterator<String> values() {
-
- Table table = table();
-
- if (table != null) {
- return table.columnNames();
- }
-
- return EmptyIterator.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SchemaCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SchemaCombo.java
deleted file mode 100644
index dbd6b75584..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SchemaCombo.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.db.internal.Database;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This database object combo handles showing the database's schemas.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class SchemaCombo<T extends JpaNode> extends AbstractDatabaseObjectCombo<T>
-{
- /**
- * Creates a new <code>SchemaCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SchemaCombo(AbstractFormPane<? extends T> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>SchemaCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public SchemaCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory)
- {
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Iterator<String> values() {
-
- Database database = this.database();
-
- if (database != null) {
- return database.schemaNames();
- }
-
- return EmptyIterator.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SequenceCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SequenceCombo.java
deleted file mode 100644
index 6f7e4b7310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/SequenceCombo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This database object combo handles showing the database's sequences for a
- * given <code>Schema</code>.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class SequenceCombo<T extends JpaNode> extends AbstractDatabaseObjectCombo<T>
-{
- /**
- * Creates a new <code>SequenceCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SequenceCombo(AbstractFormPane<? extends T> parentPane, Composite parent)
- {
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>SequenceCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public SequenceCombo(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>SequenceCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public SequenceCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory)
- {
- super(subjectHolder, parent, widgetFactory);
- }
-
- protected abstract Schema schema();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Iterator<String> values() {
- Schema schema = schema();
-
- if (schema != null) {
- return schema.sequenceNames();
- }
-
- return EmptyIterator.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/TableCombo.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/TableCombo.java
deleted file mode 100644
index 9bc48d3e1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/db/TableCombo.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.db;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This database object combo handles showing the database's tables.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class TableCombo<T extends JpaNode> extends AbstractDatabaseObjectCombo<T>
-{
- /**
- * Creates a new <code>TableCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TableCombo(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>TableCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public TableCombo(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>TableCombo</code>.
- *
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public TableCombo(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory)
- {
- super(subjectHolder, parent, widgetFactory);
- }
-
- protected abstract Table table();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void tableChanged(Table table) {
- super.tableChanged(table);
-
- if (table == table()) {
- this.doPopulate();
- }
- }
-} \ No newline at end of file
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 d3b8f3974b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialog.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractValidatingDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The abstract definition the dialog showing the information for a join column
- * to edit or to create.
- *
- * @see AbstractJoinColumnStateObject
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class AbstractJoinColumnDialog<T extends AbstractJoinColumnStateObject> extends AbstractValidatingDialog<T> {
-
- /**
- * Either the join column to edit or <code>null</code> if this state object
- * is used to create a new one.
- */
- private AbstractJoinColumn joinColumn;
-
- /**
- * The owner of the join column to create or where it is located.
- */
- private Object owner;
-
- /**
- * Creates a new <code>AbstractJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public AbstractJoinColumnDialog(Shell parent,
- Object owner,
- AbstractJoinColumn joinColumn) {
-
- super(parent);
-
- this.owner = owner;
- this.joinColumn = joinColumn;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String description() {
- return JptUiMappingsMessages.JoinColumnDialog_description;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String descriptionTitle() {
-
- if (joinColumn == null) {
- return JptUiMappingsMessages.JoinColumnDialog_addJoinColumnDescriptionTitle;
- }
-
- return JptUiMappingsMessages.JoinColumnDialog_editJoinColumnDescriptionTitle;
- }
-
- /**
- * Returns the join column used by this state object for editing or
- * <code>null</code> if this state object is used to create a new one.
- *
- * @return Either the edited join column or <code>null</code>
- */
- public AbstractJoinColumn getJoinColumn() {
- return joinColumn;
- }
-
- /**
- * Returns the owner where the join column is located or where a new one can
- * be added.
- *
- * @return The parent of the join column
- */
- protected Object getOwner() {
- return owner;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String title() {
-
- if (joinColumn == null) {
- return JptUiMappingsMessages.JoinColumnDialog_addJoinColumnTitle;
- }
-
- return JptUiMappingsMessages.JoinColumnDialog_editJoinColumnTitle;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialogPane.java
deleted file mode 100644
index 975c4d528e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnDialogPane.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------- |
- * | Name: | |v| |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Referenced Column Name: | |v| |
- * | ------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see AbstractJoinColumnStateObject
- * @see JoinColumnInJoinTableDialog - A container of this pane
- * @see PrimaryKeyJoinColumnInSecondaryTableDialog - A container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class AbstractJoinColumnDialogPane<T extends AbstractJoinColumnStateObject> extends AbstractDialogPane<T>
-{
- private Combo nameCombo;
- private Combo referencedColumnNameCombo;
-
- /**
- * Creates a new <code>AbstractJoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public AbstractJoinColumnDialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent)
- {
- super(subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(AbstractJoinColumnStateObject.REFERENCED_COLUMN_NAME_PROPERTY);
- propertyNames.add(AbstractJoinColumnStateObject.NAME_PROPERTY);
- }
-
- private ModifyListener buildNameComboListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
-
- if (!isPopulating()) {
- setPopulating(true);
-
- try {
- Combo combo = (Combo) e.widget;
- String value = combo.getText();
- boolean defaultValue = value.equals(combo.getItem(0));
- subject().setName(defaultValue ? null : value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
- };
- }
-
- private ModifyListener buildReferencedColumnNameComboListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
-
- if (!isPopulating()) {
- setPopulating(true);
-
- try {
- Combo combo = (Combo) e.widget;
- String value = combo.getText();
- boolean defaultValue = value.equals(combo.getItem(0));
- subject().setReferencedColumnName(defaultValue ? null : value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateNameCombo();
- populateReferencedNameCombo();
- }
-
- protected final Combo getNameCombo() {
- return nameCombo;
- }
-
- protected final Combo getReferencedColumnNameCombo() {
- return referencedColumnNameCombo;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- nameCombo = buildLabeledEditableCombo(
- container,
- JptUiMappingsMessages.JoinColumnDialog_name,
- buildNameComboListener(),
- JpaHelpContextIds.MAPPING_JOIN_COLUMN_NAME
- );
-
- // Referenced Column Name widgets
- referencedColumnNameCombo = buildLabeledEditableCombo(
- container,
- JptUiMappingsMessages.JoinColumnDialog_referencedColumnName,
- buildReferencedColumnNameComboListener(),
- JpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN
- );
- }
-
- public void populateNameCombo() {
-
- AbstractJoinColumnStateObject subject = subject();
- nameCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- // Add the default column name if one exists
- String defaultName = subject.defaultName();
-
- if (defaultName != null) {
- nameCombo.add(NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam,
- defaultName
- ));
- }
- else {
- nameCombo.add(JptUiMappingsMessages.JoinColumnDialog_defaultEmpty);
- }
-
- // Populate the combo with the column names
- Table nameTable = subject.getNameTable();
-
- if (nameTable != null) {
- Iterator<String> columnNames = nameTable.columnNames();
-
- for (Iterator<String> iter = CollectionTools.sort(columnNames); iter.hasNext(); ) {
- nameCombo.add(iter.next());
- }
- }
-
- // Set the selected name
- String name = subject.getName();
-
- if (name != null) {
- nameCombo.setText(name);
- }
- else {
- nameCombo.select(0);
- }
- }
-
- public void populateReferencedNameCombo() {
-
- AbstractJoinColumnStateObject subject = subject();
- referencedColumnNameCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- // Add the default referenced column name if one exists
- String defaultReferencedColumnName = subject.defaultReferencedColumnName();
-
- if (defaultReferencedColumnName != null) {
- referencedColumnNameCombo.add(NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam,
- defaultReferencedColumnName)
- );
- }
- else {
- referencedColumnNameCombo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- }
-
- // Populate the combo with the column names
- Table referencedNameTable = subject.getReferencedNameTable();
-
- if (referencedNameTable != null) {
- Iterator<String> columnNames = referencedNameTable.columnNames();
-
- for (Iterator<String> iter = CollectionTools.sort(columnNames); iter.hasNext(); ) {
- referencedColumnNameCombo.add(iter.next());
- }
- }
-
- // Set the selected referenced column name
- String referencedColumnName = subject.getReferencedColumnName();
-
- if (referencedColumnName != null) {
- referencedColumnNameCombo.setText(referencedColumnName);
- }
- else {
- referencedColumnNameCombo.select(0);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == AbstractJoinColumnStateObject.NAME_PROPERTY) {
- populateNameCombo();
- }
- else if (propertyName == AbstractJoinColumnStateObject.REFERENCED_COLUMN_NAME_PROPERTY) {
- populateReferencedNameCombo();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnStateObject.java
deleted file mode 100644
index 971b932935..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/AbstractJoinColumnStateObject.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-
-/**
- * The abstract definition of a state object used to edit or create a new
- * join column.
- *
- * @see AbstractJoinColumn
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class AbstractJoinColumnStateObject extends AbstractNode
-{
- /**
- * Either the join column is being edited or <code>null</code> the state
- * object is being created.
- */
- private AbstractJoinColumn joinColumn;
-
- /**
- * The join column's name or <code>null</code> if not defined.
- */
- private String name;
-
- /**
- * The owner of the join column to create or where it is located.
- */
- private Object owner;
-
- /**
- * The referenced column name or <code>null</code> if not defined.
- */
- private String referencedColumnName;
-
- /**
- * Keeps track of the <code>Validator</code> since this is the root object.
- */
- private Validator validator;
-
- /**
- * Identifies a change in the name property.
- */
- public static final String NAME_PROPERTY = "name";
-
- /**
- * Identifies a change in the referenced column name property.
- */
- public static final String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName";
-
- /**
- * Creates a new <code>AbstractJoinColumnStateObject</code>.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public AbstractJoinColumnStateObject(Object owner,
- AbstractJoinColumn joinColumn) {
- super(null);
- initialize(owner, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected final void checkParent(Node parentNode) {
- // This is the root of the Join Column state object
- }
-
- /**
- * Returns the default name if the join column is being edited otherwise
- * <code>null</code> is returned.
- *
- * @return Either the default name defined by the join column or <code>null</code>
- */
- public String defaultName() {
- if (this.joinColumn == null) {
- return null;
- }
-
- return this.joinColumn.getDefaultName();
- }
-
- /**
- * Returns the default referenced column name if the join column is being
- * edited otherwise <code>null</code> is returned.
- *
- * @return Either the default referenced column name defined by the join
- * column or <code>null</code>
- */
- public String defaultReferencedColumnName() {
- if (this.joinColumn == null) {
- return null;
- }
-
- return this.joinColumn.getDefaultReferencedColumnName();
- }
-
- /*
- * (non-Javadoc)
- */
- public final String displayString() {
- return "";
- }
-
- /**
- * Returns the edited join column or <code>null</code> if this state object
- * is used to create a new one.
- *
- * @return The edited join column or <code>null</code>
- */
- public AbstractJoinColumn getJoinColumn() {
- return this.joinColumn;
- }
-
- /**
- * Returns the name of the join column.
- *
- * @return Either join column's name or <code>null</code> to use the default
- * name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Returns the database table if one can be found.
- *
- * @return The database table
- */
- public abstract Table getNameTable();
-
- /**
- * Returns the owner where the join column is located or where a new one can
- * be added.
- *
- * @return The parent of the join column
- */
- public Object getOwner() {
- return owner;
- }
-
- /**
- * Returns the referenced column name of the join column.
- *
- * @return Either join column's referenced column name or <code>null</code>
- * to use the default name
- */
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public abstract Table getReferencedNameTable();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- validator = NULL_VALIDATOR;
- }
-
- /**
- * Initializes this state object.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- protected void initialize(Object owner, AbstractJoinColumn joinColumn) {
-
- this.owner = owner;
- this.joinColumn = joinColumn;
-
- if (joinColumn != null) {
- this.name = joinColumn.getSpecifiedName();
- this.referencedColumnName = joinColumn.getSpecifiedReferencedColumnName();
- }
- }
-
- /**
- * Sets the name of the join column.
- *
- * @param name The new join column's name or <code>null</code> to use the
- * default name
- */
- public void setName(String name) {
- String oldName = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, oldName, name);
- }
-
- /**
- * Sets the referenced column name of the join column.
- *
- * @param referencedColumnName The new join column's referenced column name
- * or <code>null</code> to use the default referenced column name
- */
- public void setReferencedColumnName(String referencedColumnName) {
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, referencedColumnName);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public final void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- /**
- * Updates the given join column with the values contained in this state
- * object.
- *
- * @param joinColumn The join column to update
- */
- public void updateJoinColumn(AbstractJoinColumn joinColumn) {
-
- // Name
- if (valuesAreDifferent(name, joinColumn.getSpecifiedName())) {
- joinColumn.setSpecifiedName(name);
- }
-
- // Referenced Column Name
- if (valuesAreDifferent(referencedColumnName, joinColumn.getSpecifiedReferencedColumnName())) {
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public final Validator validator() {
- return this.validator;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicMappingComposite.java
deleted file mode 100644
index 4cb6642c5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/BasicMappingComposite.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see ColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class BasicMappingComposite extends AbstractFormPane<BasicMapping>
- implements JpaComposite<BasicMapping>
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public BasicMappingComposite(PropertyValueModel<BasicMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<BasicMapping, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(BasicMapping value) {
- return value.getColumn();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- // Column widgets
- new ColumnComposite(this, buildColumnHolder(), container);
-
- // Align the widgets under the ColumnComposite
- container = buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // Fetch Type widgets
- new FetchTypeComposite(this, container);
-
- // Temporal Type widgets
- new TemporalTypeComposite(this, container);
-
- // Enumerated widgets
- new EnumTypeComposite(this, container);
-
- // Optional widgets
- new OptionalComposite(this, buildSubPane(container, 4));
-
- // Lob check box
- new LobComposite(this, container);
- }
-} \ No newline at end of file
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 2201ff7caf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Cascade --------------------------------------------------------------- |
- * | | | |
- * | | x All x Persist x Merge x Remove x Refresh | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Cascade
- * @see RelationshipMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class CascadeComposite extends AbstractFormPane<Cascade>
-{
- /**
- * Creates a new <code>CascadeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject <code>ICascade</code>
- * @param parent The parent container
- */
- public CascadeComposite(AbstractFormPane<? extends RelationshipMapping> parentPane,
- PropertyValueModel<? extends Cascade> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ICascade</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public CascadeComposite(PropertyValueModel<? extends Cascade> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadeTypeAllHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.ALL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isAll();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setAll(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadeTypeMergeHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.MERGE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isMerge();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setMerge(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadeTypePersistHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.PERSIST_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isPersist();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setPersist(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadeTypeRefreshHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.REFRESH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isRefresh();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setRefresh(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadeTypeRemoveHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.REMOVE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isRemove();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setRemove(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Cascade group
- Group cascadeGroup = buildTitledPane(
- container,
- JptUiMappingsMessages.CascadeComposite_cascadeTitle
- );
-
- // Container of the check boxes
- container = buildSubPane(cascadeGroup, 5, 8, 0, 0, 0);
-
- // All check box
- buildCheckBox(
- container,
- JptUiMappingsMessages.CascadeComposite_all,
- buildCascadeTypeAllHolder()
- );
-
- // Persist check box
- buildCheckBox(
- container,
- JptUiMappingsMessages.CascadeComposite_persist,
- buildCascadeTypePersistHolder()
- );
-
- // Merge check box
- buildCheckBox(
- container,
- JptUiMappingsMessages.CascadeComposite_merge,
- buildCascadeTypeMergeHolder()
- );
-
- // Remove check box
- buildCheckBox(
- container,
- JptUiMappingsMessages.CascadeComposite_remove,
- buildCascadeTypeRemoveHolder()
- );
-
- // Refresh check box
- buildCheckBox(
- container,
- JptUiMappingsMessages.CascadeComposite_refresh,
- buildCascadeTypeRefreshHolder()
- );
- }
-} \ No newline at end of file
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 5fa139f0f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ColumnComposite.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.ColumnCombo;
-import org.eclipse.jpt.ui.internal.mappings.db.TableCombo;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnCombo | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TableCombo | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | x Insertable |
- * | |
- * | x Updatable |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Column
- * @see ColumnCombo
- * @see TableCombo
- * @see BasicMappingComposite - A container of this pane
- * @see EmbeddedAttributeOverridesComposite - A container of this pane
- * @see IdMappingComposite - A container of this pane
- * @see VersionMappingComposite - A container of this pane
- *
- * @TODO repopulate this panel based on the Entity table changing
- *
- * @version 2.0
- * @since 1.0
- */
-public class ColumnComposite extends AbstractFormPane<Column>
-{
- private TriStateCheckBox insertableCheckBox;
- private TriStateCheckBox updatableCheckBox;
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject <code>IColumn</code>
- * @param parent The parent container
- */
- public ColumnComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends Column> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject <code>IColumn</code>
- * @param parent The parent container
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- */
- public ColumnComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends Column> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IColumn</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ColumnComposite(PropertyValueModel<? extends Column> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private ColumnCombo<Column> buildColumnCombo(Composite container) {
-
- return new ColumnCombo<Column>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(NamedColumn.DEFAULT_NAME_PROPERTY);
- propertyNames.add(NamedColumn.SPECIFIED_NAME_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedName(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedName();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildInsertableHolder() {
- return new PropertyAspectAdapter<Column, Boolean>(
- getSubjectHolder(),
- Column.DEFAULT_INSERTABLE_PROPERTY,
- Column.SPECIFIED_INSERTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return subject.getSpecifiedInsertable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setSpecifiedInsertable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildInsertableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildInsertableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
-
- if ((subject() != null) && (value == null)) {
-
- Boolean defaultValue = subject().getDefaultInsertable();
-
- if (defaultValue != null) {
-
- String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
- JptUiMappingsMessages.Boolean_False;
-
- return NLS.bind(
- JptUiMappingsMessages.ColumnComposite_insertableWithDefault,
- defaultStringValue
- );
- }
- }
-
- return JptUiMappingsMessages.ColumnComposite_insertable;
- }
- };
- }
-
- private TableCombo<Column> buildTableCombo(Composite container) {
-
- return new TableCombo<Column>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Column.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(Column.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultTable();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedTable(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedTable();
- }
-
- @Override
- protected Iterator<String> values() {
- return subject().owner().typeMapping().associatedTableNamesIncludingInherited();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildUpdatableHolder() {
- return new PropertyAspectAdapter<Column, Boolean>(
- getSubjectHolder(),
- Column.DEFAULT_UPDATABLE_PROPERTY,
- Column.SPECIFIED_UPDATABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return subject.getSpecifiedUpdatable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setSpecifiedUpdatable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildUpdatableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildUpdatableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
-
- if ((subject() != null) && (value == null)) {
-
- Boolean defaultValue = subject().getDefaultUpdatable();
-
- if (defaultValue != null) {
-
- String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
- JptUiMappingsMessages.Boolean_False;
-
- return NLS.bind(
- JptUiMappingsMessages.ColumnComposite_updatableWithDefault,
- defaultStringValue
- );
- }
- }
-
- return JptUiMappingsMessages.ColumnComposite_updatable;
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- insertableCheckBox.setEnabled(enabled);
- updatableCheckBox.setEnabled(enabled);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Column group pane
- container = buildTitledPane(
- container,
- JptUiMappingsMessages.ColumnComposite_columnSection
- );
-
- // Column widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.ColumnChooser_label,
- buildColumnCombo(container),
- JpaHelpContextIds.MAPPING_COLUMN
- );
-
- // Table widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.ColumnTableChooser_label,
- buildTableCombo(container),
- JpaHelpContextIds.MAPPING_COLUMN_TABLE
- );
-
- // Insertable widgets
- insertableCheckBox = buildTriStateCheckBoxWithDefault(
- buildSubPane(container, 4),
- JptUiMappingsMessages.ColumnComposite_insertable,
- buildInsertableHolder(),
- buildInsertableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE
- );
-
- // Updatable widgets
- updatableCheckBox = buildTriStateCheckBoxWithDefault(
- container,
- JptUiMappingsMessages.ColumnComposite_updatable,
- buildUpdatableHolder(),
- buildUpdatableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE
- );
- }
-} \ No newline at end of file
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 ecbfec5faf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddableComposite.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.0
- * @since 2.0
- */
-public class EmbeddableComposite extends AbstractFormPane<Embeddable>
- implements JpaComposite<Embeddable>
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EmbeddableComposite(PropertyValueModel<? extends Embeddable> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- }
-} \ No newline at end of file
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 2c4d381d3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedAttributeOverridesComposite.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | x Override Default |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- * @see EmbeddedMappingComposite - The parent container
- * @see ColumnComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class EmbeddedAttributeOverridesComposite extends AbstractFormPane<EmbeddedMapping>
-{
- private WritablePropertyValueModel<AttributeOverride> attributeOverrideHolder;
-
- /**
- * Creates a new <code>EmbeddedAttributeOverridesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EmbeddedAttributeOverridesComposite(AbstractFormPane<? extends EmbeddedMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EmbeddedAttributeOverridesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EmbeddedAttributeOverridesComposite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private WritablePropertyValueModel<AttributeOverride> buildAttributeOverrideHolder() {
- return new SimplePropertyValueModel<AttributeOverride>();
- }
-
- private ILabelProvider buildAttributeOverrideLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildOverrideDisplayString((AttributeOverride) element);
- }
- };
- }
-
- private Adapter buildAttributeOverridesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- }
- };
- }
-
- private ListValueModel<AttributeOverride> buildAttributeOverridesListHolder() {
- List<ListValueModel<AttributeOverride>> list = new ArrayList<ListValueModel<AttributeOverride>>();
- list.add(buildSpecifiedAttributeOverridesListHolder());
- list.add(buildDefaultAttributeOverridesListHolder());
- return new CompositeListValueModel<ListValueModel<AttributeOverride>, AttributeOverride>(list);
- }
-
- private ListValueModel<AttributeOverride> buildAttributeOverridesListModel() {
- return new ItemPropertyListValueModelAdapter<AttributeOverride>(
- buildAttributeOverridesListHolder(),
- BaseOverride.NAME_PROPERTY
- );
- }
-
- private PropertyValueModel<Column> buildColumnHolder(WritablePropertyValueModel<AttributeOverride> attributeOverrideHolder) {
- return new TransformationPropertyValueModel<AttributeOverride, Column>(attributeOverrideHolder) {
- @Override
- protected Column transform_(AttributeOverride value) {
- return value.getColumn();
- }
- };
- }
-
- private ListValueModel<AttributeOverride> buildDefaultAttributeOverridesListHolder() {
- return new ListAspectAdapter<EmbeddedMapping, AttributeOverride>(
- this.getSubjectHolder(),
- EmbeddedMapping.DEFAULT_ATTRIBUTE_OVERRIDES_LIST)
- {
- @Override
- protected ListIterator<AttributeOverride> listIterator_() {
- return subject.defaultAttributeOverrides();
- }
-
- @Override
- protected int size_() {
- return subject.defaultAttributeOverridesSize();
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildOverrideDefaultAttributeOverrideEnablerHolder() {
- return new TransformationPropertyValueModel<AttributeOverride, Boolean>(attributeOverrideHolder) {
- @Override
- protected Boolean transform(AttributeOverride value) {
- return (value != null);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultAttributeOverrideHolder() {
- return new TransformationWritablePropertyValueModel<AttributeOverride, Boolean>(attributeOverrideHolder) {
- @Override
- public void setValue(Boolean value) {
- updateAssociationOverride(value);
- }
-
- @Override
- protected Boolean transform_(AttributeOverride value) {
- return !value.isVirtual();
- }
- };
- }
-
- private String buildOverrideDisplayString(AttributeOverride override) {
-
- String name = override.getName();
-
- if (StringTools.stringIsEmpty(name)) {
- name = JptUiMappingsMessages.OverridesComposite_noName;
- }
- else {
- name = name.trim();
- }
-
- return name;
- }
-
- private ListValueModel<AttributeOverride> buildSpecifiedAttributeOverridesListHolder() {
- return new ListAspectAdapter<EmbeddedMapping, AttributeOverride>(
- this.getSubjectHolder(),
- EmbeddedMapping.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST)
- {
- @Override
- protected ListIterator<AttributeOverride> listIterator_() {
- return subject.specifiedAttributeOverrides();
- }
-
- @Override
- public int size_() {
- return subject.specifiedAttributeOverridesSize();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- this.attributeOverrideHolder = buildAttributeOverrideHolder();
- }
-
- private AddRemoveListPane<EmbeddedMapping> initializeAttributeOverridesList(Composite container) {
-
- return new AddRemoveListPane<EmbeddedMapping>(
- this,
- buildSubPane(container, 8),
- buildAttributeOverridesAdapter(),
- buildAttributeOverridesListModel(),
- attributeOverrideHolder,
- buildAttributeOverrideLabelProvider(),
- JpaHelpContextIds.MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES
- )
- {
- @Override
- protected void initializeButtonPane(Composite container, String helpId) {
- }
-
- @Override
- protected void updateButtons() {
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Attribute Overrides group box
- container = buildTitledPane(
- container,
- JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides
- );
-
- // Attribute Overrides list
- initializeAttributeOverridesList(container);
-
- // Property pane
- initializePropertyPane(buildSubPane(container, 5, 0));
- }
-
- private void initializePropertyPane(Composite container) {
-
- // Override Default check box
- Button overrideDefaultButton = buildCheckBox(
- buildSubPane(container, 0, groupBoxMargin()),
- JptUiMappingsMessages.AttributeOverridesComposite_overrideDefault,
- buildOverrideDefaultAttributeOverrideHolder()
- );
-
- installOverrideDefaultButtonEnabler(overrideDefaultButton);
-
- // Column widgets
- ColumnComposite columnComposite = new ColumnComposite(
- this,
- buildColumnHolder(attributeOverrideHolder),
- container
- );
-
- installColumnCompositeEnabler(columnComposite);
- }
-
- private void installColumnCompositeEnabler(ColumnComposite columnComposite) {
- new PaneEnabler(
- buildOverrideDefaultAttributeOverrideHolder(),
- columnComposite
- );
- }
-
- private void installOverrideDefaultButtonEnabler(Button overrideDefaultButton) {
- new ControlEnabler(
- buildOverrideDefaultAttributeOverrideEnablerHolder(),
- overrideDefaultButton
- );
- }
-
- private void updateAssociationOverride(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- EmbeddedMapping subject = subject();
- AttributeOverride override = attributeOverrideHolder.value();
-
- // Add a new association override
- if (selected) {
- int index = this.subject().specifiedAttributeOverridesSize();
-
- AttributeOverride attributeOverride = subject.addSpecifiedAttributeOverride(index);
- attributeOverride.setName(override.getName());
- attributeOverride.getColumn().setSpecifiedName(override.getColumn().getName());
-
- attributeOverrideHolder.setValue(attributeOverride);
- }
- // Remove the specified association override
- else {
- String name = override.getName();
- subject.removeSpecifiedAttributeOverride(override);
-
- // Select the default attribute override
- for (Iterator<AttributeOverride> iter = subject.defaultAttributeOverrides(); iter.hasNext(); ) {
- AttributeOverride attributeOverride = iter.next();
-
- if (attributeOverride.getName().equals(name)) {
- attributeOverrideHolder.setValue(attributeOverride);
- break;
- }
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdMappingComposite.java
deleted file mode 100644
index cb496fc858..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedIdMappingComposite.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This pane does not have any widgets.
- *
- * @see EmbeddedIdMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class EmbeddedIdMappingComposite extends AbstractFormPane<EmbeddedIdMapping>
- implements JpaComposite<EmbeddedIdMapping>
-{
- /**
- * Creates a new <code>EmbeddedIdMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEmbeddedIdMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EmbeddedIdMappingComposite(PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite composite) {
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedMappingComposite.java
deleted file mode 100644
index 449615334b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EmbeddedMappingComposite.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see EmbeddedAttributeOverridesComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class EmbeddedMappingComposite extends AbstractFormPane<EmbeddedMapping>
- implements JpaComposite<EmbeddedMapping>
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EmbeddedMappingComposite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- new EmbeddedAttributeOverridesComposite(
- this,
- container
- );
- }
-} \ No newline at end of file
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 4115d45ed7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityComposite.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EntityNameCombo | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Attribute Overrides ------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Secondary Tables ---------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | SecondaryTablesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Inheritance --------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | InheritanceComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see EntityNameCombo
- * @see InheritanceComposite
- * @see OverridesComposite
- * @see SecondaryTablesComposite
- * @see TableComposite
- *
- * TODO talk to JavaEditor people about what we can do to hook in TabbedProperties for the JavaEditor
- *
- * @version 2.0
- * @since 1.0
- */
-public class EntityComposite extends AbstractFormPane<Entity>
- implements JpaComposite<Entity>
-{
- /**
- * Creates a new <code>EntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EntityComposite(PropertyValueModel<? extends Entity> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private Composite buildEntityContainer(Composite container) {
- int groupBoxMargin = groupBoxMargin();
- return buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- private EntityNameCombo buildEntityNameCombo(Composite container) {
- return new EntityNameCombo(this, container);
- }
-
- private PropertyValueModel<Table> buildTableHolder() {
- return new TransformationPropertyValueModel<Entity, Table>(getSubjectHolder()) {
- @Override
- protected Table transform_(Entity value) {
- return value.getTable();
- }
- };
- }
-
- private void initializeAttributeOverridesPane(Composite container) {
-
- container = buildSection(
- container,
- JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides
- );
-
- new OverridesComposite(this, container);
- }
-
- private void initializeGeneralPane(Composite container) {
-
- // Entity Name widgets
- buildLabeledComposite(
- buildEntityContainer(container),
- JptUiMappingsMessages.EntityGeneralSection_name,
- buildEntityNameCombo(container),
- JpaHelpContextIds.ENTITY_NAME
- );
-
- // Table widgets
- new TableComposite(
- this,
- buildTableHolder(),
- buildSubPane(container, 5)
- );
- }
-
- private void initializeInheritancePane(Composite container) {
-
- container = buildSection(
- container,
- JptUiMappingsMessages.EntityComposite_inheritance
- );
-
- new InheritanceComposite(this, container);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- initializeGeneralPane(container);
- initializeAttributeOverridesPane(container);
- initializeSecondaryTablesPane(container);
- initializeInheritancePane(container);
- }
-
- private void initializeSecondaryTablesPane(Composite container) {
-
- container = buildSection(
- container,
- JptUiMappingsMessages.SecondaryTablesComposite_secondaryTables
- );
-
- new SecondaryTablesComposite(this, container);
- }
-} \ No newline at end of file
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 b2baf92904..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EntityNameCombo.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------ |
- * | Entity Name: | I |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EntityComposite - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-public class EntityNameCombo extends AbstractFormPane<Entity>
-{
- private CCombo combo;
-
- /**
- * Creates a new <code>EntityNameCombo</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EntityNameCombo(AbstractFormPane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(java.util.Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Entity.DEFAULT_NAME_PROPERTY);
- propertyNames.add(Entity.SPECIFIED_NAME_PROPERTY);
- }
-
- private ModifyListener buildComboModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
- valueChanged(combo.getText());
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
-
- super.doPopulate();
- populateCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- combo = buildEditableCCombo(container);
- combo.addModifyListener(buildComboModifyListener());
- }
-
- private void populateCombo() {
-
- combo.removeAll();
- populateDefaultValue();
- updateSelectedItem();
- }
-
- /**
- * Adds the default value to the combo if one exists.
- */
- private void populateDefaultValue() {
-
- Entity entity = subject();
- String defaultValue = (entity != null) ? entity.getDefaultName() : null;
-
- if (defaultValue != null) {
- combo.add(NLS.bind(
- JptUiMappingsMessages.EntityGeneralSection_nameDefaultWithOneParam,
- defaultValue
- ));
- }
- else {
- combo.add(JptUiMappingsMessages.EntityGeneralSection_nameDefaultEmpty);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == Entity.DEFAULT_NAME_PROPERTY ||
- propertyName == Entity.SPECIFIED_NAME_PROPERTY) {
-
- updateSelectedItem();
- }
- }
-
- /**
- * Updates the selected item by selected the current value, if not
- * <code>null</code>, or select the default value if one is available,
- * otherwise remove the selection.
- * <p>
- * <b>Note:</b> It seems the text can be shown as truncated, changing the
- * selection to (0, 0) makes the entire text visible.
- */
- private void updateSelectedItem() {
-
- Entity subject = subject();
-
- String value = (subject != null) ? subject.getSpecifiedName() : null;
- String defaultValue = (subject != null) ? subject.getDefaultName() : null;
- String displayString = JptUiMappingsMessages.ColumnComposite_defaultEmpty;
-
- if (defaultValue != null) {
- displayString = NLS.bind(
- JptUiMappingsMessages.ColumnComposite_defaultWithOneParam,
- defaultValue
- );
- }
-
- // Make sure the default value is up to date
- if (!combo.getItem(0).equals(displayString)) {
- combo.remove(0);
- combo.add(displayString, 0);
- }
-
- // Select the new value
- if (value != null) {
- combo.setText(value);
- }
- // Select the default value
- else {
- combo.select(0);
- }
-
- combo.setSelection(new Point(0, 0));
- }
-
- private void valueChanged(String value) {
-
- Entity subject = subject();
- String oldValue = (subject != null) ? subject.getSpecifiedName() : null;
-
- // Check for null value
- if (StringTools.stringIsEmpty(value)) {
- value = null;
-
- if (StringTools.stringIsEmpty(oldValue)) {
- return;
- }
- }
-
- // The default value
- if (value != null &&
- combo.getItemCount() > 0 &&
- value.equals(combo.getItem(0)))
- {
- value = null;
- }
-
- // Nothing to change
- if ((oldValue == value) && value == null) {
- return;
- }
-
- // Set the new value
- if ((value != null) && (oldValue == null) ||
- ((oldValue != null) && !oldValue.equals(value))) {
-
- setPopulating(true);
-
- try {
- subject.setSpecifiedName(value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumTypeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumTypeComposite.java
deleted file mode 100644
index 568a746741..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/EnumTypeComposite.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Enum Type: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see BasicMappingComposite - A container of this widget
- *
- * @version 2.0
- * @since 1.0
- */
-public class EnumTypeComposite extends AbstractFormPane<BasicMapping>
-{
- /**
- * Creates a new <code>FetchTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EnumTypeComposite(AbstractFormPane<? extends BasicMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<BasicMapping, EnumType> buildEnumTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<BasicMapping, EnumType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(BasicMapping.DEFAULT_ENUMERATED_PROPERTY);
- propertyNames.add(BasicMapping.SPECIFIED_ENUMERATED_PROPERTY);
- }
-
- @Override
- protected EnumType[] choices() {
- return EnumType.values();
- }
-
- @Override
- protected EnumType defaultValue() {
- return subject().getDefaultEnumerated();
- }
-
- @Override
- protected String displayString(EnumType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- EnumTypeComposite.this,
- value
- );
- }
-
- @Override
- protected EnumType getValue() {
- return subject().getSpecifiedEnumerated();
- }
-
- @Override
- protected void setValue(EnumType value) {
- subject().setSpecifiedEnumerated(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.BasicGeneralSection_enumeratedLabel,
- buildEnumTypeCombo(container),
- JpaHelpContextIds.MAPPING_ENUMERATED
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/FetchTypeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/FetchTypeComposite.java
deleted file mode 100644
index 1275243c8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/FetchTypeComposite.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Fetch: | |v| |
- * | ------------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Fetchable
- * @see BasicMappingComposite - A container of this widget
- * @see ManyToManyMappingComposite - A container of this widget
- * @see ManyToOneMappingComposite - A container of this widget
- * @see OneToManyMappingComposite - A container of this widget
- * @see OneToOneMappingComposite - A container of this widget
- *
- * @version 2.0
- * @since 1.0
- */
-public class FetchTypeComposite extends AbstractFormPane<Fetchable> {
-
- /**
- * Creates a new <code>FetchTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public FetchTypeComposite(AbstractFormPane<? extends Fetchable> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<Fetchable, FetchType> buildFetchTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<Fetchable, FetchType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Fetchable.DEFAULT_FETCH_PROPERTY);
- propertyNames.add(Fetchable.SPECIFIED_FETCH_PROPERTY);
- }
-
- @Override
- protected FetchType[] choices() {
- return FetchType.values();
- }
-
- @Override
- protected FetchType defaultValue() {
- return subject().getDefaultFetch();
- }
-
- @Override
- protected String displayString(FetchType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- FetchTypeComposite.this,
- value
- );
- }
-
- @Override
- protected FetchType getValue() {
- return subject().getSpecifiedFetch();
- }
-
- @Override
- protected void setValue(FetchType value) {
- subject().setSpecifiedFetch(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.BasicGeneralSection_fetchLabel,
- buildFetchTypeCombo(container),
- JpaHelpContextIds.MAPPING_FETCH_TYPE
- );
- }
-}
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 f2b8bceb27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratedValueComposite.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------- |
- * | Strategy: | I |v| |
- * | --------------------------------------------------------- |
- * | --------------------------------------------------------- |
- * | Generator Name: | I |v| |
- * | --------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see GeneratedValue
- * @see GenerationComposite - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class GeneratedValueComposite extends AbstractFormPane<IdMapping>
-{
- private PropertyChangeListener generatedValuePropertyChangeListener;
- private CCombo generatorNameCombo;
- private PropertyChangeListener generatorNamePropertyChangeListener;
-
- /**
- * Creates a new <code>GeneratedValueComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public GeneratedValueComposite(AbstractFormPane<? extends IdMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyChangeListener buildGeneratedValuePropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildGeneratedValuePropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildGeneratedValuePropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- disengageListeners((GeneratedValue) e.oldValue());
- engageListeners((GeneratedValue) e.newValue());
-
- if (!isPopulating()) {
- setPopulating(true);
-
- try {
- populateGeneratorNameCombo();
- }
- finally {
- setPopulating(false);
- }
- }
- }
- };
- }
-
- private ModifyListener buildGeneratorNameModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (isPopulating()) {
- return;
- }
-
- String generatorName = ((CCombo) e.getSource()).getText();
- GeneratedValue generatedValue = subject().getGeneratedValue();
-
- if (StringTools.stringIsEmpty(generatorName)) {
-
- if ((generatedValue == null) ||
- StringTools.stringIsEmpty(generatedValue.getGenerator()))
- {
- return;
- }
-
- generatorName = null;
- }
-
- retrieveGeneratedValue().setSpecifiedGenerator(generatorName);
- }
- };
- }
-
- private PropertyChangeListener buildGeneratorNamePropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildGeneratorNamePropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildGeneratorNamePropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (!isPopulating()) {
- setPopulating(true);
-
- try {
- populateGeneratorNameCombo();
- }
- finally {
- setPopulating(false);
- }
- }
- }
- };
- }
-
- private PropertyValueModel<GeneratedValue> buildGeneratorValueHolder() {
- return new PropertyAspectAdapter<IdMapping, GeneratedValue>(getSubjectHolder(), IdMapping.GENERATED_VALUE_PROPERTY) {
- @Override
- protected GeneratedValue buildValue_() {
- return subject().getGeneratedValue();
- }
- };
- }
-
- private EnumFormComboViewer<GeneratedValue, GenerationType> buildStrategyComboViewer(Composite parent) {
-
- return new EnumFormComboViewer<GeneratedValue, GenerationType>(this, buildGeneratorValueHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(GeneratedValue.DEFAULT_STRATEGY_PROPERTY);
- propertyNames.add(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY);
- }
-
- @Override
- protected GenerationType[] choices() {
- return GenerationType.values();
- }
-
- @Override
- protected GenerationType defaultValue() {
- return subject().getDefaultStrategy();
- }
-
- @Override
- protected String displayString(GenerationType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- GeneratedValueComposite.this,
- value
- );
- }
-
- @Override
- protected GenerationType getValue() {
- return subject().getSpecifiedStrategy();
- }
-
- @Override
- protected void setValue(GenerationType value) {
- retrieveGeneratedValue().setSpecifiedStrategy(value);
- }
- };
- }
-
- private void disengageListeners(GeneratedValue generatedValue) {
-
- if (generatedValue != null) {
-
- generatedValue.removePropertyChangeListener(
- GeneratedValue.DEFAULT_GENERATOR_PROPERTY,
- generatorNamePropertyChangeListener
- );
-
- generatedValue.removePropertyChangeListener(
- GeneratedValue.SPECIFIED_GENERATOR_PROPERTY,
- generatorNamePropertyChangeListener
- );
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void disengageListeners(IdMapping subject) {
- super.disengageListeners(subject);
-
- if (subject != null) {
- subject.removePropertyChangeListener(
- IdMapping.GENERATED_VALUE_PROPERTY,
- generatedValuePropertyChangeListener
- );
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateGeneratorNameCombo();
- }
-
- private void engageListeners(GeneratedValue generatedValue) {
-
- if (generatedValue != null) {
-
- generatedValue.addPropertyChangeListener(
- GeneratedValue.DEFAULT_GENERATOR_PROPERTY,
- generatorNamePropertyChangeListener
- );
-
- generatedValue.addPropertyChangeListener(
- GeneratedValue.SPECIFIED_GENERATOR_PROPERTY,
- generatorNamePropertyChangeListener
- );
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void engageListeners(IdMapping subject) {
- super.engageListeners(subject);
-
- if (subject != null) {
- subject.addPropertyChangeListener(
- IdMapping.GENERATED_VALUE_PROPERTY,
- generatedValuePropertyChangeListener
- );
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
-
- generatedValuePropertyChangeListener = buildGeneratedValuePropertyChangeListener();
- generatorNamePropertyChangeListener = buildGeneratorNamePropertyChangeListener();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Strategy widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.GeneratedValueComposite_strategy,
- buildStrategyComboViewer(container),
- JpaHelpContextIds.MAPPING_GENERATED_VALUE_STRATEGY
- );
-
- // Generator Name widgets
- generatorNameCombo = buildLabeledEditableCCombo(
- container,
- JptUiMappingsMessages.GeneratedValueComposite_generatorName,
- buildGeneratorNameModifyListener(),
- JpaHelpContextIds.MAPPING_GENERATED_VALUE_STRATEGY
- );
-
- generatorNameCombo.add(JptUiMappingsMessages.TableComposite_defaultEmpty);
- }
-
- private void populateGeneratorName() {
- if (subject() == null) {
- this.generatorNameCombo.setText("");
- }
- else {
- GeneratedValue generatedValue = subject().getGeneratedValue();
-
- if (generatedValue == null) {
- this.generatorNameCombo.setText("");
- }
- else {
- String generatorName = generatedValue.getGenerator();
-
- if (StringTools.stringIsEmpty(generatorName)) {
- this.generatorNameCombo.setText("");
- }
- else if (!this.generatorNameCombo.getText().equals(generatorName)) {
- this.generatorNameCombo.setText(generatorName);
- }
- }
- }
- }
-
- private void populateGeneratorNameCombo() {
- this.generatorNameCombo.removeAll();
- //TODO
-// for (Iterator<String> i = getGeneratorRepository().generatorNames(); i.hasNext(); ){
-// this.generatorNameCombo.add(i.next());
-// }
-
- populateGeneratorName();
- }
-
- private GeneratedValue retrieveGeneratedValue() {
- GeneratedValue generatedValue = subject().getGeneratedValue();
-
- if (generatedValue == null) {
- setPopulating(true);
-
- try {
- generatedValue = subject().addGeneratedValue();
- }
- finally {
- setPopulating(false);
- }
- }
-
- return generatedValue;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GenerationComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GenerationComposite.java
deleted file mode 100644
index 6ccb0eb8de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GenerationComposite.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | v Primary Key Generation |
- * | |
- * | x Primary Key Generation |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | GeneratedValueComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * | |
- * | v Table Generator |
- * | |
- * | x Table Generator |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | TableGeneratorComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * | |
- * | v Sequence Generator |
- * | |
- * | x Sequence Generator |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | SequenceGeneratorComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see GeneratedValueComposite
- * @see TableGeneratorComposite
- * @see SequenceGeneratorComposite
- * @see IdMappingComposite - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-public class GenerationComposite extends AbstractFormPane<IdMapping>
-{
- private WritablePropertyValueModel<Boolean> sequenceGeneratorExpansionStateHolder;
- private WritablePropertyValueModel<Boolean> tableGeneratorExpansionStateHolder;
-
- /**
- * Creates a new <code>GenerationComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public GenerationComposite(AbstractFormPane<? extends IdMapping> parentPane,
- Composite parent)
- {
- super(parentPane, parent, false);
- }
-
- private WritablePropertyValueModel<Boolean> buildPrimaryKeyGenerationHolder() {
- return new PropertyAspectAdapter<IdMapping, Boolean>(getSubjectHolder(), IdMapping.GENERATED_VALUE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getGeneratedValue() != null;
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value && (subject.getGeneratedValue() == null)) {
- subject.addGeneratedValue();
- }
- else if (!value && (subject.getGeneratedValue() != null)) {
- subject.removeGeneratedValue();
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildSequenceGeneratorBooleanHolder() {
- return new PropertyAspectAdapter<IdMapping, Boolean>(getSubjectHolder(), IdMapping.SEQUENCE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getSequenceGenerator() != null;
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value && (subject.getSequenceGenerator() == null)) {
-
- SequenceGenerator sequenceGenerator = subject.addSequenceGenerator();
- GeneratedValue generatedValue = subject.getGeneratedValue();
-
- if ((generatedValue != null) &&
- (generatedValue.getGenerator() != null))
- {
- sequenceGenerator.setName(generatedValue.getGenerator());
- }
- }
- else if (!value && (subject.getSequenceGenerator() != null)) {
- subject.removeSequenceGenerator();
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildTableGeneratorBooleanHolder() {
- return new PropertyAspectAdapter<IdMapping, Boolean>(getSubjectHolder(), IdMapping.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getTableGenerator() != null;
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value && (subject.getTableGenerator() == null)) {
-
- TableGenerator tableGenerator = subject.addTableGenerator();
- GeneratedValue generatedValue = subject.getGeneratedValue();
-
- if ((generatedValue != null) &&
- (generatedValue.getGenerator() != null))
- {
- tableGenerator.setName(generatedValue.getGenerator());
- }
- }
- else if (!value && (subject.getTableGenerator() != null)) {
- subject.removeTableGenerator();
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate()
- {
- super.doPopulate();
-
- sequenceGeneratorExpansionStateHolder.setValue(subject() != null && subject().getSequenceGenerator() != null);
- tableGeneratorExpansionStateHolder .setValue(subject() != null && subject().getTableGenerator() != null);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
-
- sequenceGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(false);
- tableGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(false);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Generation section
- container = buildSection(
- container,
- JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration
- );
-
- // Primary Key Generation check box
- Button primaryKeyGenerationCheckBox = buildCheckBox(
- container,
- JptUiMappingsMessages.IdMappingComposite_primaryKeyGeneration,
- buildPrimaryKeyGenerationHolder(),
- JpaHelpContextIds.MAPPING_PRIMARY_KEY_GENERATION
- );
-
- // Generated Value widgets
- GeneratedValueComposite generatedValueComposite = new GeneratedValueComposite(
- this,
- container
- );
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = primaryKeyGenerationCheckBox.getBorderWidth() + 16;
-
- generatedValueComposite.getControl().setLayoutData(gridData);
-
- // Table Generator pane
- initializeTableGeneratorPane(buildSubPane(container, 5));
-
- // Sequence Generator pane
- initializeSequenceGeneratorPane(buildSubPane(container, 5));
- }
-
- private void initializeSequenceGeneratorPane(Composite container) {
-
- // Sequence Generator sub-section
- container = buildSubSection(
- container,
- JptUiMappingsMessages.IdMappingComposite_sequenceGenerator,
- sequenceGeneratorExpansionStateHolder
- );
-
- // Sequence Generator check box
- Button sequenceGeneratorCheckBox = buildCheckBox(
- container,
- JptUiMappingsMessages.IdMappingComposite_sequenceGenerator,
- buildSequenceGeneratorBooleanHolder(),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR
- );
-
- // Sequence Generator pane
- new SequenceGeneratorComposite(
- this,
- buildSubPane(container, 0, sequenceGeneratorCheckBox.getBorderWidth() + 16)
- );
- }
-
- private void initializeTableGeneratorPane(Composite container) {
-
- // Table Generator sub-section
- container = buildSubSection(
- container,
- JptUiMappingsMessages.IdMappingComposite_tableGenerator,
- tableGeneratorExpansionStateHolder
- );
-
- Button tableGeneratorCheckBox = buildCheckBox(
- container,
- JptUiMappingsMessages.IdMappingComposite_tableGenerator,
- buildTableGeneratorBooleanHolder(),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR
- );
-
- new TableGeneratorComposite(
- this,
- buildSubPane(container, 0, tableGeneratorCheckBox.getBorderWidth() + 16)
- );
- }
-} \ No newline at end of file
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 80a0da6c16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/GeneratorComposite.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * This is the generic pane for a generator.
- *
- * @see IdMapping
- * @see Generator
- * @see SequenceGeneratorComposite - A sub-pane
- * @see TalbeGeneratorComposite - A sub-pane
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public abstract class GeneratorComposite<T extends Generator> extends AbstractFormPane<IdMapping>
-{
- private PropertyChangeListener generatorChangeListener;
- private PropertyValueModel<T> generatorHolder;
- private PropertyChangeListener namePropertyChangeListener;
- private Text nameText;
-
- /**
- * Creates a new <code>GeneratorComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public GeneratorComposite(AbstractFormPane<? extends IdMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates the new <code>IGenerator</code>.
- *
- * @return The newly created <code>IGenerator</code>
- */
- protected abstract T buildGenerator();
-
- private PropertyChangeListener buildGeneratorChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildGeneratorChangeListener_());
- }
-
- @SuppressWarnings("unchecked")
- private PropertyChangeListener buildGeneratorChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
-
- GeneratorComposite.this.uninstallListeners((T) e.oldValue());
-
- if (!isPopulating()) {
- GeneratorComposite.this.repopulate();
- }
-
- GeneratorComposite.this.installListeners((T) e.newValue());
- }
- };
- }
-
- private PropertyValueModel<T> buildGeneratorHolder() {
- return new PropertyAspectAdapter<IdMapping, T>(getSubjectHolder(), propertyName()) {
- @Override
- protected T buildValue_() {
- return GeneratorComposite.this.generator(subject);
- }
- };
- }
-
- private ModifyListener buildGeneratorNameModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- String name = ((Text) e.getSource()).getText();
- updateGeneratorName(name);
- }
- }
- };
- }
-
- private PropertyChangeListener buildNamePropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(buildNamePropertyChangeListener_());
- }
-
- private PropertyChangeListener buildNamePropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (isPopulating()) {
- return;
- }
-
- GeneratorComposite.this.setPopulating(true);
- try {
- GeneratorComposite.this.populateNameViewer();
- }
- finally {
- GeneratorComposite.this.setPopulating(false);
- }
- }
- };
- }
-
- /**
- * Builds the Generator specifiedName viewer.
- *
- * @param parent
- * @return
- */
- protected final Text buildNameText(Composite parent) {
- Text text = this.buildText(parent);
- text.addModifyListener(this.buildGeneratorNameModifyListener());
- return text;
- }
-
- protected void clearNameViewer() {
- this.nameText.setText("");
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void disengageListeners() {
- super.disengageListeners();
-
- this.generatorHolder.removePropertyChangeListener(
- PropertyValueModel.VALUE,
- this.generatorChangeListener
- );
-
- this.uninstallListeners(this.generator());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.populateNameViewer();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void engageListeners() {
- super.engageListeners();
-
- this.generatorHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- this.generatorChangeListener
- );
-
- this.installListeners(this.generator());
- }
-
- protected final T generator() {
- return (subject() == null) ? null : generator(subject());
- }
-
- /**
- * Retrieves without creating the <code>IGenerator</code> from the subject.
- *
- * @param subject The subject used to retrieve the generator
- * @return The <code>IGenerator</code> or <code>null</code> if it doesn't
- * exists
- */
- protected abstract T generator(IdMapping subject);
-
-
- protected JpaProject jpaProject() {
- return subject() == null ? null : subject().jpaProject();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
-
- this.generatorHolder = buildGeneratorHolder();
- this.generatorChangeListener = buildGeneratorChangeListener();
- this.namePropertyChangeListener = buildNamePropertyChangeListener();
- }
-
- protected void installListeners(T generator) {
- if (generator != null) {
- generator.addPropertyChangeListener(Generator.NAME_PROPERTY, this.namePropertyChangeListener);
- }
- }
-
- private void populateNameViewer() {
- Generator generator = this.generator();
-
- if (generator != null) {
- String name = generator.getName();
-
- if (name != null) {
- if (!this.nameText.getText().equals(name)) {
- this.nameText.setText(name);
- this.nameText.setSelection(0, 0);
- }
- }
- else {
- this.clearNameViewer();
- }
- }
- else {
- this.clearNameViewer();
- }
- }
-
- /**
- * Returns the property name used to listen to the ID mapping when the
- * generator changes.
- *
- * @return The property name associated with the generator
- */
- protected abstract String propertyName();
-
- /**
- * Retrieves the <code>IGenerator</code> and if it is <code>null</code>, then
- * create it.
- *
- * @return The <code>IGenerator</code> which should never be <code>null</code>
- */
- protected final T retrieveGenerator() {
- T generator = generator();
-
- if (generator == null) {
- setPopulating(true);
-
- try {
- generator = buildGenerator();
- }
- finally {
- setPopulating(false);
- }
- }
-
- return generator;
- }
-
- protected final void setNameText(Text nameText) {
- this.nameText = nameText;
- }
-
- protected void uninstallListeners(T generator) {
- if (generator != null) {
- generator.removePropertyChangeListener(Generator.NAME_PROPERTY, this.namePropertyChangeListener);
- }
- }
-
- private void updateGeneratorName(String name) {
-
- if (StringTools.stringIsEmpty(name)) {
-
- if (generator().getName() == null) {
- return;
- }
-
- name = null;
- }
-
- setPopulating(true);
-
- try {
- retrieveGenerator().setName(name);
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdMappingComposite.java
deleted file mode 100644
index e94b198b08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/IdMappingComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | GenerationComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see ColumnComposite
- * @see TemporalTypeComposite
- * @see GenerationComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class IdMappingComposite extends AbstractFormPane<IdMapping>
- implements JpaComposite<IdMapping>
-{
- /**
- * Creates a new <code>IdMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IIdMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public IdMappingComposite(PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<? extends Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<IdMapping, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(IdMapping value) {
- return value.getColumn();
- }
- };
- }
-
- private Composite buildPane(Composite container, int groupBoxMargin) {
- return buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- // Column widgets
- new ColumnComposite(this, buildColumnHolder(), container);
-
- // Temporal Type widgets
- new TemporalTypeComposite(this, buildPane(container, groupBoxMargin));
-
- // Generation pane
- new GenerationComposite(this, buildSubPane(container, 10));
- }
-} \ No newline at end of file
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 f9718e2bfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InheritanceComposite.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.ColumnCombo;
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- |
- * | Strategy: | EnumComboViewer |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Column: | ColumnCombo |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Discriminator Type: | EnumComboViewer |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Discriminator Value: | I |v| |
- * | ---------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EntityComposite - The parent container
- * @see ColumnCombo
- * @see EnumComboViewer
- * @see PrimaryKeyJoinColumnsComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class InheritanceComposite extends AbstractFormPane<Entity> {
-
- private CCombo discriminatorValueCombo;
-
- /**
- * Creates a new <code>InheritanceComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public InheritanceComposite(AbstractFormPane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- /**
- * Creates a new <code>InheritanceComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public InheritanceComposite(PropertyValueModel<? extends Entity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Entity.DEFAULT_DISCRIMINATOR_VALUE_PROPERTY);
- propertyNames.add(Entity.SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY);
- }
-
- private ColumnCombo<DiscriminatorColumn> buildColumnCombo(Composite container) {
-
- return new ColumnCombo<DiscriminatorColumn>(
- this,
- buildDiscriminatorColumnHolder(),
- container)
- {
- @Override
- protected String defaultValue() {
- return subject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedName(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedName();
- }
- };
- }
-
- private PropertyValueModel<DiscriminatorColumn> buildDiscriminatorColumnHolder() {
- return new TransformationPropertyValueModel<Entity, DiscriminatorColumn>(getSubjectHolder()) {
- @Override
- protected DiscriminatorColumn transform_(Entity value) {
- return value.getDiscriminatorColumn();
- }
- };
- }
-
- private EnumFormComboViewer<DiscriminatorColumn, DiscriminatorType> buildDiscriminatorTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<DiscriminatorColumn, DiscriminatorType>(
- this,
- buildDiscriminatorColumnHolder(),
- container)
- {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE_PROPERTY);
- propertyNames.add(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY);
- }
-
- @Override
- protected DiscriminatorType[] choices() {
- return DiscriminatorType.values();
- }
-
- @Override
- protected DiscriminatorType defaultValue() {
- return subject().getDefaultDiscriminatorType();
- }
-
- @Override
- protected String displayString(DiscriminatorType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- InheritanceComposite.this,
- value
- );
- }
-
- @Override
- protected DiscriminatorType getValue() {
- return subject().getSpecifiedDiscriminatorType();
- }
-
- @Override
- protected void setValue(DiscriminatorType value) {
- subject().setSpecifiedDiscriminatorType(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDiscriminatorValueBooleanHolder() {
- return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.DISCRIMINATOR_VALUE_ALLOWED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isDiscriminatorValueAllowed();
- }
- };
- }
-
- private ModifyListener buildDiscriminatorValueComboSelectionListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
- discriminatorValueChanged(combo.getText());
- }
- }
- };
- }
-
- private EnumFormComboViewer<Entity, InheritanceType> buildStrategyCombo(Composite container) {
-
- return new EnumFormComboViewer<Entity, InheritanceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Entity.DEFAULT_INHERITANCE_STRATEGY_PROPERTY);
- propertyNames.add(Entity.SPECIFIED_INHERITANCE_STRATEGY_PROPERTY);
- }
-
- @Override
- protected InheritanceType[] choices() {
- return InheritanceType.values();
- }
-
- @Override
- protected InheritanceType defaultValue() {
- return subject().getDefaultInheritanceStrategy();
- }
-
- @Override
- protected String displayString(InheritanceType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- InheritanceComposite.this,
- value
- );
- }
-
- @Override
- protected InheritanceType getValue() {
- return subject().getSpecifiedInheritanceStrategy();
- }
-
- @Override
- protected void setValue(InheritanceType value) {
- subject().setSpecifiedInheritanceStrategy(value);
- }
- };
- }
-
- private void discriminatorValueChanged(String value) {
-
- Entity subject = subject();
- String oldValue = (subject != null) ? subject.getSpecifiedDiscriminatorValue() : null;
-
- // Check for null value
- if (StringTools.stringIsEmpty(value)) {
- value = null;
-
- if (StringTools.stringIsEmpty(oldValue)) {
- return;
- }
- }
-
- // The default value
- if (value != null &&
- discriminatorValueCombo.getItemCount() > 0 &&
- value.equals(discriminatorValueCombo.getItem(0)))
- {
- value = null;
- }
-
- // Nothing to change
- if ((oldValue == value) && value == null) {
- return;
- }
-
- // Set the new value
- if ((value != null) && (oldValue == null) ||
- ((oldValue != null) && !oldValue.equals(value))) {
-
- setPopulating(true);
-
- try {
- subject.setSpecifiedDiscriminatorValue(value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateDiscriminatorValueCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- Composite subPane = buildSubPane(
- container, 0, groupBoxMargin, 0, groupBoxMargin
- );
-
- // Strategy widgets
- buildLabeledComposite(
- subPane,
- JptUiMappingsMessages.InheritanceComposite_strategy,
- buildStrategyCombo(subPane),
- JpaHelpContextIds.ENTITY_INHERITANCE_STRATEGY
- );
-
- // Column widgets
- buildLabeledComposite(
- subPane,
- JptUiMappingsMessages.DiscriminatorColumnComposite_column,
- buildColumnCombo(subPane),
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN
- );
-
- // Discriminator Type widgets
- buildLabeledComposite(
- subPane,
- JptUiMappingsMessages.DiscriminatorColumnComposite_discriminatorType,
- buildDiscriminatorTypeCombo(subPane),
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_TYPE
- );
-
- // Discrinator Value widgets
- discriminatorValueCombo = buildLabeledEditableCCombo(
- subPane,
- JptUiMappingsMessages.InheritanceComposite_discriminatorValue,
- buildDiscriminatorValueComboSelectionListener(),
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE
- );
-
- installDiscriminatorValueComboEnabler(discriminatorValueCombo);
-
- // Primary Key Join Columns widgets
- new PrimaryKeyJoinColumnsComposite(
- this,
- buildSubPane(container, 5)
- );
- }
-
- private void installDiscriminatorValueComboEnabler(CCombo discriminatorValueCombo) {
- new ControlEnabler(
- buildDiscriminatorValueBooleanHolder(),
- discriminatorValueCombo
- );
- }
-
- private void populateDiscriminatorValueCombo() {
-
- Entity subject = subject();
- discriminatorValueCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- // Add the default discriminator column value if one exists
- String defaultDiscriminatorValue = subject.getDefaultDiscriminatorValue();
-
- if (defaultDiscriminatorValue != null) {
- discriminatorValueCombo.add(NLS.bind(
- JptUiMappingsMessages.ColumnComposite_defaultWithOneParam,
- defaultDiscriminatorValue)
- );
- }
- else {
- discriminatorValueCombo.add(NLS.bind(
- JptUiMappingsMessages.DiscriminatorColumnComposite_defaultEmpty,
- defaultDiscriminatorValue)
- );
- }
-
- // Select the discriminator column value
- String specifiedDiscriminatorValue = subject.getSpecifiedDiscriminatorValue();
-
- if (specifiedDiscriminatorValue != null) {
- discriminatorValueCombo.setText(specifiedDiscriminatorValue);
- }
- else {
- discriminatorValueCombo.select(0);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == Entity.DEFAULT_DISCRIMINATOR_VALUE_PROPERTY ||
- propertyName == Entity.SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY)
- {
- populateDiscriminatorValueCombo();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialogPane.java
deleted file mode 100644
index dfbaec191d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnDialogPane.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * See <code>AbstractJoinColumnDialogPane</code> for the layout.
- *
- * @see JoinColumnInJoinTableStateObject
- *
- * @version 2.0
- * @since 2.0
- */
-public class InverseJoinColumnDialogPane extends AbstractJoinColumnDialogPane<JoinColumnInJoinTableStateObject>
-{
- /**
- * Creates a new <code>InverseJoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public InverseJoinColumnDialogPane(PropertyValueModel<JoinColumnInJoinTableStateObject> subjectHolder,
- Composite parent)
- {
- super(subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void populateNameCombo() {
-
- JoinColumnInJoinTableStateObject subject = subject();
-
- Combo nameCombo = getNameCombo();
- nameCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- JoinColumn joinColumn = subject.getJoinColumn();
-
- // Add the default column name if one exists
- String defaultName = (joinColumn != null) ? joinColumn.getDefaultName() : null;
-
- if (defaultName != null) {
- nameCombo.add(NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam,
- defaultName
- ));
- }
- else {
- nameCombo.add(JptUiMappingsMessages.JoinColumnDialog_defaultEmpty);
- }
-
- // Populate the combo with the column names
- JoinTable joinTable = subject.getOwner();
-
- if (joinTable != null) {
- Table joinDBTable = joinTable.dbTable();
-
- if (joinDBTable != null) {
- Iterator<String> columnNames = joinDBTable.columnNames();
-
- for (Iterator<String> iter = CollectionTools.sort(columnNames); iter.hasNext(); ) {
- nameCombo.add(iter.next());
- }
- }
- }
-
- // Set the selected name
- String name = (joinColumn != null) ? joinColumn.getSpecifiedName() : null;
-
- if (name != null) {
- getNameCombo().setText(name);
- }
- else {
- nameCombo.select(0);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void populateReferencedNameCombo() {
-
- JoinColumnInJoinTableStateObject subject = subject();
-
- Combo referencedColumnNameCombo = getReferencedColumnNameCombo();
- referencedColumnNameCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- JoinColumn joinColumn = subject.getJoinColumn();
-
- // Add the default column name if one exists
- String defaultReferencedColumnName = (joinColumn != null) ? joinColumn.getDefaultReferencedColumnName() : null;
-
- if (defaultReferencedColumnName != null) {
- referencedColumnNameCombo.add(NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam,
- defaultReferencedColumnName
- ));
- }
- else {
- referencedColumnNameCombo.add(JptUiMappingsMessages.ColumnComposite_defaultEmpty);
- }
-
- // Populate the combo with the column names
- RelationshipMapping relationshipMapping = subject.relationshipMapping();
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
-
- if (targetEntity != null) {
- Table referencedDbTable = targetEntity.primaryDbTable();
-
- if (referencedDbTable != null) {
- Iterator<String> columnNames = referencedDbTable.columnNames();
-
- for (Iterator<String> iter = CollectionTools.sort(columnNames); iter.hasNext(); ) {
- referencedColumnNameCombo.add(iter.next());
- }
- }
- }
-
- // Set the selected name
- String referencedColumnName = (joinColumn != null) ? joinColumn.getSpecifiedReferencedColumnName() : null;
-
- if (referencedColumnName != null) {
- referencedColumnNameCombo.setText(referencedColumnName);
- }
- else {
- referencedColumnNameCombo.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/InverseJoinColumnInJoinTableDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableDialog.java
deleted file mode 100644
index fd5a1bda00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableDialog.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * @see InverseJoinColumnInJoinTableStateObject
- * @see InverseJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class InverseJoinColumnInJoinTableDialog extends AbstractJoinColumnDialog<InverseJoinColumnInJoinTableStateObject> {
-
- /**
- * Creates a new <code>JoinColumnInJoinTableDialog</code>.
- *
- * @param parent The parent shell
- * @param joinTable The owner of the join column to create or where it is
- * located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public InverseJoinColumnInJoinTableDialog(Shell parent,
- JoinTable joinTable,
- JoinColumn joinColumn) {
-
- super(parent, joinTable, joinColumn);
- }
-
- /*
- * non-Javadoc)
- */
- @Override
- protected AbstractDialogPane<InverseJoinColumnInJoinTableStateObject> buildLayout(Composite container) {
- return new AbstractJoinColumnDialogPane<InverseJoinColumnInJoinTableStateObject>(
- subjectHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected InverseJoinColumnInJoinTableStateObject buildStateObject() {
- return new InverseJoinColumnInJoinTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableStateObject.java
deleted file mode 100644
index 6e04c6d3fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/InverseJoinColumnInJoinTableStateObject.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a join
- * table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see InverseJoinColumnInJoinTableDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class InverseJoinColumnInJoinTableStateObject extends AbstractJoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInJoinTableStateObject</code>.
- *
- * @param joinTable
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public InverseJoinColumnInJoinTableStateObject(JoinTable joinTable,
- JoinColumn joinColumn) {
-
- super(joinTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().dbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- Entity targetEntity = relationshipMapping().getResolvedTargetEntity();
-
- if (targetEntity == null) {
- return null;
- }
-
- return targetEntity.primaryDbTable();
- }
-
- /**
- * Returns the mapping where the join column is located.
- *
- * @return The owner of the join column to create or to edit
- */
- public RelationshipMapping relationshipMapping() {
- return getOwner().parent();
- }
-} \ No newline at end of file
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 e11e33f039..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnComposite.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see SingleRelationshipMapping
- * @see JoinColumn
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- * @see JoinColumnInRelationshipMappingDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnComposite extends AbstractFormPane<SingleRelationshipMapping>
-{
- private WritablePropertyValueModel<JoinColumn> joinColumnHolder;
-
- /**
- * Creates a new <code>JoinColumnComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JoinColumnComposite(AbstractFormPane<? extends SingleRelationshipMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>JoinColumnComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ISingleRelationshipMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JoinColumnComposite(PropertyValueModel<? extends SingleRelationshipMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addJoinColumn() {
-
- JoinColumnInRelationshipMappingDialog dialog =
- new JoinColumnInRelationshipMappingDialog(shell(), subject(), null);
-
- dialog.openDialog(buildAddJoinColumnPostExecution());
- }
-
- private void addJoinColumn(JoinColumnInRelationshipMappingStateObject stateObject) {
-
- SingleRelationshipMapping subject = subject();
- int index = subject.specifiedJoinColumnsSize();
-
- JoinColumn joinColumn = subject.addSpecifiedJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private PostExecution<JoinColumnInRelationshipMappingDialog> buildAddJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInRelationshipMappingDialog>() {
- public void execute(JoinColumnInRelationshipMappingDialog dialog) {
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private PropertyValueModel<JoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<SingleRelationshipMapping, JoinColumn>(getSubjectHolder(), SingleRelationshipMapping.DEFAULT_JOIN_COLUMN) {
- @Override
- protected JoinColumn buildValue_() {
- return subject.getDefaultJoinColumn();
- }
- };
- }
-
- private ListValueModel<JoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<JoinColumn>(buildDefaultJoinColumnHolder());
- }
-
- private PostExecution<JoinColumnInRelationshipMappingDialog> buildEditJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInRelationshipMappingDialog>() {
- public void execute(JoinColumnInRelationshipMappingDialog dialog) {
- if (dialog.wasConfirmed()) {
- updateJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private WritablePropertyValueModel<JoinColumn> buildJoinColumnHolder() {
- return new SimplePropertyValueModel<JoinColumn>();
- }
-
- private String buildJoinColumnLabel(JoinColumn joinColumn) {
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiMappingsMessages.JoinColumnComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
- 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()
- );
- }
- }
-
- private Adapter buildJoinColumnsAdapter() {
- return new AddRemovePane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addJoinColumn();
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiMappingsMessages.JoinColumnComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- editJoinColumn(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- removeJoinColumn(listSelectionModel);
- }
- };
- }
-
- private ListValueModel<JoinColumn> buildJoinColumnsListHolder() {
- java.util.List<ListValueModel<JoinColumn>> list = new ArrayList<ListValueModel<JoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnListHolder());
- return new CompositeListValueModel<ListValueModel<JoinColumn>, JoinColumn>(list);
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- JoinColumn joinColumn = (JoinColumn) element;
- return buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- private ListValueModel<JoinColumn> buildJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<JoinColumn>(buildJoinColumnsListHolder(),
- NamedColumn.SPECIFIED_NAME_PROPERTY,
- NamedColumn.DEFAULT_NAME_PROPERTY,
- AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- AbstractJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY);
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private ListValueModel<JoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<SingleRelationshipMapping, JoinColumn>(getSubjectHolder(), SingleRelationshipMapping.SPECIFIED_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterator<JoinColumn> listIterator_() {
- return subject.specifiedJoinColumns();
- }
-
- @Override
- protected int size_() {
- return subject.specifiedJoinColumnsSize();
- }
- };
- }
-
- private void editJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- JoinColumn joinColumn = (JoinColumn) listSelectionModel.selectedValue();
-
- JoinColumnInRelationshipMappingDialog dialog =
- new JoinColumnInRelationshipMappingDialog(shell(), subject(), joinColumn);
-
- dialog.openDialog(buildEditJoinColumnPostExecution());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- joinColumnHolder = buildJoinColumnHolder();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Join Columns group
- Group groupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.JoinColumnComposite_joinColumn
- );
-
- // Override Default Join Columns check box
- buildCheckBox(
- buildSubPane(groupPane, 8),
- JptUiMappingsMessages.JoinColumnComposite_overrideDefaultJoinColumns,
- buildOverrideDefaultJoinColumnHolder()
- );
-
- // Join Columns list pane
- AddRemoveListPane<SingleRelationshipMapping> joinColumnsListPane =
- new AddRemoveListPane<SingleRelationshipMapping>(
- this,
- groupPane,
- buildJoinColumnsAdapter(),
- buildJoinColumnsListModel(),
- joinColumnHolder,
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
-
- installJoinColumnsListPaneEnabler(joinColumnsListPane);
- }
-
- private void installJoinColumnsListPaneEnabler(AddRemoveListPane<SingleRelationshipMapping> pane) {
- new PaneEnabler(
- buildOverrideDefaultJoinColumnHolder(),
- pane
- );
- }
-
- private void removeJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- subject().removeSpecifiedJoinColumn(selectedIndices[index]);
- }
- }
-
- private void updateJoinColumn(JoinColumnInRelationshipMappingStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- private void updateJoinColumns(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- SingleRelationshipMapping subject = subject();
-
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- JoinColumn defaultJoinColumn = subject.getDefaultJoinColumn();//TODO could be null, disable override default check box?
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- JoinColumn joinColumn = subject.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- joinColumnHolder.setValue(joinColumn);
- }
- }
- // Remove all the specified join columns
- else {
- for (int index = subject.specifiedJoinColumnsSize(); --index >= 0; ) {
- subject.removeSpecifiedJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return listHolder.size() > 0;
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value);
- }
- }
-} \ No newline at end of file
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 7ccbfe2b2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialog.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.context.JoinColumn;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The abstract definition of the dialog used to edit an <code>IJoinColumn</code>.
- *
- * @see JoinColumn
- * @see JoinColumnStateObject
- * @see JoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class JoinColumnDialog<T extends JoinColumnStateObject> extends AbstractJoinColumnDialog<T> {
-
- /**
- * Creates a new <code>AbstractJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public JoinColumnDialog(Shell parent, Object owner, JoinColumn joinColumn) {
- super(parent, owner, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AbstractDialogPane<?> buildLayout(Composite container) {
- return new JoinColumnDialogPane(subjectHolder(), container);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialogPane.java
deleted file mode 100644
index 6461e47a5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnDialogPane.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Table: | TableCombo |v| |
- * | ------------------------------------------------------------------ |
- * | |
- * | x Insertable |
- * | |
- * | x Updatable |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinColumnStateObject
- * @see JoinColumnDialog - The parent container
- * @see EnumDialogComboViewer
- *
- * @version 2.0
- * @since 1.0
- */
-public class JoinColumnDialogPane extends AbstractJoinColumnDialogPane<JoinColumnStateObject>
-{
- private Combo tableCombo;
-
- /**
- * Creates a new <code>JoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public JoinColumnDialogPane(PropertyValueModel<? extends JoinColumnStateObject> subjectHolder,
- Composite parent)
- {
- super(subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(JoinColumnStateObject.TABLE_PROPERTY);
- }
-
- private WritablePropertyValueModel<Boolean> buildInsertableHolder() {
- return new PropertyAspectAdapter<JoinColumnStateObject, Boolean>(getSubjectHolder(), JoinColumnStateObject.INSERTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getInsertable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setInsertable(value);
- }
-
- @Override
- protected void subjectChanged() {
- Object oldValue = this.value();
- super.subjectChanged();
- Object newValue = this.value();
-
- // Make sure the default value is appended to the text
- if (oldValue == newValue && newValue == null) {
- this.fireAspectChange(Boolean.TRUE, newValue);
- }
- }
- };
- }
-
- private PropertyValueModel<String> buildInsertableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildInsertableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
-
- if ((subject() != null) && (value == null)) {
-
- Boolean defaultValue = subject().getDefaultInsertable();
-
- if (defaultValue != null) {
-
- String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
- JptUiMappingsMessages.Boolean_False;
-
- return NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_insertableWithDefault,
- defaultStringValue
- );
- }
- }
-
- return JptUiMappingsMessages.JoinColumnDialog_insertable;
- }
- };
- }
-
- private ModifyListener buildTableComboSelectionListener() {
- return new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
-
- if (!isPopulating()) {
- setPopulating(true);
-
- try {
- Combo combo = (Combo) e.widget;
- String value = combo.getText();
- boolean defaultValue = value.equals(combo.getItem(0));
- subject().setTable(defaultValue ? null : value);
- populateNameCombo();
- }
- finally {
- setPopulating(false);
- }
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildUpdatableHolder() {
- return new PropertyAspectAdapter<JoinColumnStateObject, Boolean>(getSubjectHolder(), JoinColumnStateObject.UPDATABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getUpdatable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setUpdatable(value);
- }
-
- @Override
- protected void subjectChanged() {
- Object oldValue = this.value();
- super.subjectChanged();
- Object newValue = this.value();
-
- // Make sure the default value is appended to the text
- if (oldValue == newValue && newValue == null) {
- this.fireAspectChange(Boolean.TRUE, newValue);
- }
- }
- };
- }
-
- private PropertyValueModel<String> buildUpdatableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildUpdatableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
-
- if ((subject() != null) && (value == null)) {
-
- Boolean defaultValue = subject().getDefaultUpdatable();
-
- if (defaultValue != null) {
-
- String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
- JptUiMappingsMessages.Boolean_False;
-
- return NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_updatableWithDefault,
- defaultStringValue
- );
- }
- }
-
- return JptUiMappingsMessages.JoinColumnDialog_updatable;
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateTableCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- super.initializeLayout(container);
-
- // Join Referenced Column widgets
- tableCombo = buildLabeledEditableCombo(
- container,
- JptUiMappingsMessages.JoinColumnDialog_table,
- buildTableComboSelectionListener(),
- JpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN
- );
-
- // Insertable check box
- buildTriStateCheckBoxWithDefault(
- buildSubPane(container, 4),
- JptUiMappingsMessages.JoinColumnDialog_insertable,
- buildInsertableHolder(),
- buildInsertableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE
- );
-
- // Updatable check box
- buildTriStateCheckBoxWithDefault(
- container,
- JptUiMappingsMessages.JoinColumnDialog_updatable,
- buildUpdatableHolder(),
- buildUpdatableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE
- );
- }
-
- private void populateTableCombo() {
- JoinColumnStateObject subject = subject();
- tableCombo.removeAll();
-
- if (subject == null) {
- return;
- }
-
- // Add the default table if one exists
- String defaultTableName = subject.defaultTableName();
-
- if (defaultTableName != null) {
- tableCombo.add(NLS.bind(
- JptUiMappingsMessages.JoinColumnDialog_defaultWithOneParam,
- defaultTableName
- ));
- }
- else {
- tableCombo.add(JptUiMappingsMessages.JoinColumnDialog_defaultEmpty);
- }
-
- // Populate the combo with the table names
- Schema schema = subject.getSchema();
-
- if (schema != null) {
- Iterator<String> tables = schema.tableNames();
-
- for (Iterator<String> iter = CollectionTools.sort(tables); iter.hasNext(); ) {
- tableCombo.add(iter.next());
- }
- }
-
- // Update the selected table
- String table = subject.getTable();
-
- if (table != null) {
- tableCombo.setText(table);
- }
- else {
- tableCombo.select(0);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == JoinColumnStateObject.TABLE_PROPERTY) {
- populateTableCombo();
- }
- }
-} \ No newline at end of file
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 c1ec3e43e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideDialog.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is located
- * on an association override.
- *
- * @see JoinColumn
- * @see AssociationOverride
- * @see JoinColumnInAssociationOverrideStateObject
- * @see JoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInAssociationOverrideDialog extends JoinColumnDialog<JoinColumnInAssociationOverrideStateObject> {
-
- /**
- * Creates a new <code>JoinColumnInAssociationOverrideDialog</code>.
- *
- * @param parent The parent shell
- * @param associationOverride The owner of the join column to create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public JoinColumnInAssociationOverrideDialog(Shell parent,
- AssociationOverride associationOverride,
- JoinColumn joinColumn) {
-
- super(parent, associationOverride, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected JoinColumnInAssociationOverrideStateObject buildStateObject() {
- return new JoinColumnInAssociationOverrideStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AssociationOverride getOwner() {
- return (AssociationOverride) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideStateObject.java
deleted file mode 100644
index d549323f8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInAssociationOverrideStateObject.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInAssociationOverrideStateObject extends JoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInAssociationOverrideStateObject</code>.
- *
- * @param associationOverride The owner of the join column to create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public JoinColumnInAssociationOverrideStateObject(AssociationOverride associationOverride,
- JoinColumn joinColumn) {
- super(associationOverride, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String defaultTableName() {
- if (getJoinColumn() != null) {
- return getJoinColumn().getDefaultTable();
- }
-
- return typeMapping().tableName();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return typeMapping().primaryDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public AssociationOverride getOwner() {
- return (AssociationOverride) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
-
- AssociationOverride associationOverride = getOwner();
- RelationshipMapping relationshipMapping = associationOverride.owner().relationshipMapping(associationOverride.getName());
-
- if (relationshipMapping == null){
- return null;
- }
-
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
-
- if (targetEntity != null) {
- return targetEntity.primaryDbTable();
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Schema getSchema() {
- return typeMapping().dbSchema();
- }
-
- /**
- * Returns the mapping where the join column is located.
- *
- * @return The owner of the join column to create or to edit
- */
- public TypeMapping typeMapping() {
- return getOwner().owner().typeMapping();
- }
-} \ No newline at end of file
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 56f22d92f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableDialog.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is located
- * on a join table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see JoinColumnInJoinTableStateObject
- * @see AbstractJoinColumnDialogPane
- *
- * @version 2.0
- * @since 1.0
- */
-public class JoinColumnInJoinTableDialog extends AbstractJoinColumnDialog<JoinColumnInJoinTableStateObject> {
-
- /**
- * Creates a new <code>JoinColumnInJoinTableDialog</code>.
- *
- * @param parent The parent shell
- * @param joinTable The parent of the join column to edit or to create
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public JoinColumnInJoinTableDialog(Shell parent,
- JoinTable joinTable,
- JoinColumn joinColumn) {
-
- super(parent, joinTable, joinColumn);
- }
-
- /*
- * non-Javadoc)
- */
- @Override
- protected AbstractDialogPane<JoinColumnInJoinTableStateObject> buildLayout(Composite container) {
- return new AbstractJoinColumnDialogPane<JoinColumnInJoinTableStateObject>(
- subjectHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected JoinColumnInJoinTableStateObject buildStateObject() {
- return new JoinColumnInJoinTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableStateObject.java
deleted file mode 100644
index 9b033eb236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInJoinTableStateObject.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a
- * joint table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see InverseJoinColumnDialog
- * @see InverseJoinColumnDialogPane
- * @see JoinColumnInJoinTableDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInJoinTableStateObject extends AbstractJoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInJoinTableStateObject</code>.
- *
- * @param joinTable The owner of the join column to create or to edit
- * @param joinColumn The join column to edit
- */
- public JoinColumnInJoinTableStateObject(JoinTable joinTable,
- JoinColumn joinColumn) {
- super(joinTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().dbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- return relationshipMapping().typeMapping().primaryDbTable();
- }
-
- /**
- * Returns the mapping owning the join table.
- *
- * @return The parent of the join table
- */
- public RelationshipMapping relationshipMapping() {
- return getOwner().parent();
- }
-} \ 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 8784d8f36c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingDialog.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is located
- * on a relational mapping.
- *
- * @see JoinColumn
- * @see RelationshipMapping
- * @see JoinColumnInRelationshipMappingStateObject
- * @see JoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInRelationshipMappingDialog extends JoinColumnDialog<JoinColumnInRelationshipMappingStateObject> {
-
- /**
- * Creates a new <code>AbstractJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param relationshipMapping The owner of the join column to edit or to
- * create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- JoinColumnInRelationshipMappingDialog(Shell parent,
- RelationshipMapping relationshipMapping,
- JoinColumn joinColumn) {
-
- super(parent, relationshipMapping, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected JoinColumnInRelationshipMappingStateObject buildStateObject() {
- return new JoinColumnInRelationshipMappingStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected RelationshipMapping getOwner() {
- return (RelationshipMapping) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingStateObject.java
deleted file mode 100644
index 7caee0ee73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnInRelationshipMappingStateObject.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a
- * relationship mapping.
- *
- * @see JoinColumn
- * @see RelationshipMapping
- * @see JoinColumnInRelationshipMappingDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInRelationshipMappingStateObject extends JoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInRelationshipMappingStateObject</code>.
- *
- * @param relationshipMapping The owner of the join column to create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public JoinColumnInRelationshipMappingStateObject(RelationshipMapping relationshipMapping,
- JoinColumn joinColumn) {
- super(relationshipMapping, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String defaultTableName() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.getDefaultTable();
- }
-
- return getOwner().typeMapping().tableName();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- Schema schema = getSchema();
- return (schema == null) ? null : schema.tableNamed(tableName());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public RelationshipMapping getOwner() {
- return (RelationshipMapping) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- Entity targetEntity = getOwner().getResolvedTargetEntity();
-
- if (targetEntity != null) {
- return targetEntity.primaryDbTable();
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Schema getSchema() {
- return getOwner().typeMapping().dbSchema();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnStateObject.java
deleted file mode 100644
index 05cf4079cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnStateObject.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class JoinColumnStateObject extends AbstractJoinColumnStateObject
-{
- private Boolean insertable;
- private String table;
- private Boolean updatable;
-
- public static final String INSERTABLE_PROPERTY = "insertable";
- public static final String TABLE_PROPERTY = "table";
- public static final String UPDATABLE_PROPERTY = "updatable";
-
- /**
- * Creates a new <code>JoinColumnStateObject</code>.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn The join column to edit
- */
- public JoinColumnStateObject(Object owner, JoinColumn joinColumn) {
- super(owner, joinColumn);
- }
-
- public abstract String defaultTableName();
-
- public Boolean getDefaultInsertable() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.getDefaultInsertable();
- }
-
- return null;
- }
-
- public Boolean getDefaultUpdatable() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.getDefaultUpdatable();
- }
-
- return null;
- }
-
- public Boolean getInsertable() {
- return insertable;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- return null;
- }
-
- public abstract Schema getSchema();
-
- public String getTable() {
- return table;
- }
-
- public Boolean getUpdatable() {
- return updatable;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize(Object owner,
- AbstractJoinColumn abstractJoinColumn) {
-
- super.initialize(owner, abstractJoinColumn);
-
- if (abstractJoinColumn != null) {
- JoinColumn joinColumn = (JoinColumn) abstractJoinColumn;
-
- table = joinColumn.getSpecifiedTable();
- insertable = joinColumn.getSpecifiedInsertable();
- updatable = joinColumn.getSpecifiedUpdatable();
- }
- }
-
- public void setInsertable(Boolean insertable) {
- Boolean oldInsertable = this.insertable;
- this.insertable = insertable;
- firePropertyChanged(INSERTABLE_PROPERTY, oldInsertable, insertable);
- }
-
- public void setTable(String table) {
- String oldTable = this.table;
- this.table = table;
- firePropertyChanged(TABLE_PROPERTY, oldTable, table);
- }
-
- public void setUpdatable(Boolean updatable) {
- Boolean oldUpdatable = this.updatable;
- this.updatable = updatable;
- firePropertyChanged(UPDATABLE_PROPERTY, oldUpdatable, updatable);
- }
-
- public String specifiedTableName() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.getSpecifiedTable();
- }
-
- return null;
- }
-
- public String tableName() {
- return (specifiedTableName() == null) ? defaultTableName() : specifiedTableName();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void updateJoinColumn(AbstractJoinColumn abstractJoinColumn) {
-
- super.updateJoinColumn(abstractJoinColumn);
-
- JoinColumn joinColumn = (JoinColumn) abstractJoinColumn;
-
- // Table
- if (valuesAreDifferent(table, joinColumn.getSpecifiedTable())) {
- joinColumn.setSpecifiedTable(table);
- }
-
- // Insertable
- if (joinColumn.getSpecifiedInsertable() != insertable){
- joinColumn.setSpecifiedInsertable(insertable);
- }
-
- // Updatable
- if (joinColumn.getSpecifiedUpdatable() != updatable){
- joinColumn.setSpecifiedUpdatable(updatable);
- }
- }
-} \ No newline at end of file
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 764a2de9a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinColumnsComposite.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.AbstractAdapter;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinTableComposite - A container of this pane
- * @see OverridesComposite - A container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnsComposite<T extends JpaNode> extends AbstractFormPane<T>
-{
- /**
- * The editor used to perform the common behaviors defined in the list pane.
- */
- private IJoinColumnsEditor<T> joinColumnsEditor;
-
- /**
- * Keeps track of the list pane in order to update its enablement state when
- * required.
- */
- private AddRemoveListPane<T> joinColumnsListPane;
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- * @param joinColumnsEditor The editor used to perform the common behaviors
- * defined in the list pane
- */
- public JoinColumnsComposite(AbstractFormPane<? extends T> parentPane,
- Composite parent,
- IJoinColumnsEditor<T> joinColumnsEditor) {
-
- super(parentPane, parent);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- * @param joinColumnsEditor The editor used to perform the common behaviors
- * defined in the list pane
- */
- public JoinColumnsComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- IJoinColumnsEditor<T> joinColumnsEditor,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JoinColumnsComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory,
- IJoinColumnsEditor<T> joinColumnsEditor) {
-
- super(subjectHolder, parent, widgetFactory);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- private WritablePropertyValueModel<JoinColumn> buildJoinColumnHolder() {
- return new SimplePropertyValueModel<JoinColumn>();
- }
-
- private String buildJoinColumnLabel(JoinColumn joinColumn) {
-
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
- 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()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiMappingsMessages.JoinTableComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private Adapter buildJoinColumnsAdapter() {
- return new AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- joinColumnsEditor.addJoinColumn(subject());
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiMappingsMessages.JoinColumnComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- JoinColumn joinColumn = (JoinColumn) listSelectionModel.selectedValue();
- joinColumnsEditor.editJoinColumn(subject(), joinColumn);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- joinColumnsEditor.removeJoinColumns(subject(), listSelectionModel.selectedIndices());
- }
- };
- }
-
- private ListValueModel<JoinColumn> buildJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<JoinColumn>(buildJoinColumnsListHolder(),
- NamedColumn.SPECIFIED_NAME_PROPERTY,
- NamedColumn.DEFAULT_NAME_PROPERTY,
- AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- AbstractJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY);
- }
-
- private ListValueModel<JoinColumn> buildJoinColumnsListHolder() {
- java.util.List<ListValueModel<JoinColumn>> list = new ArrayList<ListValueModel<JoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnListHolder());
- return new CompositeListValueModel<ListValueModel<JoinColumn>, JoinColumn>(list);
- }
-
- private ListValueModel<JoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<T, JoinColumn>(getSubjectHolder(), joinColumnsEditor.specifiedListPropertyName()) {
- @Override
- protected ListIterator<JoinColumn> listIterator_() {
- return joinColumnsEditor.specifiedJoinColumns(subject);
- }
-
- @Override
- protected int size_() {
- return joinColumnsEditor.specifiedJoinColumnsSize(subject);
- }
- };
- }
-
-
- private ListValueModel<JoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<JoinColumn>(buildDefaultJoinColumnHolder());
-
- }
-
- private PropertyValueModel<JoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<T, JoinColumn>(getSubjectHolder(), joinColumnsEditor.defaultPropertyName()) {
- @Override
- protected JoinColumn buildValue_() {
- return joinColumnsEditor.defaultJoinColumn(subject);
- }
- };
- }
-
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- JoinColumn joinColumn = (JoinColumn) element;
-
- return buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- joinColumnsListPane.enableWidgets(enabled);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- }
-
- private void initializeLayout2() {
-
- // Join Columns list pane
- joinColumnsListPane = new AddRemoveListPane<T>(
- this,
- getControl(),
- buildJoinColumnsAdapter(),
- buildJoinColumnsListModel(),
- buildJoinColumnHolder(),
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
- }
-
- /**
- * The editor is used to complete the behavior of this pane.
- */
- public static interface IJoinColumnsEditor<T> {
-
- void addJoinColumn(T subject);
- void editJoinColumn(T subject, JoinColumn joinColumn);
- boolean hasSpecifiedJoinColumns(T subject);
- ListIterator<JoinColumn> specifiedJoinColumns(T subject);
- int specifiedJoinColumnsSize(T subject);
- JoinColumn defaultJoinColumn(T subject);
- String specifiedListPropertyName();
- String defaultPropertyName();
- void removeJoinColumns(T subject, int[] selectedIndices);
- }
-} \ 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 6b681e03b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/JoinTableComposite.java
+++ /dev/null
@@ -1,531 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.TableCombo;
-import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.IJoinColumnsEditor;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.SelectionAdapter;
-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.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------------- |
- * | Name: | |v| |
- * | --------------------------------------------------------------- |
- * | |
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - Inverse Join Columns -------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinTable
- * @see OneToManyMappingComposite - A container of this pane
- * @see ManyToManyMappingComposite - A container of this pane
- * @see JoinColumnsComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class JoinTableComposite extends AbstractFormPane<JoinTable>
-{
- private JoinColumnsComposite<JoinTable> inverseJoinColumnsComposite;
- private JoinColumnsComposite<JoinTable> joinColumnsComposite;
- private Button overrideDefaultInverseJoinColumnsCheckBox;
- private Button overrideDefaultJoinColumnsCheckBox;
-
- /**
- * Creates a new <code>JoinTableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public JoinTableComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends JoinTable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- /**
- * Creates a new <code>JoinTableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IJoinTable</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JoinTableComposite(PropertyValueModel<? extends JoinTable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addInverseJoinColumn(JoinTable joinTable) {
-
- InverseJoinColumnInJoinTableDialog dialog =
- new InverseJoinColumnInJoinTableDialog(shell(), joinTable, null);
-
- dialog.openDialog(buildAddInverseJoinColumnPostExecution());
- }
-
- private void addInverseJoinColumnFromDialog(InverseJoinColumnInJoinTableStateObject stateObject) {
-
- JoinTable subject = subject();
- int index = subject.specifiedInverseJoinColumnsSize();
-
- JoinColumn joinColumn = subject.addSpecifiedInverseJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private void addJoinColumn(JoinTable joinTable) {
-
- JoinColumnInJoinTableDialog dialog =
- new JoinColumnInJoinTableDialog(shell(), joinTable, null);
-
- dialog.openDialog(buildAddJoinColumnPostExecution());
- }
-
- private void addJoinColumnFromDialog(JoinColumnInJoinTableStateObject stateObject) {
-
- JoinTable subject = subject();
- int index = subject.specifiedJoinColumnsSize();
-
- JoinColumn joinColumn = subject().addSpecifiedJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private PostExecution<InverseJoinColumnInJoinTableDialog> buildAddInverseJoinColumnPostExecution() {
- return new PostExecution<InverseJoinColumnInJoinTableDialog>() {
- public void execute(InverseJoinColumnInJoinTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- addInverseJoinColumnFromDialog(dialog.subject());
- }
- }
- };
- }
-
- private PostExecution<JoinColumnInJoinTableDialog> buildAddJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInJoinTableDialog>() {
- public void execute(JoinColumnInJoinTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- addJoinColumnFromDialog(dialog.subject());
- }
- }
- };
- }
-
- private PostExecution<InverseJoinColumnInJoinTableDialog> buildEditInverseJoinColumnPostExecution() {
- return new PostExecution<InverseJoinColumnInJoinTableDialog>() {
- public void execute(InverseJoinColumnInJoinTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- editInverseJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private PostExecution<JoinColumnInJoinTableDialog> buildEditJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInJoinTableDialog>() {
- public void execute(JoinColumnInJoinTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- editJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private InverseJoinColumnsProvider buildInverseJoinColumnsEditor() {
- return new InverseJoinColumnsProvider();
- }
-
- private JoinColumnsProvider buildJoinColumnsEditor() {
- return new JoinColumnsProvider();
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultHolder() {
- return new SimplePropertyValueModel<Boolean>();
- }
-
- private SelectionListener buildOverrideDefaultInverseSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateInverseJoinColumns();
- }
- };
- }
-
- private SelectionListener buildOverrideDefaultSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateJoinColumns();
- }
- };
- }
-
- private Composite buildPane(Composite container, int groupBoxMargin) {
- return buildSubPane(container, 0, groupBoxMargin, 10, groupBoxMargin);
- }
-
- private TableCombo<JoinTable> buildTableCombo(Composite container) {
-
- return new TableCombo<JoinTable>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_NAME_PROPERTY);
- propertyNames.add(Table.SPECIFIED_NAME_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedName(value);
- }
-
- @Override
- protected org.eclipse.jpt.db.internal.Table table() {
- return subject().dbTable();
- }
-
- private Schema tableSchema() {
- return database().schemaNamed(subject().getSchema());
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedName();
- }
-
- @Override
- protected Iterator<String> values() {
- Schema schema = tableSchema();
-
- if (schema != null) {
- return schema.tableNames();
- }
-
- return EmptyIterator.instance();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
-
- JoinTable subject = subject();
- boolean enabled = (subject != null) && subject.containsSpecifiedJoinColumns();
- boolean inverseEnabled = (subject != null) && subject.containsSpecifiedInverseJoinColumns();
-
- overrideDefaultJoinColumnsCheckBox.setSelection(enabled);
- overrideDefaultInverseJoinColumnsCheckBox.setSelection(inverseEnabled);
-
- joinColumnsComposite.enableWidgets(enabled);
- inverseJoinColumnsComposite.enableWidgets(inverseEnabled);
- }
-
- private void editInverseJoinColumn(JoinColumn joinColumn) {
-
- InverseJoinColumnInJoinTableDialog dialog =
- new InverseJoinColumnInJoinTableDialog(shell(), subject(), joinColumn);
-
- dialog.openDialog(buildEditInverseJoinColumnPostExecution());
- }
-
- private void editJoinColumn(JoinColumn joinColumn) {
-
- JoinColumnInJoinTableDialog dialog =
- new JoinColumnInJoinTableDialog(shell(), subject(), joinColumn);
-
- dialog.openDialog(buildEditJoinColumnPostExecution());
- }
-
- private void editJoinColumn(JoinColumnInJoinTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- private void editInverseJoinColumn(InverseJoinColumnInJoinTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- // Name widgets
- TableCombo<JoinTable> tableCombo = buildTableCombo(container);
-
- buildLabeledComposite(
- buildPane(container, groupBoxMargin),
- JptUiMappingsMessages.JoinTableComposite_name,
- tableCombo.getControl(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_NAME
- );
-
- // Join Columns group pane
- Group joinColumnGroupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.JoinTableComposite_joinColumn
- );
-
- // Override Default Join Columns check box
- overrideDefaultJoinColumnsCheckBox = buildCheckBox(
- buildSubPane(joinColumnGroupPane, 8),
- JptUiMappingsMessages.JoinTableComposite_overrideDefaultJoinColumns,
- buildOverrideDefaultHolder()
- );
-
- overrideDefaultJoinColumnsCheckBox.addSelectionListener(
- buildOverrideDefaultSelectionListener()
- );
-
- joinColumnsComposite = new JoinColumnsComposite<JoinTable>(
- this,
- joinColumnGroupPane,
- buildJoinColumnsEditor()
- );
-
- // Inverse Join Columns group pane
- Group inverseJoinColumnGroupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.JoinTableComposite_inverseJoinColumn
- );
-
- // Override Default Inverse Join Columns check box
- overrideDefaultInverseJoinColumnsCheckBox = buildCheckBox(
- buildSubPane(inverseJoinColumnGroupPane, 8),
- JptUiMappingsMessages.JoinTableComposite_overrideDefaultInverseJoinColumns,
- buildOverrideDefaultHolder()
- );
-
- overrideDefaultInverseJoinColumnsCheckBox.addSelectionListener(
- buildOverrideDefaultInverseSelectionListener()
- );
-
- inverseJoinColumnsComposite = new JoinColumnsComposite<JoinTable>(
- this,
- inverseJoinColumnGroupPane,
- buildInverseJoinColumnsEditor()
- );
- }
-
- private void updateInverseJoinColumns() {
-
- if (isPopulating()) {
- return;
- }
-
- JoinTable joinTable = subject();
- boolean selected = overrideDefaultInverseJoinColumnsCheckBox.getSelection();
- inverseJoinColumnsComposite.enableWidgets(selected);
- setPopulating(true);
-
- try {
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- JoinColumn defaultJoinColumn = joinTable.getDefaultInverseJoinColumn(); //TODO null check, override default button disabled
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- JoinColumn joinColumn = joinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
- else {
- for (int index = joinTable.specifiedInverseJoinColumnsSize(); --index >= 0; ) {
- joinTable.removeSpecifiedInverseJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private void updateJoinColumns() {
-
- if (isPopulating()) {
- return;
- }
-
- JoinTable joinTable = subject();
- boolean selected = overrideDefaultJoinColumnsCheckBox.getSelection();
- joinColumnsComposite.enableWidgets(selected);
- setPopulating(true);
-
- try {
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- JoinColumn defaultJoinColumn = joinTable.getDefaultJoinColumn(); //TODO null check, override default button disabled
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- JoinColumn joinColumn = joinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
- else {
- for (int index = joinTable.specifiedJoinColumnsSize(); --index >= 0; ) {
- joinTable.removeSpecifiedJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class InverseJoinColumnsProvider implements IJoinColumnsEditor<JoinTable> {
-
- public void addJoinColumn(JoinTable subject) {
- JoinTableComposite.this.addInverseJoinColumn(subject);
- }
-
- public JoinColumn defaultJoinColumn(JoinTable subject) {
- return subject.getDefaultInverseJoinColumn();
- }
-
- public String defaultPropertyName() {
- return JoinTable.DEFAULT_INVERSE_JOIN_COLUMN;
- }
-
- public void editJoinColumn(JoinTable subject, JoinColumn joinColumn) {
- JoinTableComposite.this.editInverseJoinColumn(joinColumn);
- }
-
- public boolean hasSpecifiedJoinColumns(JoinTable subject) {
- return subject.containsSpecifiedInverseJoinColumns();
- }
-
- public void removeJoinColumns(JoinTable subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; --index >= 0; ) {
- subject.removeSpecifiedInverseJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterator<JoinColumn> specifiedJoinColumns(JoinTable subject) {
- return subject.specifiedInverseJoinColumns();
- }
-
- public int specifiedJoinColumnsSize(JoinTable subject) {
- return subject.specifiedInverseJoinColumnsSize();
- }
-
- public String specifiedListPropertyName() {
- return JoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST;
- }
- }
-
- private class JoinColumnsProvider implements IJoinColumnsEditor<JoinTable> {
-
- public void addJoinColumn(JoinTable subject) {
- JoinTableComposite.this.addJoinColumn(subject);
- }
-
- public JoinColumn defaultJoinColumn(JoinTable subject) {
- return subject.getDefaultJoinColumn();
- }
-
- public String defaultPropertyName() {
- return JoinTable.DEFAULT_JOIN_COLUMN;
- }
-
- public void editJoinColumn(JoinTable subject, JoinColumn joinColumn) {
- JoinTableComposite.this.editJoinColumn(joinColumn);
- }
-
- public boolean hasSpecifiedJoinColumns(JoinTable subject) {
- return subject.containsSpecifiedJoinColumns();
- }
-
- public void removeJoinColumns(JoinTable subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; --index >= 0; ) {
- subject.removeSpecifiedJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterator<JoinColumn> specifiedJoinColumns(JoinTable subject) {
- return subject.specifiedJoinColumns();
- }
-
- public int specifiedJoinColumnsSize(JoinTable subject) {
- return subject.specifiedJoinColumnsSize();
- }
-
- public String specifiedListPropertyName() {
- return JoinTable.SPECIFIED_JOIN_COLUMNS_LIST;
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobComposite.java
deleted file mode 100644
index 79b210f23f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/LobComposite.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows the Lob check box.
- *
- * @see BasicMapping
- *
- * @version 2.0
- * @since 1.0
- */
-public class LobComposite extends AbstractFormPane<BasicMapping>
-{
- /**
- * Creates a new <code>LobComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public LobComposite(AbstractFormPane<? extends BasicMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>LobComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public LobComposite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyAspectAdapter<BasicMapping, Boolean> buildLobHolder() {
-
- return new PropertyAspectAdapter<BasicMapping, Boolean>(getSubjectHolder(), BasicMapping.LOB_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return subject.isLob();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setLob(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- buildCheckBox(
- container,
- JptUiMappingsMessages.BasicGeneralSection_lobLabel,
- buildLobHolder(),
- JpaHelpContextIds.MAPPING_LOB
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyMappingComposite.java
deleted file mode 100644
index 32aaf0100c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyMappingComposite.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - Join Table ------------------------------------------------------------ |
- * | | | |
- * | | JoinTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see ManyToManyMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinTableComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class ManyToManyMappingComposite extends AbstractFormPane<ManyToManyMapping>
- implements JpaComposite<ManyToManyMapping>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ManyToManyMappingComposite(PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(ManyToManyMapping value) {
- return value.getCascade();
- }
- };
- }
-
- private PropertyValueModel<JoinTable> buildJointTableHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, JoinTable>(getSubjectHolder()) {
- @Override
- protected JoinTable transform_(ManyToManyMapping value) {
- return value.getJoinTable();
- }
- };
- }
-
- private Composite buildPane(Composite container, int groupBoxMargin) {
- return buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- private void initializeGeneralPane(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- // Target Entity widgets
- new TargetEntityComposite(this, buildPane(container, groupBoxMargin));
-
- // Fetch Type widgets
- new FetchTypeComposite(this, buildPane(container, groupBoxMargin));
-
- // Mapped By widgets
- new MappedByComposite(this, buildPane(container, groupBoxMargin));
-
- // Cascade widgets
- new CascadeComposite(this, buildCascadeHolder(), buildSubPane(container, 5));
-
- // Ordering widgets
- new OrderingComposite(this, container);
- }
-
- private void initializeJoinTablePane(Composite container) {
-
- container = buildSection(
- container,
- JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable
- );
-
- new JoinTableComposite(
- this,
- buildJointTableHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // General sub pane
- initializeGeneralPane(container);
-
- // Join Table sub pane
- initializeJoinTablePane(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneMappingComposite.java
deleted file mode 100644
index 3fe272b477..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneMappingComposite.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoinColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see ManyToOneMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinColumnComposite
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class ManyToOneMappingComposite extends AbstractFormPane<ManyToOneMapping>
- implements JpaComposite<ManyToOneMapping>
-{
- /**
- * Creates a new <code>ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ManyToOneMappingComposite(PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<ManyToOneMapping, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(ManyToOneMapping value) {
- return value.getCascade();
- }
- };
- }
-
- private Composite buildPane(Composite container, int groupBoxMargin) {
- return buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
- Composite subPane = buildPane(container, groupBoxMargin);
-
- // Target Entity widgets
- new TargetEntityComposite(this, subPane);
-
- // Fetch Type widgets
- new FetchTypeComposite(this, subPane);
-
- // Optional check box
- new OptionalComposite(this, buildSubPane(subPane, 4));
-
- // Cascade widgets
- new CascadeComposite(this, buildCascadeHolder(), container);
-
- // Join Column widgets
- new JoinColumnComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByComposite.java
deleted file mode 100644
index 121d30a006..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedByComposite.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.NonOwningMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Mapped By: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see NonOwningMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class MappedByComposite extends AbstractFormPane<NonOwningMapping>
-{
- private CCombo combo;
-
- /**
- * Creates a new <code>MappedByComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public MappedByComposite(AbstractFormPane<? extends NonOwningMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>MappedByComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>INonOwningMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public MappedByComposite(PropertyValueModel<? extends NonOwningMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(NonOwningMapping.MAPPED_BY_PROPERTY);
- }
-
- private ModifyListener buildComboModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
- valueChanged(combo.getText());
- }
- }
- };
- }
-
- private FocusListener buildFocusListener() {
- return new FocusListener() {
-
- public void focusGained(FocusEvent e) {
-
- setPopulating(true);
-
- try {
- if (combo.getSelectionIndex() == 0) {
- combo.setText("");
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- public void focusLost(FocusEvent e) {
-
- setPopulating(true);
-
- try {
- if (combo.getText().length() == 0) {
- combo.select(0);
- }
- }
- finally {
- setPopulating(false);
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
-
- super.doPopulate();
- populateCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- combo = buildLabeledEditableCCombo(
- container,
- JptUiMappingsMessages.NonOwningMapping_mappedByLabel,
- buildComboModifyListener(),
- JpaHelpContextIds.MAPPING_MAPPED_BY
- );
-
- combo.addFocusListener(buildFocusListener());
- }
-
- private void populateCombo() {
-
- combo.removeAll();
- combo.add(JptUiMappingsMessages.NoneSelected);
-
- NonOwningMapping subject = subject();
-
- if (subject != null) {
- Iterator<String> iter = subject.candidateMappedByAttributeNames();
-
- for (iter = CollectionTools.sort(iter); iter.hasNext(); ) {
- combo.add(iter.next());
- }
- }
-
- updateSelectedItem();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == NonOwningMapping.MAPPED_BY_PROPERTY) {
- populateCombo();
- }
- }
-
- /**
- * Updates the selected item by selected the current value, if not
- * <code>null</code>, or select the default value if one is available,
- * otherwise remove the selection.
- * <p>
- * <b>Note:</b> It seems the text can be shown as truncated, changing the
- * selection to (0, 0) makes the entire text visible.
- */
- private void updateSelectedItem() {
-
- NonOwningMapping subject = subject();
- String value = (subject != null) ? subject.getMappedBy() : null;
-
- if (value != null) {
- combo.setText(value);
- }
- else {
- combo.select(0);
- }
-
- combo.setSelection(new Point(0, 0));
- }
-
- private void valueChanged(String value) {
-
- NonOwningMapping subject = subject();
- String oldValue = (subject != null) ? subject.getMappedBy() : null;
-
- // Check for null value
- if (StringTools.stringIsEmpty(value)) {
- value = null;
-
- if (StringTools.stringIsEmpty(oldValue)) {
- return;
- }
- }
-
- // The default value
- if (value == JptUiMappingsMessages.NoneSelected) {
- value = null;
- }
-
- // Nothing to change
- if ((oldValue == value) && value == null) {
- return;
- }
-
- // Set the new value
- if ((value != null) && (oldValue == null) ||
- ((oldValue != null) && !oldValue.equals(value))) {
-
- setPopulating(true);
-
- try {
- subject.setMappedBy(value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-} \ No newline at end of file
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 71b593aa51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/MappedSuperclassComposite.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * @see MappedSuperclass
- * @see BaseJpaUiFactory - The factory creating this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class MappedSuperclassComposite extends AbstractFormPane<MappedSuperclass>
- implements JpaComposite<MappedSuperclass>
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public MappedSuperclassComposite(PropertyValueModel<? extends MappedSuperclass> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
-// 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 initializeLayout(Composite composite) {
-
-// 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);
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyMappingComposite.java
deleted file mode 100644
index 587fac8723..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyMappingComposite.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - Join Table ------------------------------------------------------------ |
- * | | | |
- * | | JoinTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToManyMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinTableComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class OneToManyMappingComposite extends AbstractFormPane<OneToManyMapping>
- implements JpaComposite<OneToManyMapping>
-{
- /**
- * Creates a new <code>OneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OneToManyMappingComposite(PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<OneToManyMapping, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(OneToManyMapping value) {
- return value.getCascade();
- }
- };
- }
-
- private PropertyValueModel<JoinTable> buildJointTableHolder() {
- return new TransformationPropertyValueModel<OneToManyMapping, JoinTable>(getSubjectHolder()) {
- @Override
- protected JoinTable transform_(OneToManyMapping value) {
- return value.getJoinTable();
- }
- };
- }
-
- private void initializeGeneralPane(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
- Composite subPane = buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // Target Entity widgets
- new TargetEntityComposite(this, subPane);
-
- // Fetch Type widgets
- new FetchTypeComposite(this, subPane);
-
- // Mapped By widgets
- new MappedByComposite(this, subPane);
-
- // Cascade widgets
- new CascadeComposite(this, buildCascadeHolder(), buildSubPane(container, 4));
-
- // Ordering widgets
- new OrderingComposite(this, container);
- }
-
- private void initializeJoinTablePane(Composite container) {
-
- container = buildSection(
- container,
- JptUiMappingsMessages.MultiRelationshipMappingComposite_joinTable
- );
-
- new JoinTableComposite(
- this,
- buildJointTableHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // General sub pane
- initializeGeneralPane(container);
-
- // Join Table sub pane
- initializeJoinTablePane(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneMappingComposite.java
deleted file mode 100644
index 09ec848d4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneMappingComposite.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | MappedByComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoinColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinColumnComposite
- * @see MappedByComposite
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class OneToOneMappingComposite extends AbstractFormPane<OneToOneMapping>
- implements JpaComposite<OneToOneMapping>
-{
- /**
- * Creates a new <code>OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OneToOneMappingComposite(PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<OneToOneMapping, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(OneToOneMapping value) {
- return value.getCascade();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
- Composite subPane = buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // Target Entity widgets
- new TargetEntityComposite(this, subPane);
-
- // Fetch Type widgets
- new FetchTypeComposite(this, subPane);
-
- // Mapped By widgets
- new MappedByComposite(this, subPane);
-
- // Optional check box
- new OptionalComposite(this, buildSubPane(subPane, 4));
-
- // Cascade widgets
- new CascadeComposite(this, buildCascadeHolder(), container);
-
- // Join Column widgets
- new JoinColumnComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OptionalComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OptionalComposite.java
deleted file mode 100644
index 701f1f49ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OptionalComposite.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Optional option.
- *
- * @see BasicMapping
- * @see BasicMappingComposite - A container of this pane
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 1.0
- * @since 2.0
- */
-public class OptionalComposite extends AbstractFormPane<Nullable>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OptionalComposite(AbstractFormPane<? extends Nullable> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- private WritablePropertyValueModel<Boolean> buildOptionalHolder() {
- return new PropertyAspectAdapter<Nullable, Boolean>(getSubjectHolder(), Nullable.SPECIFIED_OPTIONAL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.getSpecifiedOptional();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setSpecifiedOptional(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildOptionalStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildOptionalHolder()) {
-
- @Override
- protected String transform(Boolean value) {
-
- if ((subject() != null) && (value == null)) {
-
- Boolean defaultValue = subject().getDefaultOptional();
-
- if (defaultValue != null) {
-
- String defaultStringValue = defaultValue ? JptUiMappingsMessages.Boolean_True :
- JptUiMappingsMessages.Boolean_False;
-
- return NLS.bind(
- JptUiMappingsMessages.BasicGeneralSection_optionalLabelDefault,
- defaultStringValue
- );
- }
- }
-
- return JptUiMappingsMessages.BasicGeneralSection_optionalLabel;
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- buildTriStateCheckBoxWithDefault(
- container,
- JptUiMappingsMessages.BasicGeneralSection_optionalLabel,
- buildOptionalHolder(),
- buildOptionalStringHolder(),
- JpaHelpContextIds.MAPPING_OPTIONAL
- );
- }
-} \ No newline at end of file
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 21c06c27ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OrderingComposite.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Order By -------------------------------------------------------------- |
- * | | | |
- * | | o No Ordering | |
- * | | | |
- * | | o Primary Key Ordering | |
- * | | | |
- * | | o Custom Ordering | |
- * | | ------------------------------------------------------------------- | |
- * | | | I | | |
- * | | ------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see MultiRelationshipMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class OrderingComposite extends AbstractFormPane<MultiRelationshipMapping>
-{
- private Text customOrderingText;
-
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrderingComposite(AbstractFormPane<? extends MultiRelationshipMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrderingComposite(PropertyValueModel<? extends MultiRelationshipMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(MultiRelationshipMapping.ORDER_BY_PROPERTY);
- }
-
- private ModifyListener buildCustomTextModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- Text text = (Text) e.widget;
- valueChanged(text.getText());
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateCustomOrdering();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Order By group
- Group orderByGroup = buildTitledPane(
- container,
- JptUiMappingsMessages.OrderByComposite_orderByGroup,
- JpaHelpContextIds.MAPPING_ORDER_BY);
-
- // No Ordering radio button
- buildRadioButton(
- buildSubPane(orderByGroup, 8),
- JptUiMappingsMessages.OrderByComposite_noOrdering,
- buildNoOrderingHolder(),
- JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING
- );
-
- // Order by Primary Key radio button
- buildRadioButton(
- orderByGroup,
- JptUiMappingsMessages.OrderByComposite_primaryKeyOrdering,
- buildPrimaryKeyOrderingHolder(),
- JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING
- );
-
- // Custom Ordering radio button
- buildRadioButton(
- orderByGroup,
- JptUiMappingsMessages.OrderByComposite_customOrdering,
- buildCustomOrderingHolder(),
- JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING
- );
-
- // Custom Ordering text field
- customOrderingText = buildText(
- buildSubPane(orderByGroup, 0, 16),
- JpaHelpContextIds.MAPPING_ORDER_BY
- );
-
- customOrderingText.addModifyListener(buildCustomTextModifyListener());
- installCustomTextEnabler(customOrderingText);
- }
-
- private void installCustomTextEnabler(Text text) {
- new ControlEnabler(buildCustomOrderingHolder(), text);
- }
-
- private WritablePropertyValueModel<Boolean> buildCustomOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.CUSTOM_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(subject.isCustomOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setCustomOrdering(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNoOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.NO_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(subject.isNoOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setNoOrdering(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildPrimaryKeyOrderingHolder() {
- return new PropertyAspectAdapter<MultiRelationshipMapping, Boolean>(getSubjectHolder(), MultiRelationshipMapping.PK_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(subject.isPkOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setPkOrdering(value.booleanValue());
- }
- };
- }
- private void populateCustomOrdering() {
-
- if ((subject() != null) && subject().getOrderBy() != null) {
- customOrderingText.setText(subject().getOrderBy());
- }
- else {
- customOrderingText.setText("");
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == MultiRelationshipMapping.ORDER_BY_PROPERTY) {
- populateCustomOrdering();
- }
- }
-
- private void valueChanged(String value) {
-
- setPopulating(true);
-
- try {
- subject().setOrderBy(value);
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
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 42850a5dd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OverridesComposite.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.details.JoinColumnsComposite.IJoinColumnsEditor;
-import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Attribute Overrides --------------------------------------------------- |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | PageBook (JoinColumnsComposite or ColumnComposite) | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EntityComposite - The parent container
- * @see ColumnComposite
- * @see JoinColumnsComposite
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class OverridesComposite extends AbstractFormPane<Entity>
-{
- private Composite columnPane;
- private Composite joinColumnsPane;
- private WritablePropertyValueModel<BaseOverride> overrideHolder;
-
- /**
- * Creates a new <code>OverridesComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- */
- public OverridesComposite(AbstractFormPane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- /**
- * Creates a new <code>OverridesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OverridesComposite(PropertyValueModel<? extends Entity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addJoinColumn(AssociationOverride subject) {
-
- JoinColumnInAssociationOverrideDialog dialog =
- new JoinColumnInAssociationOverrideDialog(shell(), subject, null);
-
- dialog.openDialog(buildAddJoinColumnPostExecution());
- }
-
- private void addJoinColumn(JoinColumnInAssociationOverrideStateObject stateObject) {
-
- AssociationOverride associationOverride = stateObject.getOwner();
- int index = associationOverride.specifiedJoinColumnsSize();
-
- JoinColumn joinColumn = associationOverride.addSpecifiedJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private PostExecution<JoinColumnInAssociationOverrideDialog> buildAddJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInAssociationOverrideDialog>() {
- public void execute(JoinColumnInAssociationOverrideDialog dialog) {
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private WritablePropertyValueModel<AssociationOverride> buildAssociationOverrideHolder() {
- return new TransformationWritablePropertyValueModel<BaseOverride, AssociationOverride>(overrideHolder) {
- @Override
- protected AssociationOverride transform_(BaseOverride value) {
- return (value instanceof AssociationOverride) ? (AssociationOverride) value : null;
- }
- };
- }
-
- private WritablePropertyValueModel<AttributeOverride> buildAttributeOverrideHolder() {
- return new TransformationWritablePropertyValueModel<BaseOverride, AttributeOverride>(overrideHolder) {
- @Override
- protected AttributeOverride transform_(BaseOverride value) {
- return (value instanceof AttributeOverride) ? (AttributeOverride) value : null;
- }
- };
- }
-
- private PropertyValueModel<Column> buildColumnHolder(PropertyValueModel<AttributeOverride> attributeOverrideHolder) {
- return new TransformationPropertyValueModel<AttributeOverride, Column>(attributeOverrideHolder) {
- @Override
- protected Column transform_(AttributeOverride value) {
- return value.getColumn();
- }
- };
- }
-
- private ListValueModel<AssociationOverride> buildDefaultAssociationOverridesListHolder() {
- return new ListAspectAdapter<Entity, AssociationOverride>(getSubjectHolder(), Entity.DEFAULT_ASSOCIATION_OVERRIDES_LIST) {
- @Override
- protected ListIterator<AssociationOverride> listIterator_() {
- return subject.defaultAssociationOverrides();
- }
-
- @Override
- protected int size_() {
- return subject.defaultAssociationOverridesSize();
- }
- };
- }
-
- private ListValueModel<AttributeOverride> buildDefaultAttributeOverridesListHolder() {
- return new ListAspectAdapter<Entity, AttributeOverride>(getSubjectHolder(), Entity.DEFAULT_ATTRIBUTE_OVERRIDES_LIST) {
- @Override
- protected ListIterator<AttributeOverride> listIterator_() {
- return subject.defaultAttributeOverrides();
- }
-
- @Override
- protected int size_() {
- return subject.defaultAttributeOverridesSize();
- }
- };
- }
-
- private PostExecution<JoinColumnInAssociationOverrideDialog> buildEditJoinColumnPostExecution() {
- return new PostExecution<JoinColumnInAssociationOverrideDialog>() {
- public void execute(JoinColumnInAssociationOverrideDialog dialog) {
- if (dialog.wasConfirmed()) {
- editJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private JoinColumnsProvider buildJoinColumnsEditor() {
- return new JoinColumnsProvider();
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultAssociationOverrideHolder() {
- return new TransformationWritablePropertyValueModel<AssociationOverride, Boolean>(buildAssociationOverrideHolder()) {
- @Override
- public void setValue(Boolean value) {
- updateAssociationOverride(value);
- }
-
- @Override
- protected Boolean transform_(AssociationOverride value) {
- return !value.isVirtual();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultAttributeOverrideHolder() {
- return new TransformationWritablePropertyValueModel<AttributeOverride, Boolean>(buildAttributeOverrideHolder()) {
- @Override
- public void setValue(Boolean value) {
- updateAttributeOverride(value);
- }
-
- @Override
- protected Boolean transform_(AttributeOverride value) {
- return !value.isVirtual();
- }
- };
- }
-
- private String buildOverrideDisplayString(BaseOverride override) {
-
- Entity subject = subject();
- String overrideType;
- int index = 0;
-
- // Retrieve the index and type
- if (override instanceof AssociationOverride) {
- index = CollectionTools.indexOf(subject.associationOverrides(), override);
- overrideType = JptUiMappingsMessages.OverridesComposite_association;
- }
- else {
- index = CollectionTools.indexOf(subject.attributeOverrides(), override);
- overrideType = JptUiMappingsMessages.OverridesComposite_attribute;
- }
-
- // Format the name
- String name = override.getName();
-
- if (StringTools.stringIsEmpty(name)) {
- name = JptUiMappingsMessages.OverridesComposite_noName;
- }
- else {
- name = name.trim();
- }
-
- // Format: <name> (Association <index>), we show the index since
- // it's possible to have one than one override with the same name
- StringBuilder sb = new StringBuilder();
- sb.append(name);
- sb.append(" (");
- sb.append(overrideType);
- sb.append(" ");
- sb.append(index + 1);
- sb.append(") ");
- return sb.toString();
- }
-
- private WritablePropertyValueModel<BaseOverride> buildOverrideHolder() {
- return new SimplePropertyValueModel<BaseOverride>();
- }
-
- private ILabelProvider buildOverrideLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildOverrideDisplayString((BaseOverride) element);
- }
- };
- }
-
- private Adapter buildOverridesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- removeOverrides(listSelectionModel);
- }
- };
- }
-
- private ListValueModel<BaseOverride> buildOverridesListHolder() {
- List<ListValueModel<? extends BaseOverride>> list = new ArrayList<ListValueModel<? extends BaseOverride>>();
- list.add(buildSpecifiedAttributeOverridesListHolder());
- list.add(buildDefaultAttributeOverridesListHolder());
- list.add(buildSpecifiedAssociationOverridesListHolder());
- list.add(buildDefaultAssociationOverridesListHolder());
- return new CompositeListValueModel<ListValueModel<? extends BaseOverride>, BaseOverride>(list);
- }
-
- private ListValueModel<BaseOverride> buildOverridesListModel() {
- return new ItemPropertyListValueModelAdapter<BaseOverride>(
- buildOverridesListHolder(),
- BaseOverride.NAME_PROPERTY
- );
- }
-
- private Transformer<BaseOverride, Control> buildPaneTransformer() {
- return new Transformer<BaseOverride, Control>() {
- public Control transform(BaseOverride override) {
-
- if (override instanceof AttributeOverride) {
- return columnPane;
- }
-
- if (override instanceof AssociationOverride) {
- return joinColumnsPane;
- }
-
- return null;
- }
- };
- }
-
- private ListValueModel<AssociationOverride> buildSpecifiedAssociationOverridesListHolder() {
- return new ListAspectAdapter<Entity, AssociationOverride>(getSubjectHolder(), Entity.SPECIFIED_ASSOCIATION_OVERRIDES_LIST) {
- @Override
- protected ListIterator<AssociationOverride> listIterator_() {
- return subject.specifiedAssociationOverrides();
- }
-
- @Override
- protected int size_() {
- return subject.specifiedAssociationOverridesSize();
- }
- };
- }
-
- private ListValueModel<AttributeOverride> buildSpecifiedAttributeOverridesListHolder() {
- return new ListAspectAdapter<Entity, AttributeOverride>(getSubjectHolder(), Entity.SPECIFIED_ATTRIBUTE_OVERRIDES_LIST) {
- @Override
- protected ListIterator<AttributeOverride> listIterator_() {
- return subject.specifiedAttributeOverrides();
- }
-
- @Override
- protected int size_() {
- return subject.specifiedAttributeOverridesSize();
- }
- };
- }
-
- private void editJoinColumn(JoinColumn joinColumn) {
-
- JoinColumnInAssociationOverrideDialog dialog =
- new JoinColumnInAssociationOverrideDialog(
- shell(),
- (AssociationOverride) overrideHolder.value(),
- joinColumn
- );
-
- dialog.openDialog(buildEditJoinColumnPostExecution());
- }
-
- private void editJoinColumn(JoinColumnInAssociationOverrideStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- overrideHolder = buildOverrideHolder();
- }
-
- private void initializeColumnPane(PageBook pageBook) {
-
- int groupBoxMargin = groupBoxMargin();
- columnPane = buildSubPane(pageBook, 5);
-
- // Override Default check box
- buildCheckBox(
- buildSubPane(columnPane, 0, groupBoxMargin, 0, groupBoxMargin),
- JptUiMappingsMessages.AttributeOverridesComposite_overrideDefault,
- buildOverrideDefaultAttributeOverrideHolder()
- );
-
- // Column widgets (for IOverrideAttribute)
- ColumnComposite columnComposite = new ColumnComposite(
- this,
- buildColumnHolder(buildAttributeOverrideHolder()),
- columnPane,
- false
- );
-
- columnPane.setVisible(false);
- installColumnsPaneEnabler(columnComposite);
- }
-
- private void initializeJoinColumnsPane(PageBook pageBook) {
-
- joinColumnsPane = buildSubPane(pageBook);
-
- // Override Default check box
- buildCheckBox(
- buildSubPane(joinColumnsPane, 5, groupBoxMargin()),
- JptUiMappingsMessages.AttributeOverridesComposite_overrideDefault,
- buildOverrideDefaultAssociationOverrideHolder()
- );
-
- Group joinColumnsGroupPane = buildTitledPane(
- joinColumnsPane,
- JptUiMappingsMessages.OverridesComposite_joinColumn
- );
-
- // Join Columns list pane (for IOverrideAssociation)
- JoinColumnsComposite<AssociationOverride> joinColumnsComposite =
- new JoinColumnsComposite<AssociationOverride>(
- this,
- buildAssociationOverrideHolder(),
- joinColumnsGroupPane,
- buildJoinColumnsEditor(),
- false
- );
-
- joinColumnsPane.setVisible(false);
- installJoinColumnsPaneEnabler(joinColumnsComposite);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Overrides group pane
- container = buildTitledPane(
- container,
- JptUiMappingsMessages.AttributeOverridesComposite_attributeOverrides
- );
-
- // Overrides list pane
- initializeOverridesList(container);
-
- // Property pane
- PageBook pageBook = buildPageBook(container);
- initializeJoinColumnsPane(pageBook);
- initializeColumnPane(pageBook);
- installOverrideControlSwitcher(overrideHolder, pageBook);
- }
-
- private AddRemoveListPane<Entity> initializeOverridesList(Composite container) {
-
- return new AddRemoveListPane<Entity>(
- this,
- buildSubPane(container, 8),
- buildOverridesAdapter(),
- buildOverridesListModel(),
- overrideHolder,
- buildOverrideLabelProvider(),
- JpaHelpContextIds.ENTITY_ATTRIBUTE_OVERRIDES
- )
- {
- @Override
- protected void initializeButtonPane(Composite container, String helpId) {
- }
-
- @Override
- protected void updateButtons() {
- }
- };
- }
-
- private void installColumnsPaneEnabler(ColumnComposite pane) {
- new PaneEnabler(
- buildOverrideDefaultAttributeOverrideHolder(),
- pane
- );
- }
-
- private void installJoinColumnsPaneEnabler(JoinColumnsComposite<AssociationOverride> pane) {
- new PaneEnabler(
- buildOverrideDefaultAssociationOverrideHolder(),
- pane
- );
- }
-
- private void installOverrideControlSwitcher(PropertyValueModel<BaseOverride> overrideHolder,
- PageBook pageBook) {
-
- new ControlSwitcher(
- overrideHolder,
- buildPaneTransformer(),
- pageBook
- );
- }
-
- private void removeOverrides(ObjectListSelectionModel listSelectionModel) {
-
- Entity subject = subject();
- Object[] selectedItems = listSelectionModel.selectedValues();
-
- for (int index = selectedItems.length; --index >= 0; ) {
-
- Object override = selectedItems[index];
-
- if (override instanceof AttributeOverride) {
- subject.removeSpecifiedAttributeOverride((AttributeOverride) override);
- }
- else if (override instanceof AssociationOverride) {
- subject.removeSpecifiedAssociationOverride((AssociationOverride) override);
- }
- }
- }
-
- private void updateAssociationOverride(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- Entity subject = subject();
- AssociationOverride override = (AssociationOverride) overrideHolder.value();
-
- // Add a new association override
- if (selected) {
- int index = subject.specifiedAssociationOverridesSize();
- AssociationOverride associationOverride = subject.addSpecifiedAssociationOverride(index);
- associationOverride.setName(override.getName());
-
- overrideHolder.setValue(associationOverride);
- }
- // Remove the specified association override
- else {
- String name = override.getName();
- subject.removeSpecifiedAssociationOverride(override);
-
- // Select the default association override
- for (Iterator<AssociationOverride> iter = subject.defaultAssociationOverrides(); iter.hasNext(); ) {
- AssociationOverride associationOverride = iter.next();
-
- if (associationOverride.getName().equals(name)) {
- overrideHolder.setValue(associationOverride);
- break;
- }
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private void updateAttributeOverride(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- Entity subject = subject();
- AttributeOverride override = (AttributeOverride) overrideHolder.value();
-
- // Add a new attribute override
- if (selected) {
- int index = subject.specifiedAttributeOverridesSize();
- AttributeOverride attributeOverride = subject.addSpecifiedAttributeOverride(index);
- attributeOverride.setName(override.getName());
- attributeOverride.getColumn().setSpecifiedName(override.getColumn().getName());
-
- overrideHolder.setValue(attributeOverride);
- }
- // Remove the specified attribute override
- else {
- String name = override.getName();
- subject.removeSpecifiedAttributeOverride(override);
-
- // Select the default attribute override
- for (Iterator<AttributeOverride> iter = subject.defaultAttributeOverrides(); iter.hasNext(); ) {
- AttributeOverride attributeOverride = iter.next();
-
- if (attributeOverride.getName().equals(name)) {
- overrideHolder.setValue(attributeOverride);
- break;
- }
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class JoinColumnsProvider implements IJoinColumnsEditor<AssociationOverride> {
-
- public void addJoinColumn(AssociationOverride subject) {
- OverridesComposite.this.addJoinColumn(subject);
- }
-
- public JoinColumn defaultJoinColumn(AssociationOverride subject) {
- return null;
- }
-
- public String defaultPropertyName() {
- return AssociationOverride.DEFAULT_JOIN_COLUMNS_LIST;
- }
-
- public void editJoinColumn(AssociationOverride subject, JoinColumn joinColumn) {
- OverridesComposite.this.editJoinColumn(joinColumn);
- }
-
- public boolean hasSpecifiedJoinColumns(AssociationOverride subject) {
- return subject.containsSpecifiedJoinColumns();
- }
-
- public void removeJoinColumns(AssociationOverride subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; --index >= 0; ) {
- subject.removeSpecifiedJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterator<JoinColumn> specifiedJoinColumns(AssociationOverride subject) {
- return subject.specifiedJoinColumns();
- }
-
- public int specifiedJoinColumnsSize(AssociationOverride subject) {
- return subject.specifiedJoinColumnsSize();
- }
-
- public String specifiedListPropertyName() {
- return AssociationOverride.SPECIFIED_JOIN_COLUMNS_LIST;
- }
- }
-} \ No newline at end of file
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 87ced5dc3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialog.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is located
- * on an entity.
- *
- * @see PrimaryKeyJoinColumn
- * @see Entity
- * @see PrimaryKeyJoinColumnStateObject
- * @see PrimaryKeyJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnDialog extends AbstractJoinColumnDialog<PrimaryKeyJoinColumnStateObject> {
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param entity The owner of the join column to create or where it is
- * located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public PrimaryKeyJoinColumnDialog(Shell parent,
- Entity entity,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(parent, entity, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AbstractDialogPane<PrimaryKeyJoinColumnStateObject> buildLayout(Composite container) {
- return new PrimaryKeyJoinColumnDialogPane(subjectHolder(), container);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected PrimaryKeyJoinColumnStateObject buildStateObject() {
- return new PrimaryKeyJoinColumnStateObject(getOwner(), getJoinColumn());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Entity getOwner() {
- return (Entity) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialogPane.java
deleted file mode 100644
index 7930a5a5df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnDialogPane.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * See <code>AbstractJoinColumnDialogPane</code> for the layout.
- *
- * @see PrimaryKeyJoinColumnStateObject
- * @see PrimaryKeyJoinColumnDialog - The parent container
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnDialogPane extends AbstractJoinColumnDialogPane<PrimaryKeyJoinColumnStateObject>
-{
- /**
- * Creates a new <code>PrimaryKeyJoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PrimaryKeyJoinColumnDialogPane(PropertyValueModel<PrimaryKeyJoinColumnStateObject> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent);
- }
-}
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 432fd144d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is within
- * a secondary table.
- *
- * @see PrimaryKeyJoinColumn
- * @see SecondaryTable
- * @see PrimaryKeyJoinColumnInSecondaryTableStateObject
- * @see AbstractJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnInSecondaryTableDialog extends AbstractJoinColumnDialog<PrimaryKeyJoinColumnInSecondaryTableStateObject> {
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param secondaryTable The owner of the join column to create or where it
- * is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent,
- SecondaryTable secondaryTable,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(parent, secondaryTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AbstractDialogPane<PrimaryKeyJoinColumnInSecondaryTableStateObject> buildLayout(Composite container) {
- return new AbstractJoinColumnDialogPane<PrimaryKeyJoinColumnInSecondaryTableStateObject>(
- subjectHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected PrimaryKeyJoinColumnInSecondaryTableStateObject buildStateObject() {
- return new PrimaryKeyJoinColumnInSecondaryTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected SecondaryTable getOwner() {
- return (SecondaryTable) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java
deleted file mode 100644
index fbe09a28d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * The state object used to create or edit a primary key join column on an
- * secondary table.
- *
- * @see PrimaryKeyJoinColumn
- * @see SecondaryTable
- * @see PrimaryKeyJoinColumnInSecondaryTableDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnInSecondaryTableStateObject extends AbstractJoinColumnStateObject
-{
- /**
- * Creates a new <code>PrimaryKeyJoinColumnInSecondaryTableStateObject</code>.
- *
- * @param secondaryTable The owner of the join column to create or where it
- * is located
- * @param joinColumn The join column to edit or <code>null</code> if it is to
- * create a new one
- */
- public PrimaryKeyJoinColumnInSecondaryTableStateObject(SecondaryTable secondaryTable,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(secondaryTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().dbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public SecondaryTable getOwner() {
- return (SecondaryTable) super.getOwner();
- }
-
- /* (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- return getOwner().parent().primaryDbTable();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnStateObject.java
deleted file mode 100644
index bb6de3483c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnStateObject.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.db.internal.Table;
-
-/**
- * The state object used to create or edit a primary key join column on an
- * entity.
- *
- * @see PrimaryKeyJoinColumn
- * @see Entity
- * @see PrimaryKeyJoinColumnDialog
- * @see PrimaryKeyJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnStateObject extends AbstractJoinColumnStateObject
-{
- /**
- * Creates a new <code>PrimaryKeyJoinColumnStateObject</code>.
- *
- * @param entity The owner of the join column to create or where it is
- * located
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public PrimaryKeyJoinColumnStateObject(Entity entity,
- PrimaryKeyJoinColumn joinColumn) {
- super(entity, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().primaryDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Entity getOwner() {
- return (Entity) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- return getOwner().parentEntity().primaryDbTable();
- }
-} \ No newline at end of file
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 933fec6a57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsComposite.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.AbstractAdapter;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see InheritanceComposite - The container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnsComposite extends AbstractFormPane<Entity>
-{
- private WritablePropertyValueModel<PrimaryKeyJoinColumn> joinColumnHolder;
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- */
- public PrimaryKeyJoinColumnsComposite(AbstractFormPane<? extends Entity> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PrimaryKeyJoinColumnsComposite(PropertyValueModel<? extends Entity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addJoinColumn(PrimaryKeyJoinColumnStateObject stateObject) {
-
- Entity subject = subject();
- int index = subject.specifiedPrimaryKeyJoinColumnsSize();
-
- PrimaryKeyJoinColumn joinColumn = subject.addSpecifiedPrimaryKeyJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private void addPrimaryKeyJoinColumn() {
-
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(
- shell(),
- subject(),
- null
- );
-
- dialog.openDialog(buildAddPrimaryKeyJoinColumnPostExecution());
- }
-
- private PostExecution<PrimaryKeyJoinColumnDialog> buildAddPrimaryKeyJoinColumnPostExecution() {
- return new PostExecution<PrimaryKeyJoinColumnDialog>() {
- public void execute(PrimaryKeyJoinColumnDialog dialog) {
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private PropertyValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<Entity, PrimaryKeyJoinColumn>(getSubjectHolder(), Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN) {
- @Override
- protected PrimaryKeyJoinColumn buildValue_() {
- return subject.getDefaultPrimaryKeyJoinColumn();
- }
- };
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<PrimaryKeyJoinColumn>(buildDefaultJoinColumnHolder());
-
- }
-
- private PostExecution<PrimaryKeyJoinColumnDialog> buildEditPrimaryKeyJoinColumnPostExecution() {
- return new PostExecution<PrimaryKeyJoinColumnDialog>() {
- public void execute(PrimaryKeyJoinColumnDialog dialog) {
- if (dialog.wasConfirmed()) {
- editJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private WritablePropertyValueModel<PrimaryKeyJoinColumn> buildJoinColumnHolder() {
- return new SimplePropertyValueModel<PrimaryKeyJoinColumn>();
- }
-
- private String buildJoinColumnLabel(PrimaryKeyJoinColumn joinColumn) {
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- 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()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private Adapter buildJoinColumnsAdapter() {
- return new AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrimaryKeyJoinColumn();
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- editPrimaryKeyJoinColumn(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
-
- int[] selectedIndices = listSelectionModel.selectedIndices();
- Entity entity = subject();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- entity.removeSpecifiedPrimaryKeyJoinColumn(selectedIndices[index]);
- }
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildJoinColumnLabel((PrimaryKeyJoinColumn) element);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListHolder() {
- List<ListValueModel<PrimaryKeyJoinColumn>> list = new ArrayList<ListValueModel<PrimaryKeyJoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnListHolder());
- return new CompositeListValueModel<ListValueModel<PrimaryKeyJoinColumn>, PrimaryKeyJoinColumn>(list);
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<PrimaryKeyJoinColumn>(
- buildPrimaryKeyJoinColumnsListHolder(),
- NamedColumn.SPECIFIED_NAME_PROPERTY,
- NamedColumn.DEFAULT_NAME_PROPERTY,
- AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- AbstractJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY
- );
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<Entity, PrimaryKeyJoinColumn>(getSubjectHolder(), Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterator<PrimaryKeyJoinColumn> listIterator_() {
- return subject.specifiedPrimaryKeyJoinColumns();
- }
-
- @Override
- protected int size_() {
- return subject.specifiedPrimaryKeyJoinColumnsSize();
- }
- };
- }
-
- private void editJoinColumn(PrimaryKeyJoinColumnStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- private void editPrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) listSelectionModel.selectedValue();
-
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(
- shell(),
- subject(),
- joinColumn
- );
-
- dialog.openDialog(buildEditPrimaryKeyJoinColumnPostExecution());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- joinColumnHolder = buildJoinColumnHolder();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Join Columns group pane
- Group groupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn
- );
-
- // Override Default Join Columns check box
- buildCheckBox(
- buildSubPane(groupPane, 8),
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- buildOverrideDefaultJoinColumnHolder()
- );
-
- // Primary Key Join Columns list pane
- AddRemoveListPane<Entity> joinColumnsListPane = new AddRemoveListPane<Entity>(
- this,
- groupPane,
- buildJoinColumnsAdapter(),
- buildPrimaryKeyJoinColumnsListModel(),
- joinColumnHolder,
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
-
- installJoinColumnsListPaneEnabler(joinColumnsListPane);
- }
-
- private void installJoinColumnsListPaneEnabler(AddRemoveListPane<Entity> pane) {
- new PaneEnabler(
- buildOverrideDefaultJoinColumnHolder(),
- pane
- );
- }
-
- private void updateJoinColumns(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- Entity subject = subject();
-
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- PrimaryKeyJoinColumn defaultJoinColumn = subject.getDefaultPrimaryKeyJoinColumn();
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- PrimaryKeyJoinColumn pkJoinColumn = subject.addSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- joinColumnHolder.setValue(pkJoinColumn);
- }
- }
- // Remove all the specified join columns
- else {
- for (int index = subject.specifiedPrimaryKeyJoinColumnsSize(); --index >= 0; ) {
- subject.removeSpecifiedPrimaryKeyJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return listHolder.size() > 0;
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value);
- }
- }
-} \ No newline at end of file
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 f9c8d832e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.context.AbstractJoinColumn;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see SecondaryTable
- * @see EntityComposite - The container of this pane
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 1.0
- */
-public class PrimaryKeyJoinColumnsInSecondaryTableComposite extends AbstractFormPane<SecondaryTable>
-{
- private WritablePropertyValueModel<PrimaryKeyJoinColumn> joinColumnHolder;
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsInSecondaryTableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PrimaryKeyJoinColumnsInSecondaryTableComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends SecondaryTable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsInSecondaryTableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ISecondaryTable</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PrimaryKeyJoinColumnsInSecondaryTableComposite(PropertyValueModel<? extends SecondaryTable> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addJoinColumn(PrimaryKeyJoinColumnInSecondaryTableStateObject stateObject) {
-
- SecondaryTable secondaryTable = stateObject.getOwner();
- int index = secondaryTable.specifiedPrimaryKeyJoinColumnsSize();
-
- PrimaryKeyJoinColumn joinColumn = secondaryTable.addSpecifiedPrimaryKeyJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- private void addPrimaryKeyJoinColumn() {
-
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog =
- new PrimaryKeyJoinColumnInSecondaryTableDialog(shell(), subject(), null);
-
- dialog.openDialog(buildAddPrimaryKeyJoinColumnPostExecution());
- }
-
- private PostExecution<PrimaryKeyJoinColumnInSecondaryTableDialog> buildAddPrimaryKeyJoinColumnPostExecution() {
- return new PostExecution<PrimaryKeyJoinColumnInSecondaryTableDialog>() {
- public void execute(PrimaryKeyJoinColumnInSecondaryTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildControlBooleanHolder() {
- return new TransformationPropertyValueModel<SecondaryTable, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(SecondaryTable value) {
- return (value != null);
- }
- };
- }
-
- private PropertyValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<SecondaryTable, PrimaryKeyJoinColumn>(getSubjectHolder(), SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN) {
- @Override
- protected PrimaryKeyJoinColumn buildValue_() {
- return subject.getDefaultPrimaryKeyJoinColumn();
- }
- };
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<PrimaryKeyJoinColumn>(
- buildDefaultJoinColumnHolder()
- );
- }
-
- private PostExecution<PrimaryKeyJoinColumnInSecondaryTableDialog> buildEditPrimaryKeyJoinColumnPostExecution() {
- return new PostExecution<PrimaryKeyJoinColumnInSecondaryTableDialog>() {
- public void execute(PrimaryKeyJoinColumnInSecondaryTableDialog dialog) {
- if (dialog.wasConfirmed()) {
- editPrimaryKeyJoinColumn(dialog.subject());
- }
- }
- };
- }
-
- private String buildJoinColumnLabel(PrimaryKeyJoinColumn joinColumn) {
-
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- 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()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) element;
- return buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private WritablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private AddRemovePane.Adapter buildPrimaryKeyJoinColumnAdapter() {
- return new AddRemovePane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrimaryKeyJoinColumn();
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- editPrimaryKeyJoinColumn(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- removePrimaryKeyJoinColumn(listSelectionModel);
- }
- };
- }
-
- private WritablePropertyValueModel<PrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnHolder() {
- return new SimplePropertyValueModel<PrimaryKeyJoinColumn>();
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListHolder() {
- List<ListValueModel<PrimaryKeyJoinColumn>> list = new ArrayList<ListValueModel<PrimaryKeyJoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnListHolder());
- return new CompositeListValueModel<ListValueModel<PrimaryKeyJoinColumn>, PrimaryKeyJoinColumn>(list);
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<PrimaryKeyJoinColumn>(
- buildPrimaryKeyJoinColumnsListHolder(),
- NamedColumn.SPECIFIED_NAME_PROPERTY,
- NamedColumn.DEFAULT_NAME_PROPERTY,
- AbstractJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- AbstractJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY
- );
- }
-
- private ListValueModel<PrimaryKeyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<SecondaryTable, PrimaryKeyJoinColumn>(getSubjectHolder(), SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterator<PrimaryKeyJoinColumn> listIterator_() {
- return subject.specifiedPrimaryKeyJoinColumns();
- }
-
- @Override
- protected int size_() {
- return subject.specifiedPrimaryKeyJoinColumnsSize();
- }
- };
- }
-
- private void editPrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) listSelectionModel.selectedValue();
-
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog =
- new PrimaryKeyJoinColumnInSecondaryTableDialog(
- shell(),
- subject(),
- joinColumn
- );
-
- dialog.openDialog(buildEditPrimaryKeyJoinColumnPostExecution());
- }
-
- private void editPrimaryKeyJoinColumn(PrimaryKeyJoinColumnInSecondaryTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- joinColumnHolder = buildPrimaryKeyJoinColumnHolder();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Join Columns group pane
- Group groupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn
- );
-
- // Override Default check box
- Button button = buildCheckBox(
- buildSubPane(groupPane, 8),
- JptUiMappingsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- buildOverrideDefaultHolder()
- );
-
- installOverrideDefaultButtonEnabler(button);
-
- // Primary Key Join Columns list pane
- AddRemoveListPane<SecondaryTable> joinColumnsPane = new AddRemoveListPane<SecondaryTable>(
- this,
- groupPane,
- buildPrimaryKeyJoinColumnAdapter(),
- buildPrimaryKeyJoinColumnsListModel(),
- joinColumnHolder,
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
-
- installPrimaryKeyJoinColumnListPaneEnabler(joinColumnsPane);
- }
-
- private void installOverrideDefaultButtonEnabler(Button overrideDefaultButton) {
-
- new ControlEnabler(
- buildControlBooleanHolder(),
- overrideDefaultButton
- );
- }
-
- private void installPrimaryKeyJoinColumnListPaneEnabler(AddRemoveListPane<SecondaryTable> pkJoinColumnListPane) {
-
- new PaneEnabler(
- buildOverrideDefaultJoinColumnHolder(),
- pkJoinColumnListPane
- );
- }
-
- private void removePrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- subject().removeSpecifiedPrimaryKeyJoinColumn(selectedIndices[index]);
- }
- }
-
- private void updateJoinColumns(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- SecondaryTable secondaryTable = subject();
-
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- PrimaryKeyJoinColumn defaultJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- PrimaryKeyJoinColumn pkJoinColumn = secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- joinColumnHolder.setValue(pkJoinColumn);
- }
- }
- else {
- for (int index = secondaryTable.specifiedPrimaryKeyJoinColumnsSize(); --index >= 0; ) {
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return listHolder.size() > 0;
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value);
- }
- }
-} \ No newline at end of file
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 23cc58c191..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTableDialog.java
+++ /dev/null
@@ -1,250 +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.JpaProject;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.SecondaryTable;
-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 SecondaryTable secondaryTable;
- private Entity 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, Entity entity) {
- super(parent);
- this.entity = entity;
- }
-
- SecondaryTableDialog(Shell parent, SecondaryTable secondaryTable, Entity entity) {
- super(parent);
- this.secondaryTable = secondaryTable;
- this.entity = entity;
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(getTitle());
- }
-
- protected String getTitle() {
- return JptUiMappingsMessages.SecondaryTableDialog_editSecondaryTable;
- }
-
- @Override
- 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() {
- JpaProject project = (this.secondaryTable == null) ? this.entity.jpaProject() : this.secondaryTable.jpaProject();
- 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 SecondaryTable 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;
- }
-
- @Override
- 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 5df355006c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SecondaryTablesComposite.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsInSecondaryTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EntityComposite - The container of this pane
- * @see AddRemoveListPane
- * @see PrimaryKeyJoinColumnsInSecondaryTableComposite
- *
- * @TODO handle xml, how to handle virtual secondaryTables, adding them to xml, are they overriden, etc??
- * @version 2.0
- * @since 1.0
- */
-public class SecondaryTablesComposite extends AbstractFormPane<Entity>
-{
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SecondaryTablesComposite(AbstractFormPane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public SecondaryTablesComposite(PropertyValueModel<? extends Entity> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private void addSecondaryTableFromDialog(SecondaryTableDialog dialog,
- ObjectListSelectionModel listSelectionModel) {
- if (dialog.open() == Window.OK) {
- int index = this.subject().specifiedSecondaryTablesSize();
- String name = dialog.getSelectedName();
- String catalog = dialog.getSelectedCatalog();
- String schema = dialog.getSelectedSchema();
- SecondaryTable secondaryTable = this.subject().addSpecifiedSecondaryTable(index);
- secondaryTable.setSpecifiedName(name);
- secondaryTable.setSpecifiedCatalog(catalog);
- secondaryTable.setSpecifiedSchema(schema);
-
- listSelectionModel.setSelectedValue(secondaryTable);
- }
- }
-
- private WritablePropertyValueModel<SecondaryTable> buildSecondaryTableHolder() {
- return new SimplePropertyValueModel<SecondaryTable>();
- }
-
- private ILabelProvider buildSecondaryTableLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- // TODO display a qualified name instead
- SecondaryTable secondaryTable = (SecondaryTable) element;
- if (secondaryTable.getName() != null) {
- return secondaryTable.getName();
- }
- return "";//TODO
- }
- };
- }
-
- private AddRemoveListPane.Adapter buildSecondaryTablesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- SecondaryTableDialog dialog = new SecondaryTableDialog(getControl().getShell(), subject());
- addSecondaryTableFromDialog(dialog, listSelectionModel);
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiMappingsMessages.SecondaryTablesComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- SecondaryTable secondaryTable = (SecondaryTable) listSelectionModel.selectedValue();
- SecondaryTableDialog dialog = new SecondaryTableDialog(getControl().getShell(), secondaryTable, subject());
- editSecondaryTableFromDialog(dialog, secondaryTable);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Entity entity = subject();
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- entity.removeSpecifiedSecondaryTable(selectedIndices[index]);
- }
- }
- };
- }
-
- private ListValueModel<SecondaryTable> buildSecondaryTablesListModel() {
- return new ItemPropertyListValueModelAdapter<SecondaryTable>(buildSecondaryTablesListHolder(),
- Table.SPECIFIED_NAME_PROPERTY);
- }
-
- private ListValueModel<SecondaryTable> buildSecondaryTablesListHolder() {
- return new ListAspectAdapter<Entity, SecondaryTable>(getSubjectHolder(), Entity.SPECIFIED_SECONDARY_TABLES_LIST) {
- @Override
- protected ListIterator<SecondaryTable> listIterator_() {
- return subject.secondaryTables();
- }
-
- @Override
- protected int size_() {
- return subject.secondaryTablesSize();
- }
- };
- }
-
- private void editSecondaryTableDialogOkd(SecondaryTableDialog dialog, SecondaryTable 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 void editSecondaryTableFromDialog(SecondaryTableDialog dialog, SecondaryTable secondaryTable) {
- if (dialog.open() == Window.OK) {
- editSecondaryTableDialogOkd(dialog, secondaryTable);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- WritablePropertyValueModel<SecondaryTable> secondaryTableHolder =
- buildSecondaryTableHolder();
-
- // Secondary Tables add/remove list pane
- new AddRemoveListPane<Entity>(
- this,
- buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin),
- buildSecondaryTablesAdapter(),
- buildSecondaryTablesListModel(),
- secondaryTableHolder,
- buildSecondaryTableLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS//TODO need a help context id for this
- );
-
- // Primary Key Join Columns pane
- new PrimaryKeyJoinColumnsInSecondaryTableComposite(
- this,
- secondaryTableHolder,
- container
- );
- }
-} \ No newline at end of file
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 4da063c44e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/SequenceGeneratorComposite.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.SequenceCombo;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------------- |
- * | Name: | I | |
- * | ----------------------------------------------------- |
- * | ----------------------------------------------------- |
- * | Sequence Generator: | SequenceCombo | |
- * | ----------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see SequenceGenerator
- * @see GenerationComposite - The parent container
- * @see SequenceCombo
- *
- * @version 2.0
- * @since 1.0
- */
-public class SequenceGeneratorComposite extends GeneratorComposite<SequenceGenerator>
-{
- /**
- * Creates a new <code>SequenceGeneratorComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SequenceGeneratorComposite(AbstractFormPane<? extends IdMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected SequenceGenerator buildGenerator() {
- return subject().addSequenceGenerator();
- }
-
- private PropertyValueModel<SequenceGenerator> buildSequenceGeneratorHolder() {
- return new PropertyAspectAdapter<IdMapping, SequenceGenerator>(getSubjectHolder(), propertyName()) {
- @Override
- protected SequenceGenerator buildValue_() {
- return subject.getSequenceGenerator();
- }
- };
- }
-
- private SequenceCombo<SequenceGenerator> buildSequenceNameCombo(Composite parent) {
-
- return new SequenceCombo<SequenceGenerator>(this, buildSequenceGeneratorHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator.DEFAULT_SEQUENCE_NAME_PROPERTY);
- propertyNames.add(SequenceGenerator.SPECIFIED_SEQUENCE_NAME_PROPERTY);
- }
-
- @Override
- protected void buildSubject() {
- SequenceGeneratorComposite.this.buildGenerator();
- }
-
- @Override
- protected String defaultValue() {
- return JptUiMappingsMessages.SequenceGeneratorComposite_default;
- }
-
- @Override
- protected boolean isBuildSubjectAllowed() {
- return true;
- }
-
- @Override
- protected JpaProject jpaProject() {
- return SequenceGeneratorComposite.this.jpaProject();
- }
-
- @Override
- protected Schema schema() {
- // TODO
- return null;
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedSequenceName(value);
- }
-
- @Override
- protected String value() {
- SequenceGenerator generator = generator();
-
- if (generator != null) {
- return generator.getSpecifiedSequenceName();
- }
-
- return null;
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected SequenceGenerator generator(IdMapping subject) {
- return subject.getSequenceGenerator();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- Text nameText = buildNameText(container);
- setNameText(nameText);
-
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.SequenceGeneratorComposite_name,
- nameText,
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME
- );
-
- // Sequence Generator widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.SequenceGeneratorComposite_sequence,
- buildSequenceNameCombo(container),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String propertyName() {
- return IdMapping.SEQUENCE_GENERATOR_PROPERTY;
- }
-} \ No newline at end of file
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 e8602e263f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableComposite.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.db.internal.Schema;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.CatalogCombo;
-import org.eclipse.jpt.ui.internal.mappings.db.SchemaCombo;
-import org.eclipse.jpt.ui.internal.mappings.db.TableCombo;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Table ----------------------------------------------------------------- |
- * | | ------------------------------------------------------------ | |
- * | | Table: | TableCombo | | |
- * | | ------------------------------------------------------------ | |
- * | | ------------------------------------------------------------ | |
- * | | Catalog: | CatalogCombo | | |
- * | | ------------------------------------------------------------ | |
- * | | ------------------------------------------------------------ | |
- * | | Schema: | SchemaCombo | | |
- * | | ------------------------------------------------------------ | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Table
- * @see EntityComposite - The parent container
- * @see TableCombo
- * @see CatalogCombo
- * @see SchemaCombo
- *
- * @TODO repopulate this panel based on the Entity table changing
- *
- * @version 2.0
- * @since 1.0
- */
-public class TableComposite extends AbstractFormPane<Table>
-{
- /**
- * Creates a new <code>TableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- */
- public TableComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends Table> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>TableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ITable</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public TableComposite(PropertyValueModel<? extends Table> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private CatalogCombo<Table> buildCatalogCombo(Composite container) {
-
- return new CatalogCombo<Table>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(Table.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedCatalog(value);
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedCatalog();
- }
- };
- }
-
- private SchemaCombo<Table> buildSchemaCombo(Composite container) {
-
- return new SchemaCombo<Table>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(Table.SPECIFIED_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultSchema();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedSchema(value);
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedSchema();
- }
- };
- }
-
- private TableCombo<Table> buildTableCombo(Composite container) {
-
- return new TableCombo<Table>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_NAME_PROPERTY);
- propertyNames.add(Table.SPECIFIED_NAME_PROPERTY);
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedName(value);
- }
-
- @Override
- protected org.eclipse.jpt.db.internal.Table table() {
- return subject().dbTable();
- }
-
- private Schema tableSchema() {
- return database().schemaNamed(subject().getSchema());
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedName();
- }
-
- @Override
- protected Iterator<String> values() {
- Schema schema = tableSchema();
-
- if (schema != null) {
- return schema.tableNames();
- }
-
- return EmptyIterator.instance();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Table group pane
- Group tableGroupPane = buildTitledPane(
- container,
- JptUiMappingsMessages.TableComposite_tableSection
- );
-
- // Table widgets
- buildLabeledComposite(
- tableGroupPane,
- JptUiMappingsMessages.TableChooser_label,
- buildTableCombo(tableGroupPane),
- JpaHelpContextIds.ENTITY_TABLE
- );
-
- // Catalog widgets
- buildLabeledComposite(
- tableGroupPane,
- JptUiMappingsMessages.CatalogChooser_label,
- buildCatalogCombo(tableGroupPane),
- JpaHelpContextIds.ENTITY_CATALOG
- );
-
- // Schema widgets
- buildLabeledComposite(
- tableGroupPane,
- JptUiMappingsMessages.SchemaChooser_label,
- buildSchemaCombo(tableGroupPane),
- JpaHelpContextIds.ENTITY_SCHEMA
- );
- }
-} \ No newline at end of file
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 edb73bfe76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TableGeneratorComposite.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.TableGenerator;
-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.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.mappings.db.ColumnCombo;
-import org.eclipse.jpt.ui.internal.mappings.db.TableCombo;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------- |
- * | Name: | I | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Table: | I |v| |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Primary Key Column: | I |v| |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Value Column: | I |v| |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Primary Key Column Value: | I |v| |
- * | ----------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see TableGenerator
- * @see GenerationComposite - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-public class TableGeneratorComposite extends GeneratorComposite<TableGenerator>
-{
- /**
- * Creates a new <code>TableGeneratorComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TableGeneratorComposite(AbstractFormPane<? extends IdMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected TableGenerator buildGenerator() {
- return subject().addTableGenerator();
- }
-
- private ColumnCombo<TableGenerator> buildPkColumnNameCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, buildTableGeneratorHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_PK_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_PK_COLUMN_NAME_PROPERTY);
- }
-
- @Override
- protected void buildSubject() {
- TableGeneratorComposite.this.buildGenerator();
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultPkColumnName();
- }
-
- @Override
- protected boolean isBuildSubjectAllowed() {
- return true;
- }
-
- @Override
- protected JpaProject jpaProject() {
- return TableGeneratorComposite.this.jpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedPkColumnName(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedPkColumnName();
- }
-
- @Override
- protected Iterator<String> values() {
- if ((subject() == null) || (table() == null)) {
- return EmptyIterator.instance();
- }
- return table().columnNames();
- }
- };
- }
-
- private ColumnCombo<TableGenerator> buildPkColumnValueCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, buildTableGeneratorHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_PK_COLUMN_VALUE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_PK_COLUMN_VALUE_PROPERTY);
- }
-
- @Override
- protected void buildSubject() {
- TableGeneratorComposite.this.buildGenerator();
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultPkColumnValue();
- }
-
- @Override
- protected boolean isBuildSubjectAllowed() {
- return true;
- }
-
- @Override
- protected JpaProject jpaProject() {
- return TableGeneratorComposite.this.jpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedPkColumnValue(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedPkColumnValue();
- }
-
- @Override
- protected Iterator<String> values() {
- if ((subject() == null) || (table() == null)) {
- return EmptyIterator.instance();
- }
- return table().columnNames();
- }
- };
- }
-
- private PropertyValueModel<TableGenerator> buildTableGeneratorHolder() {
- return new PropertyAspectAdapter<IdMapping, TableGenerator>(getSubjectHolder(), propertyName()) {
- @Override
- protected TableGenerator buildValue_() {
- return subject.getTableGenerator();
- }
- };
- }
-
- private TableCombo<TableGenerator> buildTableNameCombo(Composite parent) {
-
- return new TableCombo<TableGenerator>(this, buildTableGeneratorHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected void buildSubject() {
- TableGeneratorComposite.this.buildGenerator();
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultTable();
- }
-
- @Override
- protected boolean isBuildSubjectAllowed() {
- return true;
- }
-
- @Override
- protected JpaProject jpaProject() {
- return TableGeneratorComposite.this.jpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedTable(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedTable();
- }
-
- @Override
- protected Iterator<String> values() {
-
- if (subject() == null) {
- return EmptyIterator.instance();
- }
-
- String schemaName = subject().getSchema();
- Database database = database();
-
- if ((schemaName != null) && (database != null)) {
- Schema schema = database.schemaNamed(schemaName);
-
- if (schema != null) {
- return schema.tableNames();
- }
- }
-
- return EmptyIterator.instance();
- }
- };
- }
-
- private ColumnCombo<TableGenerator> buildValueColumnCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, buildTableGeneratorHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_VALUE_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_VALUE_COLUMN_NAME_PROPERTY);
- }
-
- @Override
- protected void buildSubject() {
- TableGeneratorComposite.this.buildGenerator();
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultValueColumnName();
- }
-
- @Override
- protected boolean isBuildSubjectAllowed() {
- return true;
- }
-
- @Override
- protected JpaProject jpaProject() {
- return TableGeneratorComposite.this.jpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedValueColumnName(value);
- }
-
- @Override
- protected Table table() {
- return subject().dbTable();
- }
-
- @Override
- protected String value() {
- return subject().getSpecifiedValueColumnName();
- }
-
- @Override
- protected Iterator<String> values() {
- if ((subject() == null) || (table() == null)) {
- return EmptyIterator.instance();
- }
- return table().columnNames();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected TableGenerator generator(IdMapping subject) {
- return (subject != null) ? subject.getTableGenerator() : null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- Text nameText = buildNameText(container);
- setNameText(nameText);
-
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.TableGeneratorComposite_name,
- nameText.getParent(),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_NAME
- );
-
- // Table widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.TableGeneratorComposite_table,
- buildTableNameCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_TABLE
- );
-
- // Primary Key Column widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.TableGeneratorComposite_pkColumn,
- buildPkColumnNameCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN
- );
-
- // Value Column widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.TableGeneratorComposite_valueColumn,
- buildValueColumnCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_VALUE_COLUMN
- );
-
- // Primary Key Column Value widgets
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.TableGeneratorComposite_pkColumnValue,
- buildPkColumnValueCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String propertyName() {
- return IdMapping.TABLE_GENERATOR_PROPERTY;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityComposite.java
deleted file mode 100644
index 512000d1e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TargetEntityComposite.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jdt.core.IJavaElement;
-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.context.RelationshipMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.WidgetFactory;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------- ------------- |
- * | Target Entity: | I |v| | Browse... | |
- * | ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ -------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see RelationshipMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class TargetEntityComposite extends AbstractFormPane<RelationshipMapping>
-{
- private CCombo combo;
-
- /**
- * Creates a new <code>TargetEntityComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetEntityComposite(AbstractFormPane<? extends RelationshipMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>TargetEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IRelationshipMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public TargetEntityComposite(PropertyValueModel<? extends RelationshipMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(RelationshipMapping.DEFAULT_TARGET_ENTITY_PROPERTY);
- propertyNames.add(RelationshipMapping.SPECIFIED_TARGET_ENTITY_PROPERTY);
- }
-
- private FocusListener buildFocusListener() {
-
- return new FocusListener() {
-
- public void focusGained(FocusEvent e) {
-
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
-
- if (combo.getSelectionIndex() == 0) {
- setPopulating(true);
-
- try {
- combo.setText("");
- }
- finally {
- setPopulating(false);
- }
- }
- }
- }
-
- public void focusLost(FocusEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
-
- if (combo.getText().length() == 0) {
- setPopulating(true);
-
- try {
- combo.select(0);
- }
- finally {
- setPopulating(false);
- }
- }
- }
- }
- };
- }
-
- private Runnable buildOpenTargetEntityAction() {
- return new Runnable() {
- public void run() {
- TargetEntityComposite.this.openEditor();
- }
- };
- }
-
- private Runnable buildOpenTypeAction() {
- return new Runnable() {
- public void run() {
- BusyIndicator.showWhile(combo.getDisplay(), new Runnable() {
- public void run() {
- doOpenSelectionDialog();
- }
- });
- }
- };
- }
-
- private ModifyListener buildTargetEntityModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- CCombo combo = (CCombo) e.widget;
- valueChanged(combo.getText());
- }
- }
- };
- }
-
- private Button buildTargetEntitySelectionButton(Composite parent) {
- return buildPushButton(
- parent,
- JptUiMappingsMessages.TargetEntityChooser_browse,
- buildOpenTypeAction()
- );
- }
-
- private void doOpenSelectionDialog() {
- SelectionDialog dialog;
-
- try {
- dialog = JavaUI.createTypeDialog(
- getControl().getShell(),
- PlatformUI.getWorkbench().getProgressService(),
- SearchEngine.createWorkspaceScope(),
- IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
- false
- );
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- return;
- }
-
- dialog.setTitle(JptUiMappingsMessages.TargetEntityChooser_selectTypeTitle);
-
- if (dialog.open() == Window.OK) {
- IType type = (IType) dialog.getResult()[0];
- this.combo.setText(type.getFullyQualifiedName('$'));
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
-
- super.doPopulate();
-
- combo.removeAll();
- populateCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- combo = buildEditableCCombo(container);
- combo.add(JptUiMappingsMessages.TargetEntityChooser_defaultEmpty);
- combo.addModifyListener(buildTargetEntityModifyListener());
- combo.addFocusListener(buildFocusListener());
-
- Hyperlink labelLink = buildHyperLink(container,
- JptUiMappingsMessages.TargetEntityChooser_label,
- buildOpenTargetEntityAction()
- );
-
- buildLabeledComposite(
- container,
- labelLink,
- combo,
- buildTargetEntitySelectionButton(container),
- JpaHelpContextIds.MAPPING_TARGET_ENTITY
- );
- }
-
- private void openEditor() {
-
- String targetEntity = subject().getTargetEntity();
-
- if (targetEntity != null) {
-
- try {
- IType type = subject().jpaProject().javaProject().findType(targetEntity);
-
- if (type != null) {
- IJavaElement javaElement = type.getParent();
- JavaUI.openInEditor(javaElement, true, true);
- }
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- }
- catch (PartInitException e) {
- JptUiPlugin.log(e);
- }
- }
- }
-
- private void populateCombo() {
-
- populateDefaultValue();
- // TODO Add possible target entity names
- updateSelectedItem();
- }
-
- /**
- * Adds the default value to the combo if one exists.
- */
- private void populateDefaultValue() {
-
- RelationshipMapping entity = subject();
- String defaultValue = (entity != null) ? entity.getDefaultTargetEntity() : null;
-
- if (defaultValue != null) {
- combo.add(NLS.bind(
- JptUiMappingsMessages.TargetEntityChooser_defaultWithOneParam,
- defaultValue
- ));
- }
- else {
- combo.add(JptUiMappingsMessages.TargetEntityChooser_defaultEmpty);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == RelationshipMapping.DEFAULT_TARGET_ENTITY_PROPERTY ||
- propertyName == RelationshipMapping.SPECIFIED_TARGET_ENTITY_PROPERTY) {
-
- populateCombo();
- }
- }
-
- /**
- * Updates the selected item by selected the current value, if not
- * <code>null</code>, or select the default value if one is available,
- * otherwise remove the selection.
- * <p>
- * <b>Note:</b> It seems the text can be shown as truncated, changing the
- * selection to (0, 0) makes the entire text visible.
- */
- private void updateSelectedItem() {
- RelationshipMapping subject = subject();
- String value = (subject != null) ? subject.getSpecifiedTargetEntity() : null;
-
- if (value != null) {
- combo.setText(value);
- combo.setSelection(new Point(0, 0));
- }
- else {
- String defaultValue = (subject != null) ? subject.getDefaultTargetEntity() : null;
- String displayString = JptUiMappingsMessages.TargetEntityChooser_defaultEmpty;
-
- if (defaultValue != null) {
- displayString = NLS.bind(
- JptUiMappingsMessages.ColumnComposite_defaultWithOneParam,
- defaultValue
- );
- }
-
- // Selected the default value
- if (displayString != null) {
- combo.select(0);
- combo.setSelection(new Point(0, 0));
- }
- // Remove the selection
- else {
- combo.select(-1);
- }
- }
- }
-
- private void valueChanged(String value) {
-
- RelationshipMapping subject = subject();
- String oldValue = (subject != null) ? subject.getSpecifiedTargetEntity() : null;
-
- // Check for null value
- if (StringTools.stringIsEmpty(value)) {
- value = null;
-
- if (StringTools.stringIsEmpty(oldValue)) {
- return;
- }
- }
-
- // The default value
- if (value != null &&
- combo.getItemCount() > 0 &&
- value.equals(combo.getItem(0)))
- {
- value = null;
- }
-
- // Nothing to change
- if ((oldValue == value) && value == null) {
- return;
- }
-
- // Set the new value
- if ((value != null) && (oldValue == null) ||
- ((oldValue != null) && !oldValue.equals(value))) {
-
- setPopulating(true);
-
- try {
- subject.setSpecifiedTargetEntity(value);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TemporalTypeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TemporalTypeComposite.java
deleted file mode 100644
index caa87f2e32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TemporalTypeComposite.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------------- |
- * | Temporal: | |v| |
- * | --------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see ColumnMapping
- * @see BasicMappingComposite - A container of this widget
- * @see IdMappingComposite - A container of this widget
- * @see VersionMappingComposite - A container of this widget
- *
- * @version 2.0
- * @since 1.0
- */
-public class TemporalTypeComposite extends AbstractFormPane<ColumnMapping> {
-
- /**
- * Creates a new <code>TemporalTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TemporalTypeComposite(AbstractFormPane<? extends ColumnMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<ColumnMapping, TemporalType> buildTemporalCombo(Composite container) {
-
- return new EnumFormComboViewer<ColumnMapping, TemporalType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ColumnMapping.TEMPORAL_PROPERTY);
- }
-
- @Override
- protected TemporalType[] choices() {
- return TemporalType.values();
- }
-
- @Override
- protected TemporalType defaultValue() {
- return null;
- }
-
- @Override
- protected String displayString(TemporalType value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- TemporalTypeComposite.this,
- value.name()
- );
- }
-
- @Override
- protected TemporalType getValue() {
- return subject().getTemporal();
- }
-
- @Override
- protected void setValue(TemporalType value) {
- subject().setTemporal(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- buildLabeledComposite(
- container,
- JptUiMappingsMessages.BasicGeneralSection_temporalLabel,
- buildTemporalCombo(container),
- JpaHelpContextIds.MAPPING_TEMPORAL
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientMappingComposite.java
deleted file mode 100644
index 34536d0360..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/TransientMappingComposite.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This pane does not have any widgets.
- *
- * @see TransientMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class TransientMappingComposite extends AbstractFormPane<TransientMapping>
- implements JpaComposite<TransientMapping>
-{
- /**
- * Creates a new <code>TransientMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ITransientMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public TransientMappingComposite(PropertyValueModel<? extends TransientMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionMappingComposite.java
deleted file mode 100644
index 98977a225f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/VersionMappingComposite.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.mappings.details;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see VersionMapping
- * @see BaseJpaUiFactory - The factory creating this pane
- * @see ColumnComposite
- * @see TemporalTypeComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class VersionMappingComposite extends AbstractFormPane<VersionMapping>
- implements JpaComposite<VersionMapping>
-{
- /**
- * Creates a new <code>VersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IVersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public VersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private PropertyValueModel<Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<VersionMapping, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(VersionMapping value) {
- return value.getColumn();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = groupBoxMargin();
-
- // Column widgets
- new ColumnComposite(this, buildColumnHolder(), container);
-
- // Temporal Type widgets
- new TemporalTypeComposite(
- this,
- buildSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorContentProvider.java
deleted file mode 100644
index 57971c3cc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorContentProvider.java
+++ /dev/null
@@ -1,258 +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.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-
-/**
- * This extension of navigator content provider delegates to the platform UI
- * (see the org.eclipse.jpt.ui.jpaPlatform extension point) for navigator content.
- *
- * If there is a platform UI for the given project, this content provider will
- * provide a root "JPA Content" node (child of the project), otherwise there
- * will be no content. For children of the "JPA Content" node (or for any other
- * sub-node), this provider will delegate to the content provider returned by the
- * platform UI implementation.
- */
-public class JpaNavigatorContentProvider
- implements ICommonContentProvider
-{
- private IFacetedProjectListener facetListener;
-
- private StructuredViewer viewer;
-
- /**
- * Exactly *one* of these is created for each view that utilizes it. Therefore,
- * as we delegate to the platform UI for each project, we should maintain the
- * same multiplicity. That is, if there is a delegate for each platform UI, we
- * should maintain *one* delegate for each view.
- *
- * Key: platform id, Value: delegate content provider
- */
- private Map<String, ICommonContentProvider> delegateContentProviders;
-
-
- public JpaNavigatorContentProvider() {
- super();
- delegateContentProviders = new HashMap<String, ICommonContentProvider>();
- facetListener = new FacetListener();
- FacetedProjectFramework.addListener(
- facetListener,
- IFacetedProjectEvent.Type.POST_INSTALL,
- IFacetedProjectEvent.Type.POST_UNINSTALL,
- IFacetedProjectEvent.Type.PROJECT_MODIFIED);
- }
-
-
- // **************** IContentProvider implementation ************************
-
- public void dispose() {
- FacetedProjectFramework.removeListener(facetListener);
- for (ICommonContentProvider delegate : delegateContentProviders.values()) {
- delegate.dispose();
- }
- delegateContentProviders.clear();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // should always be a StructuredViewer
- this.viewer = (StructuredViewer) viewer;
- for (ICommonContentProvider delegate : delegateContentProviders.values()) {
- delegate.inputChanged(viewer, oldInput, newInput);
- }
- }
-
-
- // **************** IStructuredContentProvider implementation **************
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
-
- // **************** ITreeContentProvider implementation ********************
-
- public Object getParent(Object element) {
- ICommonContentProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.getParent(element);
- }
-
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) element).getAdapter(IProject.class);
-
- if (project != null) {
- JpaProject jpaProject = JptCorePlugin.jpaProject(project);
- if (jpaProject != null) {
- JpaPlatformUi platformUi = JptUiPlugin.getPlugin().jpaPlatformUi(jpaProject.jpaPlatform());
-
- return platformUi != null;
- }
- }
- }
-
- ICommonContentProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.hasChildren(element);
- }
-
- return false;
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof IAdaptable) {
- IProject project = (IProject) ((IAdaptable) parentElement).getAdapter(IProject.class);
-
- if (project != null) {
- JpaProject jpaProject = JptCorePlugin.jpaProject(project);
- if (jpaProject != null) {
- JpaPlatformUi platformUi = JptUiPlugin.getPlugin().jpaPlatformUi(jpaProject.jpaPlatform());
-
- if (platformUi != null) {
- return new Object[] {jpaProject.contextModel()};
- }
- }
- }
- }
-
- ICommonContentProvider delegate = getDelegate(parentElement);
-
- if (delegate != null) {
- return delegate.getChildren(parentElement);
- }
-
- return new Object[0];
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- for (ICommonContentProvider delegate : delegateContentProviders.values()) {
- delegate.saveState(memento);
- }
- }
-
- public void restoreState(IMemento memento) {
- for (ICommonContentProvider delegate : delegateContentProviders.values()) {
- delegate.restoreState(memento);
- }
- }
-
-
- // **************** ICommonContentProvider implementation ******************
-
- public void init(ICommonContentExtensionSite config) {
- for (ICommonContentProvider delegate : delegateContentProviders.values()) {
- delegate.init(config);
- }
- }
-
-
- // *************** internal ************************************************
-
- private ICommonContentProvider getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JpaContextNode contextNode = (JpaContextNode) ((IAdaptable) element).getAdapter(JpaContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JpaPlatform platform = contextNode.jpaProject().jpaPlatform();
- JpaPlatformUi platformUi = JptUiPlugin.getPlugin().jpaPlatformUi(platform);
-
- ICommonContentProvider delegate = delegateContentProviders.get(platform.getId());
-
- if (delegate == null && platform != null && ! delegateContentProviders.containsKey(platform.getId())) {
- delegate = platformUi.buildNavigatorContentProvider();
- delegateContentProviders.put(platform.getId(), delegate);
- }
-
- return delegate;
- }
-
-
- // **************** member classes *****************************************
-
- private class FacetListener
- implements IFacetedProjectListener
- {
- public void handleEvent(IFacetedProjectEvent event) {
- if (event.getType() == IFacetedProjectEvent.Type.PROJECT_MODIFIED) {
- refreshViewer(event.getProject().getProject());
- }
- else if (event.getType() == IFacetedProjectEvent.Type.POST_INSTALL
- || event.getType() == IFacetedProjectEvent.Type.POST_UNINSTALL) {
- IProjectFacetActionEvent ipaEvent = (IProjectFacetActionEvent) event;
- if (ipaEvent.getProjectFacet().equals(
- ProjectFacetsManager.getProjectFacet(JptCorePlugin.FACET_ID))) {
- refreshViewer(ipaEvent.getProject().getProject());
- }
- }
- }
-
- private void refreshViewer(final IProject project) {
- if (viewer != null
- && viewer.getControl() != null
- && !viewer.getControl().isDisposed()) {
- // Using job here so that project model update (which also uses
- // a job) will complete first
- Job refreshJob = new Job("Refresh viewer") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // Using runnable here so that refresh will go on correct thread
- viewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- viewer.refresh(project);
- }
- });
- return Status.OK_STATUS;
- }
- };
- refreshJob.setRule(project);
- refreshJob.schedule();
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorLabelProvider.java
deleted file mode 100644
index cd2bebab0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/navigator/JpaNavigatorLabelProvider.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.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * This extension of navigator label provider delegates to the platform UI
- * (see the org.eclipse.jpt.ui.jpaPlatform extension point) for navigator labels.
- *
- * This label provider provides a label for the root "JPA Content" node provided
- * by the content provider (see {@link JpaNavigatorContentProvider}) and delegates
- * to the label provider returned by the platform UI implementation for labels
- * for children of the "JPA Content" node (or for any other sub-node).
- */
-public class JpaNavigatorLabelProvider extends LabelProvider
- implements ICommonLabelProvider
-{
- /**
- * Exactly *one* of these is created for each view that utilizes it. Therefore,
- * as we delegate to the platform UI for each project, we should maintain the
- * same multiplicity. That is, if there is a delegate for each platform UI, we
- * should maintain *one* delegate for each view.
- *
- * Key: platform id, Value: delegate label provider
- */
- private Map<String, ICommonLabelProvider> delegateLabelProviders;
-
- private ILabelProviderListener delegateLabelProviderListener;
-
-
- public JpaNavigatorLabelProvider() {
- super();
- delegateLabelProviders = new HashMap<String, ICommonLabelProvider>();
- delegateLabelProviderListener = new DelegateLabelProviderListener();
- }
-
-
- // **************** IBaseLabelProvider implementation **********************
-
- public void addListener(ILabelProviderListener listener) {
- super.addListener(listener);
- }
-
- public void removeListener(ILabelProviderListener listener) {
- super.removeListener(listener);
- }
-
- public boolean isLabelProperty(Object element, String property) {
- ICommonLabelProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.isLabelProperty(element, property);
- }
-
- return super.isLabelProperty(element, property);
- }
-
- public void dispose() {
- super.dispose();
- for (ICommonLabelProvider delegate : delegateLabelProviders.values()) {
- delegate.dispose();
- }
- delegateLabelProviders.clear();
- }
-
-
- // **************** ILabelProvider implementation **************************
-
- public Image getImage(Object element) {
- ICommonLabelProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.getImage(element);
- }
-
- return super.getImage(element);
- }
-
- public String getText(Object element) {
- ICommonLabelProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.getText(element);
- }
-
- return super.getText(element);
- }
-
-
- // **************** IDescriptionProvider implementation ********************
-
- public String getDescription(Object element) {
- ICommonLabelProvider delegate = getDelegate(element);
-
- if (delegate != null) {
- return delegate.getDescription(element);
- }
-
- // no "super" implementation - default to getText(..) for description
- return super.getText(element);
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- for (ICommonLabelProvider delegate : delegateLabelProviders.values()) {
- delegate.saveState(memento);
- }
- }
-
- public void restoreState(IMemento memento) {
- for (ICommonLabelProvider delegate : delegateLabelProviders.values()) {
- delegate.restoreState(memento);
- }
- }
-
-
- // **************** ICommonLabelProvider implementation ********************
-
- public void init(ICommonContentExtensionSite config) {
- for (ICommonLabelProvider delegate : delegateLabelProviders.values()) {
- delegate.init(config);
- }
- }
-
-
- // *************** internal ************************************************
-
- private ICommonLabelProvider getDelegate(Object element) {
- if (! (element instanceof IAdaptable)) {
- return null;
- }
-
- JpaContextNode contextNode = (JpaContextNode) ((IAdaptable) element).getAdapter(JpaContextNode.class);
-
- if (contextNode == null) {
- return null;
- }
-
- JpaPlatform platform = contextNode.jpaProject().jpaPlatform();
- JpaPlatformUi platformUi = JptUiPlugin.getPlugin().jpaPlatformUi(platform);
-
- ICommonLabelProvider delegate = delegateLabelProviders.get(platform.getId());
-
- if (delegate == null && platform != null && ! delegateLabelProviders.containsKey(platform.getId())) {
- delegate = platformUi.buildNavigatorLabelProvider();
- delegate.addListener(delegateLabelProviderListener);
- delegateLabelProviders.put(platform.getId(), delegate);
- }
-
- return delegate;
- }
-
-
- private class DelegateLabelProviderListener
- implements ILabelProviderListener
- {
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- fireLabelProviderChanged(event);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/JptUiOrmMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/JptUiOrmMessages.java
deleted file mode 100644
index eca8dab30d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/JptUiOrmMessages.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptUiOrmMessages
-{
- private static final String BUNDLE_NAME = "jpt_ui_orm"; //$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 EntityMappingsDetailsPage_package;
-
- public static String EntityMappingsPage_XmlMappingMetadataCompleteCheckBox;
- public static String EntityMappingsPage_CascadePersistCheckBox;
- public static String EntityMappingsPage_PersistenceUnitSection;
- public static String EntityMappingsPage_SchemaDefault;
- public static String EntityMappingsPage_SchemaNoDefaultSpecified;
- public static String EntityMappingsPage_CatalogDefault;
- public static String EntityMappingsPage_CatalogNoDefaultSpecified;
-
- public static String OrmSchemaChooser_SchemaChooser;
- public static String OrmCatalogChooser_CatalogChooser;
-
- public static String OrmJavaClassChooser_browse;
- public static String OrmJavaClassChooser_XmlJavaClassDialog_title;
- public static String OrmJavaClassChooser_XmlJavaClassDialog_message;
- public static String OrmPackageChooser_PackageDialog_title;
- public static String OrmPackageChooser_PackageDialog_message;
-
- public static String AccessTypeComposite_field;
- public static String AccessTypeComposite_property;
-
- public static String EntityMappingsDetailsPage_field;
- public static String EntityMappingsDetailsPage_property;
-
- public static String PersistenceUnitMetadataComposite_field;
- public static String PersistenceUnitMetadataComposite_property;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, JptUiOrmMessages.class);
- }
-
- private JptUiOrmMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/AccessTypeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/AccessTypeComposite.java
deleted file mode 100644
index 676480864d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/AccessTypeComposite.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see XmlTypeMapping
- * @see OrmPersistentTypeDetailsPage - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class AccessTypeComposite extends AbstractFormPane<OrmTypeMapping> {
-
- /**
- * Creates a new <code>AccessTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public AccessTypeComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- private EnumFormComboViewer<OrmTypeMapping, AccessType> buildAccessTypeComboViewer(Composite container) {
-
- return new EnumFormComboViewer<OrmTypeMapping, AccessType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmTypeMapping.DEFAULT_ACCESS_PROPERTY);
- propertyNames.add(OrmTypeMapping.SPECIFIED_ACCESS_PROPERTY);
- }
-
- @Override
- protected AccessType[] choices() {
- return AccessType.values();
- }
-
- @Override
- protected AccessType defaultValue() {
- return subject().getDefaultAccess();
- }
-
- @Override
- protected String displayString(AccessType value) {
- return buildDisplayString(
- JptUiOrmMessages.class,
- AccessTypeComposite.this,
- value
- );
- }
-
- @Override
- protected AccessType getValue() {
- return subject().getSpecifiedAccess();
- }
-
- @Override
- protected void setValue(AccessType value) {
- subject().setSpecifiedAccess(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- EnumFormComboViewer<OrmTypeMapping, AccessType> comboViewer =
- buildAccessTypeComboViewer(container);
-
- buildLabeledComposite(
- container,
- JptUiOrmMessages.PersistentTypePage_AccessLabel,
- comboViewer.getControl()
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/EntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/EntityMappingsDetailsPage.java
deleted file mode 100644
index 6e40fe1e32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/EntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.AbstractJpaDetailsPage;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EntityMappingsDetailsPage - The parent container
- * @see PersistenceUnitMetadataComposite
- * @see OrmPackageChooser
- *
- * @version 2.0
- * @since 2.0
- */
-public class EntityMappingsDetailsPage extends AbstractJpaDetailsPage<EntityMappings>
-{
- /**
- * Creates a new <code>XmlEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EntityMappingsDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- private EnumFormComboViewer<EntityMappings, AccessType> buildAccessTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EntityMappings, AccessType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_ACCESS_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_ACCESS_PROPERTY);
- }
-
- @Override
- protected AccessType[] choices() {
- return AccessType.values();
- }
-
- @Override
- protected AccessType defaultValue() {
- return subject().getDefaultAccess();
- }
-
- @Override
- protected String displayString(AccessType value) {
- return buildDisplayString(
- JptUiOrmMessages.class,
- EntityMappingsDetailsPage.this,
- value
- );
- }
-
- @Override
- protected AccessType getValue() {
- return subject().getAccess();
- }
-
- @Override
- protected void setValue(AccessType value) {
- subject().setSpecifiedAccess(value);
- }
- };
- }
-
- private EnumFormComboViewer<EntityMappings, String> buildCatalogComboViewer(Composite container) {
-
- return new EnumFormComboViewer<EntityMappings, String>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String[] choices() {
- return new String[0];
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultCatalog();
- }
-
- @Override
- protected String displayString(String value) {
- return value;
- }
-
- @Override
- protected String getValue() {
- return subject().getSpecifiedCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedCatalog(value);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitMetadata> buildPersistentUnitMetadaHolder() {
- return new TransformationPropertyValueModel<EntityMappings, PersistenceUnitMetadata>(getSubjectHolder()) {
- @Override
- protected PersistenceUnitMetadata transform_(EntityMappings value) {
- return value.getPersistenceUnitMetadata();
- }
- };
- }
-
- private EnumFormComboViewer<EntityMappings, String> buildSchemaComboViewer(Composite container) {
-
- return new EnumFormComboViewer<EntityMappings, String>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String[] choices() {
- return new String[0];
- }
-
- @Override
- protected String defaultValue() {
- return subject().getDefaultSchema();
- }
-
- @Override
- protected String displayString(String value) {
- return value;
- }
-
- @Override
- protected String getValue() {
- return subject().getSpecifiedSchema();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSpecifiedSchema(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Package widgets
- new OrmPackageChooser(
- this,
- container
- );
-
- // Schema widgets
- EnumFormComboViewer<EntityMappings, String> schemaComboViewer =
- buildSchemaComboViewer(container);
-
- buildLabeledComposite(
- container,
- JptUiOrmMessages.OrmSchemaChooser_SchemaChooser,
- schemaComboViewer.getControl(),
- JpaHelpContextIds.ENTITY_ORM_SCHEMA
- );
-
- // Catalog widgets
- EnumFormComboViewer<EntityMappings, String> catalogComboViewer =
- buildCatalogComboViewer(container);
-
- buildLabeledComposite(
- container,
- JptUiOrmMessages.OrmCatalogChooser_CatalogChooser,
- catalogComboViewer.getControl(),
- JpaHelpContextIds.ENTITY_ORM_CATALOG
- );
-
- // Access Type widgets
- EnumFormComboViewer<EntityMappings, AccessType> accessTypeComposite =
- buildAccessTypeCombo(container);
-
- buildLabeledComposite(
- container,
- JptUiOrmMessages.PersistentTypePage_AccessLabel,
- accessTypeComposite.getControl(),
- JpaHelpContextIds.ENTITY_ORM_ACCESS
- );
-
- // Persistence Unit Metadata widgets
- new PersistenceUnitMetadataComposite(
- this,
- buildPersistentUnitMetadaHolder(),
- buildSubPane(container, 5)
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/MetaDataCompleteComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/MetaDataCompleteComboViewer.java
deleted file mode 100644
index 7afa830f47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/MetaDataCompleteComboViewer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * </pre>
- *
- * @see XmlTypeMapping
- * @see OrmPersistentTypeDetailsPage - The container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class MetaDataCompleteComboViewer extends AbstractFormPane<OrmTypeMapping>
-{
- /**
- * Creates a new <code>MetaDataCompleteComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public MetaDataCompleteComboViewer(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>MetaDataCompleteComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public MetaDataCompleteComboViewer(PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private EnumFormComboViewer<OrmTypeMapping, Boolean> buildEnumTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<OrmTypeMapping, Boolean>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmTypeMapping.DEFAULT_METADATA_COMPLETE_PROPERTY);
- propertyNames.add(OrmTypeMapping.SPECIFIED_METADATA_COMPLETE_PROPERTY);
- }
-
- @Override
- protected Boolean[] choices() {
- return new Boolean[] { Boolean.TRUE, Boolean.FALSE };
- }
-
- @Override
- protected Boolean defaultValue() {
- return null;
- }
-
- @Override
- protected String displayString(Boolean value) {
- return buildDisplayString(
- JptUiMappingsMessages.class,
- MetaDataCompleteComboViewer.this,
- value
- );
- }
-
- @Override
- protected Boolean getValue() {
- return subject().getSpecifiedMetadataComplete();
- }
-
- @Override
- protected void setValue(Boolean value) {
- subject().setSpecifiedMetadataComplete(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- buildEnumTypeCombo(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmDetailsProvider.java
deleted file mode 100644
index 8a058efcdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmDetailsProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPage}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 2.0
- * @since 1.0
- */
-public class OrmDetailsProvider
- implements JpaDetailsProvider
-{
- public OrmDetailsProvider() {
- super();
- }
-
- public JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(
- Composite parent,
- Object contentNodeId,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- if (contentNodeId == OrmStructureNodes.ENTITY_MAPPINGS_ID) {
- return new EntityMappingsDetailsPage(parent, widgetFactory);
- }
-
- if (contentNodeId == OrmStructureNodes.PERSISTENT_TYPE_ID) {
- return new OrmPersistentTypeDetailsPage(parent, widgetFactory);
- }
-
- if (contentNodeId == OrmStructureNodes.PERSISTENT_ATTRIBUTE_ID) {
- return new OrmPersistentAttributeDetailsPage(parent, widgetFactory);
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaAttributeChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaAttributeChooser.java
deleted file mode 100644
index ec804e7220..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaAttributeChooser.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @see OrmPersistentAttributeDetailsPage - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class OrmJavaAttributeChooser extends AbstractFormPane<OrmAttributeMapping>
-{
- private Text text;
-
- /**
- * Creates a new <code>XmlJavaAttributeChooser</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public OrmJavaAttributeChooser(AbstractFormPane<?> parentPane,
- PropertyValueModel<OrmAttributeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmAttributeMapping.NAME_PROPERTY);
- }
-
- private ModifyListener buildNameModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- Text text = (Text) e.widget;
- textChanged(text.getText());
- }
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void doPopulate() {
- super.doPopulate();
- populateText();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- text = buildLabeledText(
- container,
- JptUiOrmMessages.PersistentAttributePage_javaAttributeLabel,
- buildNameModifyListener()
- );
- }
-
- private void populateText() {
-
- OrmAttributeMapping subject = subject();
- text.setText("");
-
- if (subject == null) {
- return;
- }
-
- String name = subject.getName();
-
- if (name == null) {
- name = "";
- }
-
- text.setText(name);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == OrmAttributeMapping.NAME_PROPERTY) {
- populateText();
- }
- }
-
- private void textChanged(String text) {
-
- setPopulating(true);
-
- try {
- subject().setName(text);
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaClassChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaClassChooser.java
deleted file mode 100644
index fca01fc7d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmJavaClassChooser.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.core.resources.IProject;
-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.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-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;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------- ------------- |
- * | Java Class: | I | | Browse... | |
- * | ----------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * 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
- *
- * @see OrmTypeMapping
- * @see OrmPersistentTypeDetailsPage - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class OrmJavaClassChooser extends AbstractFormPane<OrmTypeMapping> {
-
- private JavaTypeCompletionProcessor javaTypeCompletionProcessor;
- private Text text;
-
- /**
- * Creates a new <code>XmlJavaClassChooser</code>.
- *
- * @param parentPane The parent controller of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public OrmJavaClassChooser(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>XmlJavaClassChooser</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmJavaClassChooser(PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmTypeMapping.CLASS_PROPERTY);
- }
-
- private void browseType() {
-
- IType type = chooseType();
-
- if (type != null) {
-
- setPopulating(true);
-
- try {
- String className = type.getFullyQualifiedName();
- text.setText(className);
- subject().setClass(className);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- private Button buildBrowseButton(Composite container) {
- return buildButton(
- container,
- JptUiOrmMessages.OrmJavaClassChooser_browse,
- buildBrowseButtonAction()
- );
- }
-
- private Runnable buildBrowseButtonAction() {
- return new Runnable() {
- public void run() {
- browseType();
- }
- };
- }
-
- private ModifyListener buildPackageTextModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- Text text = (Text) e.widget;
- textChanged(text.getText());
- }
- }
- };
- }
-
- private 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(
- shell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- text.getText()
- );
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptUiOrmMessages.OrmJavaClassChooser_XmlJavaClassDialog_title);
- typeSelectionDialog.setMessage(JptUiOrmMessages.OrmJavaClassChooser_XmlJavaClassDialog_message);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateText();
- }
-
- private IPackageFragmentRoot getPackageFragmentRoot() {
- IProject project = subject().jpaProject().project();
- IJavaProject root = JavaCore.create(project);
-
- try {
- return root.getAllPackageFragmentRoots()[0];
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- text = buildLabeledText(
- container,
- JptUiOrmMessages.PersistentTypePage_javaClassLabel,
- buildPackageTextModifyListener(),
- buildBrowseButton(container)
- );
-
- //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);
- }
-
- private void populateText() {
-
- OrmTypeMapping subject = subject();
- text.setText("");
-
- if (subject == null) {
- return;
- }
-
- IPackageFragmentRoot root = getPackageFragmentRoot();
-
- if (root != null) {
- javaTypeCompletionProcessor.setPackageFragment(root.getPackageFragment(""));
- }
-
- String javaClass = subject.getClass_();
-
- if (javaClass == null) {
- javaClass = "";
- }
-
- text.setText(javaClass);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == OrmTypeMapping.CLASS_PROPERTY) {
- populateText();
- }
- }
-
- private void textChanged(String text) {
-
- setPopulating(true);
-
- try {
- subject().setClass(text);
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPackageChooser.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPackageChooser.java
deleted file mode 100644
index c191435cf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPackageChooser.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.core.resources.IProject;
-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.context.orm.EntityMappings;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------- ------------- |
- * | Package: | I | | Browse... | |
- * | -------------------------------------------------- ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EntityMappingsDetailsPage - The parent container
- *
- * @version 2.0
- * @since 2.0
- */
-public class OrmPackageChooser extends AbstractFormPane<EntityMappings>
-{
- private IContentAssistProcessor contentAssistProcessor;
- private Text text;
-
- /**
- * Creates a new <code>XmlPackageChooser</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- */
- public OrmPackageChooser(AbstractFormPane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.PACKAGE_PROPERTY);
- }
-
- private void browsePackage() {
-
- IPackageFragment packageFragment = choosePackage();
-
- if (packageFragment != null) {
-
- setPopulating(true);
-
- try {
- String packageName = packageFragment.getElementName();
- text.setText(packageName);
- subject().setPackage(packageName);
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- private Button buildBrowseButton(Composite container) {
- return buildButton(
- container,
- JptUiOrmMessages.OrmJavaClassChooser_browse,
- buildBrowseButtonAction()
- );
- }
-
- private Runnable buildBrowseButtonAction() {
- return new Runnable() {
- public void run() {
- browsePackage();
- }
- };
- }
-
- private ModifyListener buildPackageModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (!isPopulating()) {
- Text text = (Text) e.widget;
- textChanged(text.getText());
- }
- }
- };
- }
-
- /**
- * 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(
- shell(),
- getPackageFragmentRoot()
- );
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- return null;
- }
-
- selectionDialog.setTitle(JptUiOrmMessages.OrmPackageChooser_PackageDialog_title);
- selectionDialog.setMessage(JptUiOrmMessages.OrmPackageChooser_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;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- populateText();
- }
-
- /**
- * 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);
- }
-
- private IPackageFragmentRoot getPackageFragmentRoot() {
-
- IProject project = subject().jpaProject().project();
- IJavaProject root = JavaCore.create(project);
-
- try {
- return root.getAllPackageFragmentRoots()[0];
- }
- catch (JavaModelException e) {
- JptUiPlugin.log(e);
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- text = buildLabeledText(
- container,
- JptUiOrmMessages.EntityMappingsDetailsPage_package,
- buildPackageModifyListener(),
- buildBrowseButton(container),
- JpaHelpContextIds.ENTITY_ORM_PACKAGE
- );
-
- contentAssistProcessor = new JavaPackageCompletionProcessor(
- new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_ROOT)
- );
-
- ControlContentAssistHelper.createTextContentAssistant(
- text,
- contentAssistProcessor
- );
- }
-
- private void populateText() {
-
- EntityMappings subject = subject();
- text.setText("");
-
- if (subject == null) {
- return;
- }
-
- IPackageFragmentRoot root = getPackageFragmentRoot();
-
- if (root != null) {
- ((JavaPackageCompletionProcessor) contentAssistProcessor).setPackageFragmentRoot(root);
- }
-
- String packageName = subject.getPackage();
-
- if (packageName == null) {
- packageName = "";
- }
-
- text.setText(packageName);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == EntityMappings.PACKAGE_PROPERTY) {
- populateText();
- }
- }
-
- private void textChanged(String text) {
-
- setPopulating(true);
-
- try {
- subject().setPackage(text);
- }
- finally {
- setPopulating(false);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentAttributeDetailsPage.java
deleted file mode 100644
index 9b612c2d72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.ui.internal.java.details.BasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedIdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.IdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.TransientMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.VersionMappingUiProvider;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The default implementation of the details page used for the XML persistent
- * attribute.
- *
- * @see PersistentAttribute
- * @see OrmJavaAttributeChooser
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class OrmPersistentAttributeDetailsPage extends PersistentAttributeDetailsPage<OrmPersistentAttribute>
-{
- private List<AttributeMappingUiProvider<? extends AttributeMapping>> attributeMappingUiProviders;
-
- /**
- * Creates a new <code>OrmPersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmPersistentAttributeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- protected void addAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- 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());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> attributeMappingUiProviders() {
- if (this.attributeMappingUiProviders == null) {
- this.attributeMappingUiProviders = new ArrayList<AttributeMappingUiProvider<? extends AttributeMapping>>();
- this.addAttributeMappingUiProvidersTo(this.attributeMappingUiProviders);
- }
-
- return new CloneListIterator<AttributeMappingUiProvider<? extends AttributeMapping>>(
- this.attributeMappingUiProviders
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- @SuppressWarnings("unchecked")
- protected AttributeMappingUiProvider<? extends AttributeMapping>[] attributeMappingUiProvidersFor(PersistentAttribute persistentAttribute) {
- //bug 192035 - no default mapping option in xml
- return CollectionTools.array(attributeMappingUiProviders(), new AttributeMappingUiProvider[CollectionTools.size(attributeMappingUiProviders())]);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected AttributeMappingUiProvider<AttributeMapping> defaultAttributeMappingUiProvider(String key) {
- throw new UnsupportedOperationException("Xml attributeMappings should not be default");
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> defaultAttributeMappingUiProviders() {
- return EmptyListIterator.instance();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- updateEnbabledState();
- }
-
- private PropertyValueModel<OrmAttributeMapping> getMappingHolder() {
- return new TransformationPropertyValueModel<PersistentAttribute, OrmAttributeMapping>(getSubjectHolder()) {
- @Override
- protected OrmAttributeMapping transform_(PersistentAttribute value) {
- return (OrmAttributeMapping) value.getMapping();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Entity type widgets
- new OrmJavaAttributeChooser(this, getMappingHolder(), container);
-
- // Note: The combo's parent is a container fixing the issue with the
- // border not being painted
- buildLabeledComposite(
- container,
- buildMappingLabel(container),
- buildMappingCombo(container).getControl().getParent()
- );
-
- // Properties pane
- PageBook attributePane = buildMappingPageBook(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- attributePane.setLayoutData(gridData);
- }
-
- 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());
- }
- }
- }
-
- public void updateEnbabledState() {
- if (subject() == null || subject().parent() == null) {
- return;
- }
- boolean enabled = !subject().isVirtual();
- updateEnabledState(enabled, getControl());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentTypeDetailsPage.java
deleted file mode 100644
index ef739b2826..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/OrmPersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.MappedSuperclassUiProvider;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The default implementation of the details page used for the XML persistent
- * attribute.
- *
- * @see OrmPersistentType
- *
- * @version 2.0
- * @since 2.0
- */
-public class OrmPersistentTypeDetailsPage extends PersistentTypeDetailsPage<OrmPersistentType>
-{
- /**
- * Storing these here instead of querying IJpaPlatformUI, because the orm.xml
- * schema is not extensible. We only need to support extensibility for java.
- */
- private List<TypeMappingUiProvider<? extends TypeMapping>> ormTypeMappingUiProviders;
-
- /**
- * Creates a new <code>OrmPersistentTypeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmPersistentTypeDetailsPage(Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- protected void addOrmTypeMappingUiProvidersTo(Collection<TypeMappingUiProvider<? extends TypeMapping>> providers) {
- providers.add(EntityUiProvider.instance());
- providers.add(MappedSuperclassUiProvider.instance());
- providers.add(EmbeddableUiProvider.instance());
- }
-
- private PropertyValueModel<OrmTypeMapping> buildMappingHolder() {
- return new PropertyAspectAdapter<OrmPersistentType, OrmTypeMapping>(getSubjectHolder(), PersistentType.MAPPING_PROPERTY) {
- @Override
- protected OrmTypeMapping buildValue_() {
- return subject.getMapping();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Java class widgets
- new OrmJavaClassChooser(this, buildMappingHolder(), container);
-
- // Type Mapping widgets
- ComboViewer typeMappingCombo = buildTypeMappingCombo(container);
-
- buildLabeledComposite(
- container,
- JptUiMessages.PersistentTypePage_mapAs,
- typeMappingCombo.getControl().getParent()
- );
-
- // Metadata complete widget
- MetaDataCompleteComboViewer metadataCompleteComboViewer =
- new MetaDataCompleteComboViewer(this, buildMappingHolder(), container);
-
- buildLabeledComposite(
- container,
- JptUiOrmMessages.PersistentTypePage_MetadataCompleteLabel,
- metadataCompleteComboViewer.getControl()
- );
-
- // Access widgets
- new AccessTypeComposite(this, buildMappingHolder(), container);
-
- // Type mapping pane
- PageBook typeMappingPageBook = buildTypeMappingPageBook(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- typeMappingPageBook.setLayoutData(gridData);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public ListIterator<TypeMappingUiProvider<? extends TypeMapping>> typeMappingUiProviders() {
- if (this.ormTypeMappingUiProviders == null) {
- this.ormTypeMappingUiProviders = new ArrayList<TypeMappingUiProvider<? extends TypeMapping>>();
- this.addOrmTypeMappingUiProvidersTo(this.ormTypeMappingUiProviders);
- }
- return new CloneListIterator<TypeMappingUiProvider<? extends TypeMapping>>(this.ormTypeMappingUiProviders);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/PersistenceUnitMetadataComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/PersistenceUnitMetadataComposite.java
deleted file mode 100644
index 86d6bc6a46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/orm/details/PersistenceUnitMetadataComposite.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.orm.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.orm.JptUiOrmMessages;
-import org.eclipse.jpt.ui.internal.widgets.AbstractFormPane;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Persistence Unit ------------------------------------------------------ |
- * | |
- * | x XML Mapping Metadata Complete |
- * | |
- * | x Cascade Persist |
- * | |
- * | ------------------------------------------------------------ |
- * | Schema: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnitMetadata
- * @see PersistenceUnitDefaults
- * @see EntityMappingsDetailsPage - The parent container
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistenceUnitMetadataComposite extends AbstractFormPane<PersistenceUnitMetadata>
-{
- /**
- * Creates a new <code>PersistenceUnitMetadataComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PersistenceUnitMetadataComposite(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends PersistenceUnitMetadata> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- private EnumFormComboViewer<PersistenceUnitDefaults, AccessType> buildAccessTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<PersistenceUnitDefaults, AccessType>(this, buildPersistenceUnitDefaultsHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnitDefaults.ACCESS_PROPERTY);
- }
-
- @Override
- protected AccessType[] choices() {
- return AccessType.values();
- }
-
- @Override
- protected AccessType defaultValue() {
- return null;
- }
-
- @Override
- protected String displayString(AccessType value) {
- return buildDisplayString(
- JptUiOrmMessages.class,
- PersistenceUnitMetadataComposite.this,
- value
- );
- }
-
- @Override
- protected AccessType getValue() {
- return subject().getAccess();
- }
-
- @Override
- protected void setValue(AccessType value) {
- subject().setAccess(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildCascadePersistHolder() {
- return new PropertyAspectAdapter<PersistenceUnitDefaults, Boolean>(buildPersistenceUnitDefaultsHolder(), PersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isCascadePersist();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setCascadePersist(value);
- }
- };
- }
-
- private EnumFormComboViewer<PersistenceUnitDefaults, String> buildCatalogComboViewer(Composite container) {
-
- return new EnumFormComboViewer<PersistenceUnitDefaults, String>(this, buildPersistenceUnitDefaultsHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnitDefaults.CATALOG_PROPERTY);
- }
-
- @Override
- protected String[] choices() {
- return new String[0];
- }
-
- @Override
- protected String defaultValue() {
- return "default";
- }
-
- @Override
- protected String displayString(String value) {
- return value;
- }
-
- @Override
- protected String getValue() {
- return subject().getCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setCatalog(value);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitDefaults> buildPersistenceUnitDefaultsHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitMetadata, PersistenceUnitDefaults>(getSubjectHolder()) {
- @Override
- protected PersistenceUnitDefaults transform_(PersistenceUnitMetadata value) {
- return value.getPersistenceUnitDefaults();
- }
- };
- }
-
- private EnumFormComboViewer<PersistenceUnitDefaults, String> buildSchemaComboViewer(Composite container) {
-
- return new EnumFormComboViewer<PersistenceUnitDefaults, String>(this, buildPersistenceUnitDefaultsHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnitDefaults.SCHEMA_PROPERTY);
- }
-
- @Override
- protected String[] choices() {
- return new String[0];
- }
-
- @Override
- protected String defaultValue() {
- return "default";
- }
-
- @Override
- protected String displayString(String value) {
- return value;
- }
-
- @Override
- protected String getValue() {
- return subject().getSchema();
- }
-
- @Override
- protected void setValue(String value) {
- subject().setSchema(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildXmlMappingMetadataCompleteHolder() {
- return new PropertyAspectAdapter<PersistenceUnitMetadata, Boolean>(getSubjectHolder(), PersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isXmlMappingMetadataComplete();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setXmlMappingMetadataComplete(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Section
- container = buildSection(
- container,
- JptUiOrmMessages.EntityMappingsPage_PersistenceUnitSection
- );
-
- // XML mapping metadata complete check box
- buildCheckBox(
- container,
- JptUiOrmMessages.EntityMappingsPage_XmlMappingMetadataCompleteCheckBox,
- buildXmlMappingMetadataCompleteHolder(),
- JpaHelpContextIds.ENTITY_ORM_XML
- );
-
- // Cascade Persist widgets
- buildCheckBox(
- container,
- JptUiOrmMessages.EntityMappingsPage_CascadePersistCheckBox,
- buildCascadePersistHolder(),
- JpaHelpContextIds.ENTITY_ORM_CASCADE
- );
-
- // Schema widgets
- buildLabeledComposite(
- container,
- JptUiOrmMessages.OrmSchemaChooser_SchemaChooser,
- buildSchemaComboViewer(container),
- JpaHelpContextIds.ENTITY_ORM_SCHEMA
- );
-
- // Catalog widgets
- buildLabeledComposite(
- container,
- JptUiOrmMessages.OrmCatalogChooser_CatalogChooser,
- buildCatalogComboViewer(container),
- JpaHelpContextIds.ENTITY_ORM_CATALOG
- );
-
- // Access Type widgets
- buildLabeledComposite(
- container,
- JptUiOrmMessages.PersistentTypePage_AccessLabel,
- buildAccessTypeCombo(container),
- JpaHelpContextIds.ENTITY_ORM_ACCESS
- );
- }
-}
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 fa41ccf94d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/perspective/JpaPerspectiveFactory.java
+++ /dev/null
@@ -1,77 +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.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/platform/JpaPlatformUiRegistry.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/JpaPlatformUiRegistry.java
deleted file mode 100644
index e6ec0d1331..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/JpaPlatformUiRegistry.java
+++ /dev/null
@@ -1,166 +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.platform;
-
-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.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JptUiPlugin;
-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 JpaPlatformUiRegistry
-{
- // singleton
- private static final JpaPlatformUiRegistry INSTANCE = new JpaPlatformUiRegistry();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiRegistry instance() {
- return INSTANCE;
- }
-
- 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 JpaPlatformUiRegistry() {
- buildJpaPlatforms();
- }
-
-
- private void buildJpaPlatforms() {
- this.jpaPlatforms = new HashMap<String, IConfigurationElement>();
-
- for (Iterator<IConfigurationElement> stream = allConfigElements(); stream.hasNext(); ) {
- buildJpaPlatform(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 (this.jpaPlatforms.containsKey(platformId)) {
- IConfigurationElement otherConfigElement = this.jpaPlatforms.get(platformId);
- reportDuplicatePlatform(configElement, otherConfigElement);
- }
-
- this.jpaPlatforms.put(platformId, configElement);
- }
-
- public JpaPlatformUi jpaPlatform(String platformId) {
- IConfigurationElement registeredConfigElement = this.jpaPlatforms.get(platformId);
-
- if (registeredConfigElement == null) {
- return null;
- }
-
- try {
- return (JpaPlatformUi) registeredConfigElement.createExecutableExtension(AT_CLASS);
- }
- catch (CoreException ce) {
- reportFailedInstantiation(registeredConfigElement);
- return null;
- }
- }
-
- private Iterator<IConfigurationElement> allConfigElements() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptUiPlugin.PLUGIN_ID, EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- return new CompositeIterator<IConfigurationElement>(
- new TransformationIterator<IExtension, Iterator<IConfigurationElement>>(CollectionTools.iterator(extensions)) {
- @Override
- protected Iterator<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterator(extension.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/platform/base/BaseJpaNavigatorContentProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorContentProvider.java
deleted file mode 100644
index 3fd9679224..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorContentProvider.java
+++ /dev/null
@@ -1,65 +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.platform.base;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-public class BaseJpaNavigatorContentProvider implements ICommonContentProvider
-{
- public void init(ICommonContentExtensionSite config) {
- // TODO Auto-generated method stub
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof BaseJpaContent) {
- BaseJpaContent baseJpaContent = (BaseJpaContent) parentElement;
- if (baseJpaContent.getPersistenceXml() != null) {
- return new Object[] {baseJpaContent.getPersistenceXml()};
- }
- }
-
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return element instanceof BaseJpaContent;
- }
-
- public Object[] getElements(Object inputElement) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
- }
-
- public void restoreState(IMemento memento) {
- // TODO Auto-generated method stub
- }
-
- public void saveState(IMemento memento) {
- // TODO Auto-generated method stub
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorLabelProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorLabelProvider.java
deleted file mode 100644
index fe81f7e6b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaNavigatorLabelProvider.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.platform.base;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.core.ContextModel;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXml;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-public class BaseJpaNavigatorLabelProvider extends LabelProvider
- implements ICommonLabelProvider
-{
-
- // **************** IBaseLabelProvider implementation **********************
-
- public void addListener(ILabelProviderListener listener) {
- super.addListener(listener);
- }
-
- public void removeListener(ILabelProviderListener listener) {
- super.addListener(listener);
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return super.isLabelProperty(element, property);
- }
-
- public void dispose() {
- super.dispose();
- }
-
-
- // **************** ILabelProvider implementation **************************
-
- public Image getImage(Object element) {
- if (element instanceof ContextModel) {
- return JptUiPlugin.getPlugin().getImage(JptUiIcons.JPA_CONTENT);
- }
-
- if (element instanceof GenericPersistenceXml) {
- return JptUiPlugin.getPlugin().getImage(JptUiIcons.JPA_FILE);
- }
-
- return super.getImage(element);
- }
-
- public String getText(Object element) {
- if (element instanceof ContextModel) {
- return "JPA Content";
- }
-
- if (element instanceof GenericPersistenceXml) {
- return "persistence.xml";
- }
-
- return null;
- }
-
-
- // **************** IDescriptionProvider implementation ********************
-
- public String getDescription(Object anElement) {
- // TODO Auto-generated method stub
- return getText(anElement);
- }
-
-
- // **************** IMementoAware implementation ***************************
-
- public void saveState(IMemento memento) {
- // TODO Auto-generated method stub
- }
-
- public void restoreState(IMemento memento) {
- // TODO Auto-generated method stub
- }
-
-
- // **************** ICommonLabelProvider implementation ********************
-
- public void init(ICommonContentExtensionSite config) {
- // TODO Auto-generated method stub
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java
deleted file mode 100644
index d71107e0d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/BaseJpaPlatformUi.java
+++ /dev/null
@@ -1,226 +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.platform.base;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.core.resource.orm.OrmResourceModel;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResourceModel;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.java.details.BasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.DefaultBasicMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.DefaultEmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddableUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedIdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EmbeddedMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.EntityUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.IdMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.JavaDetailsProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.ManyToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.MappedSuperclassUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.NullTypeMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToManyMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.OneToOneMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.TransientMappingUiProvider;
-import org.eclipse.jpt.ui.internal.java.details.VersionMappingUiProvider;
-import org.eclipse.jpt.ui.internal.orm.details.OrmDetailsProvider;
-import org.eclipse.jpt.ui.internal.structure.JavaResourceModelStructureProvider;
-import org.eclipse.jpt.ui.internal.structure.JpaStructureProvider;
-import org.eclipse.jpt.ui.internal.structure.OrmResourceModelStructureProvider;
-import org.eclipse.jpt.ui.internal.structure.PersistenceResourceModelStructureProvider;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-public abstract class BaseJpaPlatformUi implements JpaPlatformUi
-{
- // TODO: Transformed into a List for testing
- private List<JpaDetailsProvider> detailsProviders;
-
- private List<TypeMappingUiProvider<? extends TypeMapping>> javaTypeMappingUiProviders;
- private List<AttributeMappingUiProvider<? extends AttributeMapping>> javaAttributeMappingUiProviders;
- private List<AttributeMappingUiProvider<? extends AttributeMapping>> defaultJavaAttributeMappingUiProviders;
-
- private JpaUiFactory jpaUiFactory;
-
-
- protected BaseJpaPlatformUi() {
- super();
- this.jpaUiFactory = createJpaUiFactory();
- }
-
-
- // **************** navigator content **************************************
-
- public ICommonContentProvider buildNavigatorContentProvider() {
- return new BaseJpaNavigatorContentProvider();
- }
-
- public ICommonLabelProvider buildNavigatorLabelProvider() {
- return new BaseJpaNavigatorLabelProvider();
- }
-
-
- // **************** structure view content *********************************
-
- public JpaStructureProvider buildStructureProvider(JpaFile jpaFile) {
- ResourceModel resourceModel = jpaFile.getResourceModel();
- String resourceType = resourceModel.getResourceType();
-
- if (resourceType == ResourceModel.JAVA_RESOURCE_TYPE) {
- return new JavaResourceModelStructureProvider((JavaResourceModel) resourceModel);
- }
- else if (resourceType == ResourceModel.ORM_RESOURCE_TYPE) {
- return new OrmResourceModelStructureProvider((OrmResourceModel) resourceModel);
- }
- else if (resourceType == ResourceModel.PERSISTENCE_RESOURCE_TYPE) {
- return new PersistenceResourceModelStructureProvider((PersistenceResourceModel) resourceModel);
- }
-
- return null;
- }
-
-
- // ********** behavior **********
-
- protected abstract JpaUiFactory createJpaUiFactory();
-
- public JpaUiFactory getJpaUiFactory() {
- return this.jpaUiFactory;
- }
-
- public Iterator<JpaDetailsProvider> detailsProviders() {
- if (this.detailsProviders == null) {
- this.detailsProviders = new ArrayList<JpaDetailsProvider>();
- this.addDetailsProvidersTo(this.detailsProviders);
- }
- return new CloneIterator<JpaDetailsProvider>(this.detailsProviders);
- }
-
- /**
- * Override this to specify more or different details providers.
- * The default includes the JPA spec-defined java and orm.xml
- */
- protected void addDetailsProvidersTo(Collection<JpaDetailsProvider> providers) {
- providers.add(new JavaDetailsProvider());
- providers.add(new OrmDetailsProvider());
- }
-
- public JpaDetailsProvider detailsProvider(JpaStructureNode structureNode) {
- // TODO: To implement, this is written only for testing
- detailsProviders();
- if (structureNode instanceof JavaJpaContextNode) {
- return detailsProviders.get(0);
- }
- else {
- return detailsProviders.get(1);
- }
-// for (Iterator<IJpaDetailsProvider> i = this.detailsProviders(); i.hasNext(); ) {
-// IJpaDetailsProvider provider = i.next();
-// if (provider.fileContentType().equals(fileContentType)) {
-// return provider;
-// }
-// }
-// return null;
- }
-
- public ListIterator<TypeMappingUiProvider<? extends TypeMapping>> javaTypeMappingUiProviders() {
- if (this.javaTypeMappingUiProviders == null) {
- this.javaTypeMappingUiProviders = new ArrayList<TypeMappingUiProvider<? extends TypeMapping>>();
- this.addJavaTypeMappingUiProvidersTo(this.javaTypeMappingUiProviders);
- }
- return new CloneListIterator<TypeMappingUiProvider<? extends TypeMapping>>(
- this.javaTypeMappingUiProviders
- );
- }
-
- /**
- * Override this to specify more or different type mapping ui providers
- * The default includes the JPA spec-defined entity, mapped superclass, embeddable,
- * and null (when the others don't apply)
- */
- protected void addJavaTypeMappingUiProvidersTo(List<TypeMappingUiProvider<? extends TypeMapping>> providers) {
- providers.add(NullTypeMappingUiProvider.instance());
- providers.add(EntityUiProvider.instance());
- providers.add(MappedSuperclassUiProvider.instance());
- providers.add(EmbeddableUiProvider.instance());
- }
-
- public ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> javaAttributeMappingUiProviders() {
- if (this.javaAttributeMappingUiProviders == null) {
- this.javaAttributeMappingUiProviders = new ArrayList<AttributeMappingUiProvider<? extends AttributeMapping>>();
- this.addJavaAttributeMappingUiProvidersTo(this.javaAttributeMappingUiProviders);
- }
-
- return new CloneListIterator<AttributeMappingUiProvider<? extends AttributeMapping>>(
- this.javaAttributeMappingUiProviders
- );
- }
-
- /**
- * Override this to specify more or different java attribute mapping ui providers.
- * The default includes the JPA spec-defined basic, embedded, embeddedId, id,
- * manyToMany, manyToOne, oneToMany, oneToOne, transient, and version
- */
- protected void addJavaAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- 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());
- }
-
- public ListIterator<AttributeMappingUiProvider<? extends AttributeMapping>> defaultJavaAttributeMappingUiProviders() {
- if (this.defaultJavaAttributeMappingUiProviders == null) {
- this.defaultJavaAttributeMappingUiProviders = new ArrayList<AttributeMappingUiProvider<? extends AttributeMapping>>();
- this.addDefaultJavaAttributeMappingUiProvidersTo(this.defaultJavaAttributeMappingUiProviders);
- }
-
- return new CloneListIterator<AttributeMappingUiProvider<? extends AttributeMapping>>(
- this.defaultJavaAttributeMappingUiProviders
- );
- }
-
- /**
- * Override this to specify more or different default java attribute mapping ui providers.
- * The default includes the JPA spec-defined basic, embedded
- */
- protected void addDefaultJavaAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- providers.add(DefaultBasicMappingUiProvider.instance());
- providers.add(DefaultEmbeddedMappingUiProvider.instance());
- }
-
- public void generateEntities(JpaProject project, IStructuredSelection selection) {
- EntitiesGenerator.generate(project, selection);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/EntitiesGenerator.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/EntitiesGenerator.java
deleted file mode 100644
index 316ac78d4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/base/EntitiesGenerator.java
+++ /dev/null
@@ -1,303 +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.platform.base;
-
-import java.util.Collection;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-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.JpaProject;
-import org.eclipse.jpt.core.context.BaseJpaContent;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.synch.SynchronizeClassesJob;
-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.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 JpaProject project;
- private IStructuredSelection selection;
-
- // ********** constructors **********
-
- static public void generate( JpaProject project, IStructuredSelection selection) {
- if(project == null) {
- throw new NullPointerException();
- }
- new EntitiesGenerator( project, selection).generate();
- }
-
- public EntitiesGenerator() {
- super();
- }
-
- private EntitiesGenerator( JpaProject 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) {
- WorkspaceJob runnable = new GenerateEntitiesRunnable(
- wizard.getPackageGeneratorConfig(),
- wizard.getEntityGeneratorConfig(),
- wizard.getSelectedTables(),
- wizard.synchronizePersistenceXml(),
- this.project,
- new OverwriteConfirmer(this.getCurrentShell())
- );
-
- runnable.schedule();
- }
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- // ********** runnable **********
-
- static class GenerateEntitiesRunnable extends WorkspaceJob {
- private final PackageGenerator.Config packageConfig;
- private final EntityGenerator.Config entityConfig;
- private final Collection<Table> selectedTables;
- private final boolean synchronizePersistenceXml;
- private final EntityGenerator.OverwriteConfirmer overwriteConfirmer;
- private final JpaProject project;
-
- GenerateEntitiesRunnable(
- PackageGenerator.Config packageConfig,
- EntityGenerator.Config entityConfig,
- Collection<Table> selectedTables,
- boolean synchronizePersistenceXml,
- JpaProject project,
- EntityGenerator.OverwriteConfirmer overwriteConfirmer
- ) {
- super("Generating Entities");
- this.packageConfig = packageConfig;
- this.entityConfig = entityConfig;
- this.selectedTables = selectedTables;
- this.synchronizePersistenceXml = synchronizePersistenceXml;
- this.overwriteConfirmer = overwriteConfirmer;
- this.project = project;
- setRule(project.project());
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- PackageGenerator.generateEntities(this.packageConfig, this.entityConfig, this.selectedTables, this.overwriteConfirmer, monitor);
- //force resourceChangeEvents to be posted before synchronizing persistence.xml
- ResourcesPlugin.getWorkspace().checkpoint(false);
- if (this.synchronizePersistenceXml) {
- // we currently only support *one* persistence.xml file per project
- //TODO casting to IBaseJpaContent, IContextModel doesn't seem useful to me
- //just trying to get rid of all compiler errors for now KFB
- PersistenceXml persistenceXml = ((BaseJpaContent) this.project.contextModel()).getPersistenceXml();
- if (persistenceXml != null) {
- //TODO casting to IFile - just trying to get rid of all compiler errors for now
- SynchronizeClassesJob job = new SynchronizeClassesJob((IFile) persistenceXml.resource());
- job.schedule();
- }
- }
-
- return Status.OK_STATUS;
- }
-
- }
-
- // ********** 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(final String className) {
- if (this.overwriteAll) {
- return true;
- }
- if (this.skipAll) {
- return false;
- }
- return this.promptUser(className);
- }
-
- private boolean promptUser(String className) {
-
- final OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.shell, className);
- //get on the UI thread synchronously, need feedback before continuing
- this.shell.getDisplay().syncExec(new Runnable() {
- public void run() {
- dialog.open();
- }
- });
- if (dialog.getReturnCode() == 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;
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(JptUiMessages.OverwriteConfirmerDialog_title);
- }
-
- @Override
- 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;
- }
-
- @Override
- 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);
- }
-
- @Override
- 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/platform/generic/GenericPlatformUi.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/generic/GenericPlatformUi.java
deleted file mode 100644
index 3979cf98fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/platform/generic/GenericPlatformUi.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.platform.generic;
-
-import java.text.MessageFormat;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.internal.GenericJpaUiFactory;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class GenericPlatformUi extends BaseJpaPlatformUi
-{
- public GenericPlatformUi() {
- super();
- }
-
- @Override
- protected JpaUiFactory createJpaUiFactory() {
- return new GenericJpaUiFactory();
- }
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- this.displayNotSupportedMessage(JptUiMessages.GenericPlatformUiDialog_notSupportedMessageTitle, JptUiMessages.GenericPlatformUiDialog_notSupportedMessageText);
- }
-
- protected void displayNotSupportedMessage(String title, String message) {
- String formattedMessage = MessageFormat.format(message, message);
- Shell currentShell = Display.getCurrent().getActiveShell();
- MessageDialog.openInformation(currentShell, title, formattedMessage);
- }
-} \ No newline at end of file
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 39199fc32e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/prefs/JpaPreferencePage.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.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.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.instance().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 6099e8af24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-import org.eclipse.core.resources.IProject;
-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.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JpaModelManager;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProvider;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-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 JpaFacetDataModelProperties
-{
- 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, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE);
-
- return composite;
- }
-
- private void setRuntime() {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(getJpaProject().project());
- }
- catch (CoreException ce) {
- JptUiPlugin.log(ce);
- return;
- }
- IRuntime runtime = facetedProject.getPrimaryRuntime();
- model.setProperty(JpaFacetDataModelProperties.RUNTIME, runtime);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- JpaFacetDataModelProperties.PLATFORM_ID,
- JpaFacetDataModelProperties.CONNECTION,
- JpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES
- };
- }
-
- protected JpaProject getJpaProject() {
- return (JpaProject) this.getElement().getAdapter(JpaProject.class);
- }
-
- 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;
- }
-
- 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;
- }
-
- @Override
- protected void performDefaults() {
- platformGroup.performDefaults();
- connectionGroup.performDefaults();
- persistentClassManagementGroup.performDefaults();
- }
-
- @Override
- public boolean performOk() {
- JpaProject jpaProject = this.getJpaProject();
- if (jpaProject == null) {
- return true; // the facet has been uninstalled during our trip to the properties
- }
-
- boolean change = false;
- boolean platformChange = false;
-
- IProject project = jpaProject.project();
-
- String platform = this.model.getStringProperty(JpaFacetDataModelProperties.PLATFORM_ID);
- if ( ! platform.equals(jpaProject.jpaPlatform().getId())) {
- change = true;
- platformChange = true;
- JptCorePlugin.setJpaPlatformId(project, platform);
- }
-
- String connection = this.model.getStringProperty(JpaFacetDataModelProperties.CONNECTION);
- if ( ! connection.equals(jpaProject.dataSource().connectionProfileName())) {
- change = true;
- jpaProject.dataSource().setConnectionProfileName(connection);
- JptCorePlugin.setConnectionProfileName(project, connection);
- }
-
- boolean discover = this.model.getBooleanProperty(JpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES);
- if (discover != jpaProject.discoversAnnotatedClasses()) {
- change = true;
- jpaProject.setDiscoversAnnotatedClasses(discover);
- JptCorePlugin.setDiscoverAnnotatedClasses(project, discover);
- }
-
- if (platformChange) {
- JpaModelManager.instance().rebuildJpaProject(project);
- }
- if (change) {
- buildProject(project);
- }
- return true;
- }
-
- private static void buildProject(final IProject project) {
- IRunnableWithProgress r= new IRunnableWithProgress() {
- public void run(IProgressMonitor pm) throws InvocationTargetException {
- try {
- project.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
- {
- 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().jpaPlatformIds());
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // do nothing
- }
- }
- );
- platformCombo.setLabelProvider(
- new ILabelProvider() {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return JpaPlatformRegistry.instance().jpaPlatformLabel((String) element);
- }
-
- public void addListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- 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();
- }
-
- void performDefaults() {
- String platformId = getJpaProject().jpaPlatform().getId();
- model.setProperty(PLATFORM_ID, platformId);
- platformCombo.setSelection(new StructuredSelection(platformId));
- }
- }
-
-
- private final class ConnectionGroup
- {
- 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, JpaHelpContextIds.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() {
- @Override
- 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());
- }
- }
-
- void performDefaults() {
- String connectionName = getJpaProject().dataSource().connectionProfileName();
- model.setProperty(CONNECTION, connectionName);
- if (connectionName == null) {
- connectionCombo.clearSelection();
- }
- else {
- connectionCombo.setText(connectionName);
- }
- }
-
- void openNewConnectionWizard() {
- String connectionName = DTPUiTools.createNewProfile();
- if (connectionName != null) {
- fillConnections();
- model.setProperty(CONNECTION, connectionName);
- connectionCombo.select(connectionCombo.indexOf(connectionName));
- }
- }
- }
-
-
- private final class PersistentClassManagementGroup
- {
- final Button discoverClassesButton;
-
- 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, JpaHelpContextIds.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();
- }
-
- void performDefaults() {
- boolean discoverClasses = getJpaProject().discoversAnnotatedClasses();
- 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/DefaultJpaSelection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelection.java
deleted file mode 100644
index 3fb614992a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelection.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.selection;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-
-public class DefaultJpaSelection
- implements JpaSelection
-{
- private JpaStructureNode selectedNode;
-
-
- public DefaultJpaSelection(JpaStructureNode selectedNode) {
- if (selectedNode == null) {
- throw new NullPointerException("A 'selectedNode' is required; otherwise use NULL_SELECTION.");
- }
- this.selectedNode = selectedNode;
- }
-
- public JpaStructureNode getSelectedNode() {
- return this.selectedNode;
- }
-
- public boolean isEmpty() {
- // by definition, this selection is never empty
- // use IJpaSelection.NULL_SELECTION for empty selections
- return false;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (! (obj instanceof DefaultJpaSelection)) {
- return false;
- }
-
- return this.selectedNode.equals(((DefaultJpaSelection) obj).selectedNode);
- }
-
- @Override
- public int hashCode() {
- return this.selectedNode.hashCode();
- }
-
- @Override
- public String toString() {
- return this.selectedNode.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelectionManager.java
deleted file mode 100644
index 4d5f0b59fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/DefaultJpaSelectionManager.java
+++ /dev/null
@@ -1,298 +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 {@link JpaSelectionManager} stores the current {@link JpaSelection} and
- * notifies <code>ISelectionListener</code>s when the selection changes.
- */
-public class DefaultJpaSelectionManager
- implements JpaSelectionManager
-{
- /* The window for which this object manages selections */
- private IWorkbenchWindow window;
-
- /* The set of pages for which this object is managing selections */
- private Set<IWorkbenchPage> pages;
-
- /* The active editor part */
- private IEditorPart activeEditor;
-
- private JpaSelection currentSelection;
-
- /* The map of <code>IJpaSelectionParticipant</code>s (keyed by part) */
- private Map<IWorkbenchPart, JpaSelectionParticipant> selectionParticipants;
-
- private IPageListener pageListener;
-
- private IPartListener2 partListener;
-
-
- public DefaultJpaSelectionManager() {
- super();
- pages = Collections.synchronizedSet(new HashSet<IWorkbenchPage>());
- selectionParticipants = Collections.synchronizedMap(new HashMap<IWorkbenchPart, JpaSelectionParticipant>());
- pageListener = new PageListener();
- partListener = new PartListener();
- currentSelection = DefaultJpaSelection.NULL_SELECTION;
- }
-
- 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);
- activateEditor(page.getActiveEditor());
- }
- }
-
- private void disposePage(IWorkbenchPage page) {
- if ((page != null) && (pages.contains(page))) {
- page.removePartListener(partListener);
- pages.remove(page);
- }
- }
-
- private void activateEditor(IEditorPart editor) {
- if (editor == activeEditor) {
- return;
- }
- if (activeEditor != null) {
- inactivateEditor(activeEditor);
- }
- initPart(editor);
- activeEditor = editor;
- selectEditor(activeEditor);
- }
-
- private void inactivateEditor(IEditorPart editor) {
-
- }
-
- void initPart(IWorkbenchPart part) {
- if (part != null) {
- if (selectionParticipants.get(part) == null) {
- JpaSelectionParticipant selectionParticipant =
- (JpaSelectionParticipant) part.getAdapter(JpaSelectionParticipant.class);
- if (selectionParticipant != null) {
- selectionParticipants.put(part, selectionParticipant);
- }
- }
- }
- }
-
- private void selectEditor(IEditorPart editor) {
- selectPart(editor);
- }
-
- void selectPart(IWorkbenchPart part) {
- JpaSelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if (selectionParticipant != null) {
- select(selectionParticipant.getSelection());
- }
- }
-
- void hidePart(IWorkbenchPart part) {
- JpaSelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if ((selectionParticipant != null) && (selectionParticipant.disposeOnHide())) {
- closePart(part);
- }
- }
-
- void closePart(IWorkbenchPart part) {
- JpaSelectionParticipant selectionParticipant = getSelectionParticipant(part);
- if (selectionParticipant != null) {
- disposePart(part);
- checkForNoEditors();
- }
- }
-
- void disposePart(IWorkbenchPart part) {
- if ((part != null) && (selectionParticipants.containsKey(part))) {
- selectionParticipants.remove(part).dispose();
- }
- }
-
- void checkForNoEditors() {
- IWorkbenchPage activePage = window.getActivePage();
- if ((activePage == null)
- || (activePage.getActiveEditor() == null)) {
- select(DefaultJpaSelection.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(JpaSelection newSelection) {
- if (currentSelection.equals(newSelection)) {
- return;
- }
-
- currentSelection = newSelection;
- fireSelectionChange(
- new JpaSelectionEvent(newSelection, JpaSelectionEvent.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(JpaSelection oldSelection) {
- if (currentSelection.equals(oldSelection)) {
- currentSelection = DefaultJpaSelection.NULL_SELECTION;
- fireSelectionChange(
- new JpaSelectionEvent(oldSelection, JpaSelectionEvent.DESELECTION, this)
- );
- }
- }
-
- private void fireSelectionChange(JpaSelectionEvent event) {
- for (JpaSelectionParticipant sp : selectionParticipants.values()) {
- sp.selectionChanged(event);
- }
- }
-
- private JpaSelectionParticipant getSelectionParticipant(IWorkbenchPart part) {
- return selectionParticipants.get(part);
- }
-
- public JpaSelection getCurrentSelection() {
- return currentSelection;
- }
-
- public void dispose() {
- window.removePageListener(pageListener);
- selectionParticipants.clear();
-
- for (Iterator<IWorkbenchPage> stream = new CloneIterator<IWorkbenchPage>(this.pages); stream.hasNext(); ) {
- this.disposePage(stream.next());
- }
-
- for (Iterator<IWorkbenchPart> stream = new CloneIterator<IWorkbenchPart>(selectionParticipants.keySet()); stream.hasNext(); ) {
- this.disposePart(stream.next());
- }
- }
-
-
- private class PageListener implements IPageListener
- {
- public void pageActivated(IWorkbenchPage page) {
- // nop
- }
-
- PageListener() {
- super();
- }
-
- public void pageClosed(IWorkbenchPage page) {
- DefaultJpaSelectionManager.this.disposePage(page);
- }
-
- public void pageOpened(IWorkbenchPage page) {
- DefaultJpaSelectionManager.this.initPage(page);
- }
- }
-
-
- private class PartListener implements IPartListener2
- {
- PartListener() {
- super();
- }
-
- public void partActivated(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- DefaultJpaSelectionManager.this.initPart(part);
- DefaultJpaSelectionManager.this.selectPart(part);
- }
- }
-
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- // nop
- }
-
- public void partClosed(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- DefaultJpaSelectionManager.this.closePart(part);
- DefaultJpaSelectionManager.this.disposePart(part);
- DefaultJpaSelectionManager.this.checkForNoEditors();
- }
- }
-
- public void partDeactivated(IWorkbenchPartReference partRef) {
- // nop
- }
-
- public void partHidden(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- DefaultJpaSelectionManager.this.hidePart(part);
- }
- }
-
- public void partInputChanged(IWorkbenchPartReference partRef) {
- // nop
- }
-
- 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/JpaDetailsSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.java
deleted file mode 100644
index b708d03d0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaDetailsSelectionParticipant.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.selection;
-
-import org.eclipse.jpt.ui.internal.views.JpaDetailsView;
-
-
-public class JpaDetailsSelectionParticipant
- implements JpaSelectionParticipant
-{
- private final JpaDetailsView detailsView;
-
-
- public JpaDetailsSelectionParticipant(JpaDetailsView detailsView) {
- super();
- this.detailsView = detailsView;
- }
-
- public JpaSelection getSelection() {
- return this.detailsView.getSelection();
- }
-
- public void selectionChanged(JpaSelectionEvent evt) {
- this.detailsView.select(evt.getSelection());
- }
-
- public boolean disposeOnHide() {
- return false;
- }
-
- public void dispose() {
- // NOP
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelection.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelection.java
deleted file mode 100644
index 8655651a68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelection.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.selection;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jpt.core.JpaStructureNode;
-
-@SuppressWarnings("nls")
-public interface JpaSelection extends ISelection
-{
- static JpaSelection NULL_SELECTION =
- new JpaSelection() {
- public JpaStructureNode getSelectedNode() {
- return null;
- }
-
- public boolean isEmpty() {
- return true;
- }
-
- @Override
- public String toString() {
- return "NULL SELECTION";
- }
- };
-
-
- JpaStructureNode getSelectedNode();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionEvent.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionEvent.java
deleted file mode 100644
index 80c57c2a24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionEvent.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 JpaSelectionEvent 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 JpaSelection selection;
-
- /**
- * The type of the selection event, either a SELECTION or a DESELECTION
- */
- private int type;
-
-
- public JpaSelectionEvent(JpaSelection theSelection, int theType, Object source) {
- super(source);
- selection = theSelection;
- type = theType;
- }
-
- /**
- * Return the selection object whose selection status has changed
- */
- public JpaSelection 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/JpaSelectionManager.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionManager.java
deleted file mode 100644
index 19dd3dd13f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionManager.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.selection;
-
-import org.eclipse.ui.IWorkbenchPart;
-
-public interface JpaSelectionManager
-{
- /**
- * Return the current selection.
- * This will never be null, but it may be <code>JpaSelection.NULL_SELECTION</code>.
- */
- public JpaSelection 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(JpaSelection 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(JpaSelection 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/JpaSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionParticipant.java
deleted file mode 100644
index 1a849013ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaSelectionParticipant.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 JpaSelectionParticipant
-{
- /**
- * Return the current selection of the participant
- */
- JpaSelection getSelection();
-
- /**
- * The selection has changed in the central selection manager.
- * Update this participant accordingly.
- */
- void selectionChanged(JpaSelectionEvent 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/JpaStructureSelectionParticipant.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.java
deleted file mode 100644
index 86df5d0753..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/JpaStructureSelectionParticipant.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.ui.internal.selection;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.ui.internal.views.structure.JpaStructureView;
-
-public class JpaStructureSelectionParticipant
- implements JpaSelectionParticipant
-{
- final JpaStructureView structureView;
-
-
- public JpaStructureSelectionParticipant(JpaSelectionManager selectionManager, JpaStructureView structureView) {
- super();
- this.structureView = structureView;
- structureView.addSelectionChangedListener(new StructureViewSelectionListener(selectionManager, structureView));
- }
-
- public JpaSelection getSelection() {
- return this.structureView.getSelection();
- }
-
- public void selectionChanged(JpaSelectionEvent evt) {
- this.structureView.select(evt.getSelection());
- }
-
- public boolean disposeOnHide() {
- return false;
- }
-
- public void dispose() {
- // NOP
- }
-
-
- // ********** listener **********
-
- private class StructureViewSelectionListener
- implements ISelectionChangedListener
- {
- private final JpaSelectionManager selectionManager;
-
- StructureViewSelectionListener(JpaSelectionManager selectionManager, JpaStructureView structureView) {
- super();
- this.selectionManager = selectionManager;
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- if (structureView.getViewSite().getWorkbenchWindow().getPartService().getActivePart() == structureView) {
- selectionManager.select(this.structureViewSelection());
- }
- }
-
- private JpaSelection structureViewSelection() {
- return JpaStructureSelectionParticipant.this.structureView.getSelection();
- }
- }
-}
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 25a5d37257..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionManagerFactory.java
+++ /dev/null
@@ -1,99 +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>JpaSelectionManager</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>JpaSelectionManager</code>.
- *
- * @return The <code>JpaSelectionManager</code> associated with the current
- * <code>IWorkbenchWindow</code>
- */
- public static JpaSelectionManager 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<IWorkbenchWindow, DefaultJpaSelectionManager> managers;
-
- private WindowListener windowListener;
-
-
- private SelectionManagerFactory() {
- managers = new HashMap<IWorkbenchWindow, DefaultJpaSelectionManager>();
- windowListener = new WindowListener();
- }
-
- private void init() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.addWindowListener(windowListener);
- }
-
- /**
- * Returns the JpaSelectionManager for the IWorkbenchWindow.
- * Creates a new one if none exists yet.
- */
- private DefaultJpaSelectionManager internalGetSelectionManager(IWorkbenchWindow window) {
- if (window == null) {
- throw new IllegalArgumentException("The IWorkbenchWindow cannot be null");
- }
-
- if (! managers.containsKey(window)) {
- DefaultJpaSelectionManager manager = new DefaultJpaSelectionManager();
- this.managers.put(window, manager);
- manager.init(window);
- }
-
- return managers.get(window);
- }
-
-
- private class WindowListener implements IWindowListener
- {
- public void windowOpened(IWorkbenchWindow aWindow) {}
-
- public void windowClosed(IWorkbenchWindow aWindow) {
- DefaultJpaSelectionManager manager = internalGetSelectionManager(aWindow);
- manager.dispose();
- managers.remove(aWindow);
- }
-
- public void windowActivated(IWorkbenchWindow aWindow) {}
-
- 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 7d3dd5a7f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/SelectionParticipantFactory.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.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.ui.internal.views.JpaDetailsView;
-import org.eclipse.jpt.ui.internal.views.structure.JpaStructureView;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class SelectionParticipantFactory
- implements IAdapterFactory
-{
- @SuppressWarnings("unchecked")
- private static final Class[] ADAPTER_LIST = new Class[] { JpaSelectionParticipant.class };
-
- @SuppressWarnings("unchecked")
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (! (adaptableObject instanceof IWorkbenchPart)) {
- return null;
- }
-
- JpaSelectionManager selectionManager =
- SelectionManagerFactory.getSelectionManager(((IWorkbenchPart) adaptableObject).getSite().getWorkbenchWindow());
- if (adaptableObject instanceof ITextEditor) {
- return new TextEditorSelectionParticipant(selectionManager, (ITextEditor) adaptableObject);
- }
- if (adaptableObject instanceof JpaStructureView) {
- return new JpaStructureSelectionParticipant(selectionManager, (JpaStructureView) adaptableObject);
- }
- else if (adaptableObject instanceof JpaDetailsView) {
- return new JpaDetailsSelectionParticipant((JpaDetailsView) adaptableObject);
- }
- else {
- return null;
- }
- }
-
-}
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 af0ad9c1c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/selection/TextEditorSelectionParticipant.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.selection;
-
-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.JpaFile;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.TextRange;
-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
- implements JpaSelectionParticipant
-{
- private final JpaSelectionManager selectionManager;
-
- final ITextEditor textEditor;
-
- private final IPropertyListener editorInputListener;
-
- private final ISelectionChangedListener editorSelectionListener;
-
- private JpaSelection currentSelection;
-
- private boolean forwardSelection = true; // TODO this just smells wrong ~bjv
-
-
- public TextEditorSelectionParticipant(JpaSelectionManager selectionManager, ITextEditor textEditor) {
- super();
- this.selectionManager = selectionManager;
- this.textEditor = textEditor;
- this.editorInputListener = new EditorInputListener();
- this.textEditor.addPropertyListener(this.editorInputListener);
- this.editorSelectionListener = new EditorSelectionListener();
- this.postSelectionProvider().addPostSelectionChangedListener(this.editorSelectionListener);
- this.currentSelection = this.calculateSelection();
- }
-
- // ********** IJpaSelectionParticipant implementation **********
-
- public JpaSelection getSelection() {
- return this.currentSelection;
- }
-
- public void selectionChanged(JpaSelectionEvent evt) {
- JpaSelection newSelection = evt.getSelection();
-
- if ((newSelection == JpaSelection.NULL_SELECTION)
- || newSelection.equals(this.currentSelection)) {
- return;
- }
-
- this.forwardSelection = false;
- TextRange textRange = newSelection.getSelectedNode().selectionTextRange();
- if (textRange != null) {
- this.textEditor.selectAndReveal(textRange.getOffset(), textRange.getLength());
- }
- this.forwardSelection = true;
- }
-
- public boolean disposeOnHide() {
- return true;
- }
-
- public void dispose() {
- this.textEditor.removePropertyListener(this.editorInputListener);
- this.postSelectionProvider().removePostSelectionChangedListener(this.editorSelectionListener);
- }
-
-
- // ********** internal methods **********
-
- private JpaSelection calculateSelection() {
- ISelection selection = this.textEditor.getSelectionProvider().getSelection();
- if (! (selection instanceof ITextSelection)) {
- return JpaSelection.NULL_SELECTION;
- }
-
- JpaFile jpaFile = this.jpaFile();
- if (jpaFile == null) {
- return JpaSelection.NULL_SELECTION;
- }
-
- JpaStructureNode selectedNode = jpaFile.structureNode(((ITextSelection) selection).getOffset());
- if (selectedNode == null) {
- return JpaSelection.NULL_SELECTION;
- }
-
- return new DefaultJpaSelection(selectedNode);
- }
-
- private JpaFile jpaFile() {
- IEditorInput input = this.textEditor.getEditorInput();
- if ( ! (input instanceof IFileEditorInput)) {
- return null;
- }
- return JptCorePlugin.jpaFile(((IFileEditorInput) input).getFile());
- }
-
- private IPostSelectionProvider postSelectionProvider() {
- return (IPostSelectionProvider) this.textEditor.getSelectionProvider();
- }
-
-
- // ********** listener callbacks **********
-
- void editorInputChanged() {
- JpaSelection newSelection = this.calculateSelection();
- if (newSelection.equals(this.currentSelection)) {
- return;
- }
- this.currentSelection = newSelection;
-
- if (this.forwardSelection) {
- this.selectionManager.select(newSelection);
- }
- }
-
- void editorSelectionChanged(SelectionChangedEvent event) {
- JpaSelection newSelection = this.calculateSelection();
- if (newSelection.equals(this.currentSelection)) {
- return;
- }
- this.currentSelection = newSelection;
-
- if (this.forwardSelection) {
- this.selectionManager.select(newSelection);
- }
- }
-
-
- // ********** listeners **********
-
- private class EditorInputListener implements IPropertyListener {
- EditorInputListener() {
- super();
- }
- public void propertyChanged(Object source, int propId) {
- if ((source == TextEditorSelectionParticipant.this.textEditor)
- && (propId == IEditorPart.PROP_INPUT)) {
- TextEditorSelectionParticipant.this.editorInputChanged();
- }
- }
- }
-
-
- private class EditorSelectionListener implements ISelectionChangedListener {
- EditorSelectionListener() {
- super();
- }
- public void selectionChanged(SelectionChangedEvent event) {
- TextEditorSelectionParticipant.this.editorSelectionChanged(event);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemContentProviderFactory.java
deleted file mode 100644
index c62cd3beaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemContentProviderFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-
-public abstract class GeneralJpaMappingItemContentProviderFactory
- implements TreeItemContentProviderFactory
-{
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- DelegatingTreeContentAndLabelProvider treeContentProvider = (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
- if (item instanceof PersistentType) {
- return buildPersistentTypeItemContentProvider((PersistentType) item, treeContentProvider);
- }
- else if (item instanceof PersistentAttribute) {
- return new PersistentAttributeItemContentProvider((PersistentAttribute) item, treeContentProvider);
- }
- return null;
- }
-
- protected abstract TreeItemContentProvider buildPersistentTypeItemContentProvider(PersistentType persistentType, DelegatingTreeContentAndLabelProvider treeContentProvider);
-
-
-
- @SuppressWarnings("unchecked")
- public static class PersistentAttributeItemContentProvider extends AbstractTreeItemContentProvider
- {
- public PersistentAttributeItemContentProvider(
- PersistentAttribute persistentAttribute, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistentAttribute, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return ((PersistentAttribute) model()).parent();
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemLabelProviderFactory.java
deleted file mode 100644
index 330392fafc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/GeneralJpaMappingItemLabelProviderFactory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class GeneralJpaMappingItemLabelProviderFactory
- implements ItemLabelProviderFactory
-{
- public ItemLabelProvider buildItemLabelProvider(
- Object item, DelegatingContentAndLabelProvider labelProvider) {
- if (item instanceof PersistentType) {
- return new PersistentTypeItemLabelProvider((PersistentType) item, labelProvider);
- }
- else if (item instanceof PersistentAttribute) {
- return new PersistentAttributeItemLabelProvider((PersistentAttribute) item, labelProvider);
- }
- return null;
- }
-
-
- public static class PersistentTypeItemLabelProvider extends AbstractItemLabelProvider
- {
- public PersistentTypeItemLabelProvider(
- PersistentType persistentType, DelegatingContentAndLabelProvider labelProvider) {
- super(persistentType, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<PersistentType, String>(PersistentType.NAME_PROPERTY, (PersistentType) model()) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<PersistentType, Image>(PersistentType.MAPPING_PROPERTY, (PersistentType) model()) {
- @Override
- protected Image buildValue_() {
- return JpaMappingImageHelper.imageForTypeMapping(subject.mappingKey());
- }
- };
- }
- }
-
-
- public static class PersistentAttributeItemLabelProvider extends AbstractItemLabelProvider
- {
- public PersistentAttributeItemLabelProvider(
- PersistentAttribute persistentAttribute, DelegatingContentAndLabelProvider labelProvider) {
- super(persistentAttribute, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<PersistentAttribute, String>(PersistentAttribute.NAME_PROPERTY, (PersistentAttribute) model()) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<PersistentAttribute, Image>(
- new String[] {PersistentAttribute.DEFAULT_MAPPING_PROPERTY, PersistentAttribute.SPECIFIED_MAPPING_PROPERTY},
- (PersistentAttribute) model()) {
- @Override
- protected Image buildValue_() {
- Image image = JpaMappingImageHelper.imageForAttributeMapping(subject.mappingKey());
- if (((PersistentAttribute) model()).isVirtual()) {
- return JptUiIcons.ghost(image);
- }
- return image;
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemContentProviderFactory.java
deleted file mode 100644
index 4e4a228836..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemContentProviderFactory.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-
-public class JavaItemContentProviderFactory extends GeneralJpaMappingItemContentProviderFactory
-{
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentProvider) {
- DelegatingTreeContentAndLabelProvider treeContentProvider = (DelegatingTreeContentAndLabelProvider) contentProvider;
- if (item instanceof JavaResourceModel) {
- return new JavaResourceModelItemContentProvider((JavaResourceModel) item, treeContentProvider);
- }
- return super.buildItemContentProvider(item, treeContentProvider);
- }
-
- @Override
- protected TreeItemContentProvider buildPersistentTypeItemContentProvider(PersistentType persistentType, DelegatingTreeContentAndLabelProvider treeContentProvider) {
- return new PersistentTypeItemContentProvider(persistentType, treeContentProvider);
- }
-
- public static class PersistentTypeItemContentProvider extends AbstractTreeItemContentProvider<PersistentAttribute>
- {
- public PersistentTypeItemContentProvider(
- PersistentType persistentType, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistentType, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return ((PersistentType) model()).parent();
- }
-
- @Override
- protected ListValueModel<PersistentAttribute> buildChildrenModel() {
- return new ListAspectAdapter<PersistentType, PersistentAttribute>(new String[]{PersistentType.SPECIFIED_ATTRIBUTES_LIST}, (PersistentType) model()) {
- @Override
- protected ListIterator<PersistentAttribute> listIterator_() {
- return subject.attributes();
- }
-
- @Override
- protected int size_() {
- return subject.attributesSize();
- }
- };
- }
- }
- public static class JavaResourceModelItemContentProvider extends AbstractTreeItemContentProvider<JpaStructureNode>
- {
- public JavaResourceModelItemContentProvider(
- JavaResourceModel javaResourceModel, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(javaResourceModel, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected ListValueModel<JpaStructureNode> buildChildrenModel() {
- return new ListAspectAdapter<JavaResourceModel, JpaStructureNode>(
- ResourceModel.ROOT_STRUCTURE_NODES_LIST, (JavaResourceModel) model()) {
- @Override
- protected ListIterator<JpaStructureNode> listIterator_() {
- return subject.rootStructureNodes();
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemLabelProviderFactory.java
deleted file mode 100644
index 82bc52ac7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaItemLabelProviderFactory.java
+++ /dev/null
@@ -1,17 +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.structure;
-
-
-public class JavaItemLabelProviderFactory extends GeneralJpaMappingItemLabelProviderFactory
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaResourceModelStructureProvider.java
deleted file mode 100644
index fd9ffbcbf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JavaResourceModelStructureProvider.java
+++ /dev/null
@@ -1,31 +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.structure;
-
-import org.eclipse.jpt.core.internal.resource.java.JavaResourceModel;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-
-public class JavaResourceModelStructureProvider
- extends ResourceModelStructureProvider
-{
- public JavaResourceModelStructureProvider(JavaResourceModel resourceModel) {
- super(resourceModel);
- }
-
- public TreeItemContentProviderFactory treeItemContentProviderFactory() {
- return new JavaItemContentProviderFactory();
- }
-
- public ItemLabelProviderFactory itemLabelProviderFactory() {
- return new JavaItemLabelProviderFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JpaStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JpaStructureProvider.java
deleted file mode 100644
index 553a57e2fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/JpaStructureProvider.java
+++ /dev/null
@@ -1,30 +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.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-
-public interface JpaStructureProvider
-{
- // TODO - change this
- Object getInput();
-
- /**
- * Build an factory to create {@link TreeItemContentProvider}s
- */
- TreeItemContentProviderFactory treeItemContentProviderFactory();
-
- /**
- * Build a factory to create {@link ItemLabelProvider}s
- */
- ItemLabelProviderFactory itemLabelProviderFactory();
-
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemContentProviderFactory.java
deleted file mode 100644
index 7b5ff77b8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemContentProviderFactory.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmResourceModel;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-public class OrmItemContentProviderFactory extends GeneralJpaMappingItemContentProviderFactory
-{
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentProvider) {
- DelegatingTreeContentAndLabelProvider treeContentProvider = (DelegatingTreeContentAndLabelProvider) contentProvider;
- if (item instanceof OrmResourceModel) {
- return new OrmResourceModelItemContentProvider((OrmResourceModel) item, treeContentProvider);
- }
- if (item instanceof EntityMappings) {
- return new EntityMappingsItemContentProvider((EntityMappings) item, treeContentProvider);
- }
- return super.buildItemContentProvider(item, treeContentProvider);
- }
-
-
- @Override
- protected TreeItemContentProvider buildPersistentTypeItemContentProvider(PersistentType persistentType, DelegatingTreeContentAndLabelProvider treeContentProvider) {
- return new PersistentTypeItemContentProvider((OrmPersistentType) persistentType, treeContentProvider);
- }
-
- public static class PersistentTypeItemContentProvider extends AbstractTreeItemContentProvider<OrmPersistentAttribute>
- {
- public PersistentTypeItemContentProvider(
- OrmPersistentType persistentType, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistentType, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return ((OrmPersistentType) model()).parent();
- }
-
- @Override
- protected ListValueModel<OrmPersistentAttribute> buildChildrenModel() {
- java.util.List<ListValueModel<OrmPersistentAttribute>> list = new ArrayList<ListValueModel<OrmPersistentAttribute>>();
- list.add(buildSpecifiedPersistentAttributesListHolder());
- list.add(buildVirtualPersistentAttributesListHolder());
- return new CompositeListValueModel<ListValueModel<OrmPersistentAttribute>, OrmPersistentAttribute>(list);
- }
-
-
- protected ListValueModel<OrmPersistentAttribute> buildSpecifiedPersistentAttributesListHolder() {
- return new ListAspectAdapter<OrmPersistentType, OrmPersistentAttribute>(new String[]{PersistentType.SPECIFIED_ATTRIBUTES_LIST}, (OrmPersistentType) model()) {
- @Override
- protected ListIterator<OrmPersistentAttribute> listIterator_() {
- return subject.specifiedAttributes();
- }
- @Override
- protected int size_() {
- return subject.specifiedAttributesSize();
- }
- };
- }
-
- protected ListValueModel<OrmPersistentAttribute> buildVirtualPersistentAttributesListHolder() {
- return new ListAspectAdapter<OrmPersistentType, OrmPersistentAttribute>(new String[]{OrmPersistentType.VIRTUAL_ATTRIBUTES_LIST}, (OrmPersistentType) model()) {
- @Override
- protected ListIterator<OrmPersistentAttribute> listIterator_() {
- return subject.virtualAttributes();
- }
- @Override
- protected int size_() {
- return subject.virtualAttributesSize();
- }
- };
- }
-}
-
-
- public static class OrmResourceModelItemContentProvider extends AbstractTreeItemContentProvider<JpaStructureNode>
- {
- public OrmResourceModelItemContentProvider(
- OrmResourceModel ormResourceModel, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(ormResourceModel, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected ListValueModel<JpaStructureNode> buildChildrenModel() {
- return new ListAspectAdapter<OrmResourceModel, JpaStructureNode>(
- ResourceModel.ROOT_STRUCTURE_NODES_LIST, (OrmResourceModel) model()) {
- @Override
- protected ListIterator<JpaStructureNode> listIterator_() {
- return subject.rootStructureNodes();
- }
- };
- }
- }
-
-
- public static class EntityMappingsItemContentProvider extends AbstractTreeItemContentProvider<OrmPersistentType>
- {
- public EntityMappingsItemContentProvider(
- EntityMappings entityMappings, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(entityMappings, contentProvider);
- }
-
-
- @Override
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected ListValueModel<OrmPersistentType> buildChildrenModel() {
- return new ListAspectAdapter<EntityMappings, OrmPersistentType>(
- EntityMappings.PERSISTENT_TYPES_LIST, (EntityMappings) model()) {
- @Override
- protected ListIterator<OrmPersistentType> listIterator_() {
- return subject.ormPersistentTypes();
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java
deleted file mode 100644
index 608dab506a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmItemLabelProviderFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProvider;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-public class OrmItemLabelProviderFactory extends GeneralJpaMappingItemLabelProviderFactory
-{
- public ItemLabelProvider buildItemLabelProvider(
- Object item, DelegatingContentAndLabelProvider labelProvider) {
- if (item instanceof EntityMappings) {
- return new EntityMappingsItemLabelProvider((EntityMappings) item, labelProvider);
- }
- else return super.buildItemLabelProvider(item, labelProvider);
- }
-
-
- public static class EntityMappingsItemLabelProvider extends AbstractItemLabelProvider
- {
- public EntityMappingsItemLabelProvider(
- EntityMappings entityMappings, DelegatingContentAndLabelProvider labelProvider) {
- super(entityMappings, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(JptUiMessages.OrmItemLabelProviderFactory_entityMappingsLabel);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptUiPlugin.getImage(JptUiIcons.ENTITY_MAPPINGS));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmResourceModelStructureProvider.java
deleted file mode 100644
index c6739df3e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/OrmResourceModelStructureProvider.java
+++ /dev/null
@@ -1,31 +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.structure;
-
-import org.eclipse.jpt.core.resource.orm.OrmResourceModel;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-
-public class OrmResourceModelStructureProvider
- extends ResourceModelStructureProvider
-{
- public OrmResourceModelStructureProvider(OrmResourceModel resourceModel) {
- super(resourceModel);
- }
-
- public TreeItemContentProviderFactory treeItemContentProviderFactory() {
- return new OrmItemContentProviderFactory();
- }
-
- public ItemLabelProviderFactory itemLabelProviderFactory() {
- return new OrmItemLabelProviderFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemContentProviderFactory.java
deleted file mode 100644
index 89e8244412..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemContentProviderFactory.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.ResourceModel;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.PersistenceResourceModel;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-public class PersistenceItemContentProviderFactory
- implements TreeItemContentProviderFactory
-{
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- DelegatingTreeContentAndLabelProvider treeContentProvider = (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
- if (item instanceof PersistenceResourceModel) {
- return new PersistenceResourceModelItemContentProvider((PersistenceResourceModel) item, treeContentProvider);
- }
- else if (item instanceof Persistence) {
- return new PersistenceItemContentProvider((Persistence) item, treeContentProvider);
- }
- else if (item instanceof PersistenceUnit) {
- return new PersistenceUnitItemContentProvider((PersistenceUnit) item, treeContentProvider);
- }
- else if (item instanceof MappingFileRef) {
- return new MappingFileRefItemContentProvider((MappingFileRef) item, treeContentProvider);
- }
- else if (item instanceof ClassRef) {
- return new ClassRefItemContentProvider((ClassRef) item, treeContentProvider);
- }
- return null;
- }
-
-
- public static class PersistenceResourceModelItemContentProvider extends AbstractTreeItemContentProvider<JpaStructureNode>
- {
- public PersistenceResourceModelItemContentProvider(
- PersistenceResourceModel persistenceResourceModel,
- DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistenceResourceModel, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected ListValueModel<JpaStructureNode> buildChildrenModel() {
- return new ListAspectAdapter<PersistenceResourceModel, JpaStructureNode>(
- ResourceModel.ROOT_STRUCTURE_NODES_LIST, (PersistenceResourceModel) model()) {
- @Override
- protected ListIterator<JpaStructureNode> listIterator_() {
- return subject.rootStructureNodes();
- }
- };
- }
- }
-
-
- public static class PersistenceItemContentProvider extends AbstractTreeItemContentProvider<PersistenceUnit>
- {
- public PersistenceItemContentProvider(
- Persistence persistence, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistence, contentProvider);
- }
-
-
- @Override
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected ListValueModel<PersistenceUnit> buildChildrenModel() {
- return new ListAspectAdapter<Persistence, PersistenceUnit>(
- Persistence.PERSISTENCE_UNITS_LIST, (Persistence) model()) {
- @Override
- protected ListIterator<PersistenceUnit> listIterator_() {
- return subject.persistenceUnits();
- }
- };
- }
- }
-
-
- public static class PersistenceUnitItemContentProvider extends AbstractTreeItemContentProvider<JpaStructureNode>
- {
- public PersistenceUnitItemContentProvider(
- PersistenceUnit persistenceUnit, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistenceUnit, contentProvider);
- }
-
- @Override
- public Persistence getParent() {
- return ((PersistenceUnit) model()).parent();
- }
-
- @Override
- protected ListValueModel<JpaStructureNode> buildChildrenModel() {
- ListValueModel<JpaStructureNode> specifiedMappingFileLvm =
- new ListAspectAdapter<PersistenceUnit, JpaStructureNode>(
- PersistenceUnit.SPECIFIED_MAPPING_FILE_REF_LIST,
- (PersistenceUnit) model()) {
- @Override
- protected ListIterator<JpaStructureNode> listIterator_() {
- return new ReadOnlyCompositeListIterator<JpaStructureNode>(
- subject.specifiedMappingFileRefs());
- }
- };
-
- ListValueModel<JpaStructureNode> impliedMappingFileLvm =
- new CollectionListValueModelAdapter<JpaStructureNode>(
- new PropertyCollectionValueModelAdapter<JpaStructureNode>(
- new PropertyAspectAdapter<PersistenceUnit, JpaStructureNode>(
- PersistenceUnit.IMPLIED_MAPPING_FILE_REF_PROPERTY,
- (PersistenceUnit) model()) {
- @Override
- protected JpaStructureNode buildValue_() {
- return subject.getImpliedMappingFileRef();
- }
- }));
- ListValueModel<JpaStructureNode> classLvm =
- new ListAspectAdapter<PersistenceUnit, JpaStructureNode>(
- new String[] {PersistenceUnit.SPECIFIED_CLASS_REF_LIST, PersistenceUnit.IMPLIED_CLASS_REF_LIST},
- (PersistenceUnit) model()) {
- @Override
- protected ListIterator<JpaStructureNode> listIterator_() {
- return new ReadOnlyCompositeListIterator<JpaStructureNode>(
- subject.classRefs());
- }
- };
- List<ListValueModel<JpaStructureNode>> list = new ArrayList<ListValueModel<JpaStructureNode>>();
- list.add(specifiedMappingFileLvm);
- list.add(impliedMappingFileLvm);
- list.add(classLvm);
- return new CompositeListValueModel<ListValueModel<JpaStructureNode>, JpaStructureNode>(list);
- }
- }
-
-
- @SuppressWarnings("unchecked")
- public static class MappingFileRefItemContentProvider extends AbstractTreeItemContentProvider
- {
- public MappingFileRefItemContentProvider(
- MappingFileRef mappingFileRef, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(mappingFileRef, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return ((MappingFileRef) model()).persistenceUnit();
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
- }
-
-
- @SuppressWarnings("unchecked")
- public static class ClassRefItemContentProvider extends AbstractTreeItemContentProvider
- {
- public ClassRefItemContentProvider(
- ClassRef classRef, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(classRef, contentProvider);
- }
-
- @Override
- public Object getParent() {
- return ((ClassRef) model()).persistenceUnit();
- }
-
- @Override
- public boolean hasChildren() {
- return false;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemLabelProviderFactory.java
deleted file mode 100644
index 76d9844838..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceItemLabelProviderFactory.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.structure;
-
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-public class PersistenceItemLabelProviderFactory
- implements ItemLabelProviderFactory
-{
- public ItemLabelProvider buildItemLabelProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Persistence) {
- return new PersistenceItemLabelProvider((Persistence) item, contentAndLabelProvider);
- }
- else if (item instanceof PersistenceUnit) {
- return new PersistenceUnitItemLabelProvider((PersistenceUnit) item, contentAndLabelProvider);
- }
- else if (item instanceof MappingFileRef) {
- return new MappingFileRefItemLabelProvider((MappingFileRef) item, contentAndLabelProvider);
- }
- else if (item instanceof ClassRef) {
- return new ClassRefItemLabelProvider((ClassRef) item, contentAndLabelProvider);
- }
- return null;
- }
-
-
- public static class PersistenceItemLabelProvider extends AbstractItemLabelProvider
- {
- public PersistenceItemLabelProvider(
- Persistence persistence, DelegatingContentAndLabelProvider labelProvider) {
- super(persistence, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new StaticPropertyValueModel<String>(JptUiMessages.PersistenceItemLabelProviderFactory_persistenceLabel);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptUiPlugin.getImage(JptUiIcons.PERSISTENCE));
- }
- }
-
-
- public static class PersistenceUnitItemLabelProvider extends AbstractItemLabelProvider
- {
- public PersistenceUnitItemLabelProvider(
- PersistenceUnit persistenceUnit, DelegatingContentAndLabelProvider labelProvider) {
- super(persistenceUnit, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(PersistenceUnit.NAME_PROPERTY, (PersistenceUnit) model()) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new StaticPropertyValueModel<Image>(JptUiPlugin.getImage(JptUiIcons.PERSISTENCE_UNIT));
- }
- }
-
-
- public static class MappingFileRefItemLabelProvider extends AbstractItemLabelProvider
- {
- public MappingFileRefItemLabelProvider(
- MappingFileRef mappingFileRef, DelegatingContentAndLabelProvider labelProvider) {
- super(mappingFileRef, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<MappingFileRef, String>(MappingFileRef.FILE_NAME_PROPERTY, (MappingFileRef) model()) {
- @Override
- protected String buildValue_() {
- return subject.getFileName();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- Image image = JptUiPlugin.getImage(JptUiIcons.MAPPING_FILE_REF);
- if (((MappingFileRef) model()).isVirtual()) {
- image = JptUiIcons.ghost(image);
- }
- return new StaticPropertyValueModel<Image>(image);
- }
- }
-
-
- public static class ClassRefItemLabelProvider extends AbstractItemLabelProvider
- {
- public ClassRefItemLabelProvider(
- ClassRef classRef, DelegatingContentAndLabelProvider labelProvider) {
- super(classRef, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<ClassRef, String>(ClassRef.CLASS_NAME_PROPERTY, (ClassRef) model()) {
- @Override
- protected String buildValue_() {
- return subject.getClassName();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- Image image = JptUiPlugin.getImage(JptUiIcons.CLASS_REF);
- if (((ClassRef) model()).isVirtual()) {
- image = JptUiIcons.ghost(image);
- }
- return new StaticPropertyValueModel<Image>(image);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceResourceModelStructureProvider.java
deleted file mode 100644
index 5cdc82babd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/PersistenceResourceModelStructureProvider.java
+++ /dev/null
@@ -1,31 +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.structure;
-
-import org.eclipse.jpt.core.resource.persistence.PersistenceResourceModel;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-
-public class PersistenceResourceModelStructureProvider
- extends ResourceModelStructureProvider
-{
- public PersistenceResourceModelStructureProvider(PersistenceResourceModel resourceModel) {
- super(resourceModel);
- }
-
- public TreeItemContentProviderFactory treeItemContentProviderFactory() {
- return new PersistenceItemContentProviderFactory();
- }
-
- public ItemLabelProviderFactory itemLabelProviderFactory() {
- return new PersistenceItemLabelProviderFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/ResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/ResourceModelStructureProvider.java
deleted file mode 100644
index 11a2a27115..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/structure/ResourceModelStructureProvider.java
+++ /dev/null
@@ -1,32 +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.structure;
-
-import org.eclipse.jpt.core.ResourceModel;
-
-public abstract class ResourceModelStructureProvider
- implements JpaStructureProvider
-{
- protected ResourceModel resourceModel;
-
-
- public ResourceModelStructureProvider(ResourceModel resourceModel) {
- this.resourceModel = resourceModel;
- }
-
- public Object getInput() {
- return resourceModel;
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/BooleanButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/BooleanButtonModelAdapter.java
deleted file mode 100644
index b43dc6e3f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/BooleanButtonModelAdapter.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.swt;
-
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-
-/**
- * This adapter can be used to keep a check box or toggle button in synch with
- * a model boolean.
- */
-@SuppressWarnings("nls")
-public class BooleanButtonModelAdapter {
-
- /** A value model on the underlying model boolean. */
- protected final WritablePropertyValueModel<Boolean> booleanHolder;
-
- /**
- * A listener that allows us to synchronize the button's selection state with
- * the model boolean.
- */
- protected final PropertyChangeListener booleanChangeListener;
-
- /** The check box/toggle button we synchronize with the model boolean. */
- protected final Button button;
-
- /**
- * A listener that allows us to synchronize the model boolean with
- * the button's selection state.
- */
- protected final SelectionListener buttonSelectionListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the button
- * is disposed.
- */
- protected final DisposeListener buttonDisposeListener;
-
- /**
- * The default setting for the check box/toggle button; for when the
- * underlying model is null.
- * The default [default value] is false (i.e. the button is checked/popped out).
- */
- protected final boolean defaultValue;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified boolean to the specified button.
- * If the boolean is null, the button's value will be "unselected".
- */
- public static BooleanButtonModelAdapter adapt(WritablePropertyValueModel<Boolean> booleanHolder, Button button) {
- return new BooleanButtonModelAdapter(booleanHolder, button);
- }
-
- /**
- * Adapt the specified boolean to the specified button.
- * If the boolean is null, the button's value will be the specified default value.
- */
- public static BooleanButtonModelAdapter adapt(WritablePropertyValueModel<Boolean> booleanHolder, Button button, boolean defaultValue) {
- return new BooleanButtonModelAdapter(booleanHolder, button, defaultValue);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder and button are required.
- * The default value will be false.
- */
- protected BooleanButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, Button button) {
- this(booleanHolder, button, false);
- }
-
- /**
- * Constructor - the boolean holder and button are required.
- */
- protected BooleanButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, Button button, boolean defaultValue) {
- super();
- if ((booleanHolder == null) || (button == null)) {
- throw new NullPointerException();
- }
- this.booleanHolder = booleanHolder;
- this.button = button;
- this.defaultValue = defaultValue;
-
- this.booleanChangeListener = this.buildBooleanChangeListener();
- this.booleanHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
-
- this.buttonDisposeListener = this.buildButtonDisposeListener();
- this.button.addDisposeListener(this.buttonDisposeListener);
-
- this.buttonSelectionListener = this.buildButtonSelectionListener();
- this.button.addSelectionListener(this.buttonSelectionListener);
-
- this.setButtonSelection(this.booleanHolder.value());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- protected PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- BooleanButtonModelAdapter.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "boolean listener";
- }
- };
- }
-
- protected SelectionListener buildButtonSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- BooleanButtonModelAdapter.this.buttonSelected(event);
- }
- @Override
- public String toString() {
- return "button selection listener";
- }
- };
- }
-
- protected DisposeListener buildButtonDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- BooleanButtonModelAdapter.this.buttonDisposed(event);
- }
- @Override
- public String toString() {
- return "button dispose listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * The model has changed - synchronize the button.
- * If the new model value is null, use the adapter's default value
- * (which is typically false).
- */
- protected void booleanChanged(PropertyChangeEvent event) {
- this.setButtonSelection((Boolean) event.newValue());
- }
-
- protected void setButtonSelection(Boolean b) {
- if (this.button.isDisposed()) {
- return;
- }
- this.button.setSelection(this.booleanValue(b));
- }
-
- protected boolean booleanValue(Boolean b) {
- return (b != null) ? b.booleanValue() : this.defaultValue();
- }
-
- protected boolean defaultValue() {
- return this.defaultValue;
- }
-
- /**
- * The button has been "selected" - synchronize the model.
- */
- protected void buttonSelected(SelectionEvent event) {
- if (this.button.isDisposed()) {
- return;
- }
- this.booleanHolder.setValue(Boolean.valueOf(this.button.getSelection()));
- }
-
-
- // ********** dispose **********
-
- protected void buttonDisposed(DisposeEvent event) {
- // the button is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.button.removeSelectionListener(this.buttonSelectionListener);
- this.button.removeDisposeListener(this.buttonDisposeListener);
- this.booleanHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/ListBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/ListBoxModelAdapter.java
deleted file mode 100644
index 6459fccb14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/ListBoxModelAdapter.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.swt;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.ui.internal.listeners.SWTCollectionChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.List;
-
-/**
- * This adapter provides a more object-oriented interface to the items and
- * selected items in a list box.
- * 'listHolder' contains the items in the list box.
- * 'selectedItemsHolder' contains the items in 'listHolder' that are selected
- * in the list box.
- */
-@SuppressWarnings("nls")
-public class ListBoxModelAdapter<E> {
-
- // ********** model **********
- /**
- * A value model on the underlying model list.
- */
- protected final ListValueModel<E> listHolder;
-
- /**
- * A listener that allows us to synchronize the list box's contents with
- * the model list.
- */
- protected final ListChangeListener listChangeListener;
-
- /**
- * A value model on the underlying model selections.
- */
- protected final CollectionValueModel<E> selectedItemsHolder;
-
- /**
- * A listener that allows us to synchronize the list box's selection with
- * the model selections.
- */
- protected final CollectionChangeListener selectedItemsChangeListener;
-
- /**
- * A converter that converts items in the model list
- * to strings that can be put in the list box.
- */
- protected StringConverter<E> stringConverter;
-
- // ********** UI **********
- /**
- * The list box we keep synchronized with the model list.
- */
- protected final List listBox;
-
- /**
- * A listener that allows us to synchronize our selection list holder
- * with the list box's selection.
- */
- protected final SelectionListener listBoxSelectionListener;
-
- /**
- * Clients that are interested in selection change events.
- */
- protected SelectionChangeListener<E>[] selectionChangeListeners;
-
- /**
- * Clients that are interested in double click events.
- */
- protected DoubleClickListener<E>[] doubleClickListeners;
-
- /**
- * A listener that allows us to stop listening to stuff when the list box
- * is disposed.
- */
- protected final DisposeListener listBoxDisposeListener;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified model list and selections to the specified list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the list box, which calls #toString() on the
- * items in the model list.
- */
- public static <T> ListBoxModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- CollectionValueModel<T> selectedItemsHolder,
- List listBox)
- {
- return adapt(listHolder, selectedItemsHolder, listBox, StringConverter.Default.<T>instance());
- }
-
- /**
- * Adapt the specified model list and selections to the specified list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static <T> ListBoxModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- CollectionValueModel<T> selectedItemsHolder,
- List listBox,
- StringConverter<T> stringConverter)
- {
- return new ListBoxModelAdapter<T>(listHolder, selectedItemsHolder, listBox, stringConverter);
- }
-
- /**
- * Adapt the specified model list and selection to the specified list box.
- * Use the default string converter to convert the model items to strings
- * to be displayed in the list box, which calls #toString() on the
- * items in the model list.
- */
- public static <T> ListBoxModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- PropertyValueModel<T> selectedItemHolder,
- List listBox)
- {
- return adapt(listHolder, selectedItemHolder, listBox, StringConverter.Default.<T>instance());
- }
-
- /**
- * Adapt the specified model list and selection to the specified list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static <T> ListBoxModelAdapter<T> adapt(
- ListValueModel<T> listHolder,
- PropertyValueModel<T> selectedItemHolder,
- List listBox,
- StringConverter<T> stringConverter)
- {
- return new ListBoxModelAdapter<T>(listHolder, new PropertyCollectionValueModelAdapter<T>(selectedItemHolder), listBox, stringConverter);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, list box, and
- * string converter are required.
- */
- protected ListBoxModelAdapter(
- ListValueModel<E> listHolder,
- CollectionValueModel<E> selectedItemsHolder,
- List listBox,
- StringConverter<E> stringConverter)
- {
- super();
- if ((listHolder == null) || (selectedItemsHolder == null) || (listBox == null) || (stringConverter == null)) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.selectedItemsHolder = selectedItemsHolder;
- this.listBox = listBox;
- this.stringConverter = stringConverter;
-
- this.listChangeListener = this.buildListChangeListener();
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
-
- this.selectedItemsChangeListener = this.buildSelectedItemsChangeListener();
- this.selectedItemsHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
-
- this.listBoxSelectionListener = this.buildListBoxSelectionListener();
- this.listBox.addSelectionListener(this.listBoxSelectionListener);
-
- this.selectionChangeListeners = this.buildSelectionChangeListeners();
- this.doubleClickListeners = this.buildDoubleClickListeners();
-
- this.listBoxDisposeListener = this.buildListBoxDisposeListener();
- this.listBox.addDisposeListener(this.listBoxDisposeListener);
-
- this.synchronizeListBox();
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListBoxModelAdapter.this.listItemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListBoxModelAdapter.this.listItemsRemoved(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListBoxModelAdapter.this.listItemsMoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListBoxModelAdapter.this.listItemsReplaced(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListBoxModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListBoxModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
- protected CollectionChangeListener buildSelectedItemsChangeListener() {
- return new SWTCollectionChangeListenerWrapper(this.buildSelectedItemsChangeListener_());
- }
-
- protected CollectionChangeListener buildSelectedItemsChangeListener_() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- ListBoxModelAdapter.this.selectedItemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- ListBoxModelAdapter.this.selectedItemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- ListBoxModelAdapter.this.selectedItemsCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ListBoxModelAdapter.this.selectedItemsChanged(event);
- }
- @Override
- public String toString() {
- return "selected items listener";
- }
- };
- }
-
- protected SelectionListener buildListBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- ListBoxModelAdapter.this.listBoxSelectionChanged(event);
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- ListBoxModelAdapter.this.listBoxDoubleClicked(event);
- }
- @Override
- public String toString() {
- return "list box selection listener";
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected DoubleClickListener<E>[] buildDoubleClickListeners() {
- return new DoubleClickListener[0];
- }
-
- @SuppressWarnings("unchecked")
- protected SelectionChangeListener<E>[] buildSelectionChangeListeners() {
- return new SelectionChangeListener[0];
- }
-
- protected DisposeListener buildListBoxDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- ListBoxModelAdapter.this.listBoxDisposed(event);
- }
- @Override
- public String toString() {
- return "list box dispose listener";
- }
- };
- }
-
- protected void synchronizeListBox() {
- this.synchronizeListBoxItems();
- this.synchronizeListBoxSelection();
- }
-
-
- // ********** string converter **********
-
- public void setStringConverter(StringConverter<E> stringConverter) {
- if (stringConverter == null) {
- throw new NullPointerException();
- }
- this.stringConverter = stringConverter;
- this.synchronizeListBox();
- }
-
-
- // ********** list **********
-
- /**
- * Use the string converter to convert the specified item to a
- * string that can be added to the list box.
- */
- protected String convert(E item) {
- return this.stringConverter.convertToString(item);
- }
-
- /**
- * Brute force synchronization of list box with the model list.
- */
- protected void synchronizeListBoxItems() {
- if (this.listBox.isDisposed()) {
- return;
- }
- int len = this.listHolder.size();
- String[] items = new String[len];
- for (int i = 0; i < len; i++) {
- items[i] = this.convert(this.listHolder.get(i));
- }
- this.listBox.setItems(items);
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listItemsAdded(ListChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- int i = event.index();
- for (ListIterator<E> stream = this.items(event); stream.hasNext(); ) {
- this.listBox.add(this.convert(stream.next()), i++);
- }
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listItemsRemoved(ListChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- this.listBox.remove(event.index(), event.index() + event.itemsSize() - 1);
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listItemsMoved(ListChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- int target = event.targetIndex();
- int source = event.sourceIndex();
- int len = event.moveLength();
- int loStart = Math.min(target, source);
- int hiStart = Math.max(target, source);
- // make a copy of the affected items...
- String[] subArray = CollectionTools.subArray(this.listBox.getItems(), loStart, hiStart + len - loStart);
- // ...move them around...
- subArray = CollectionTools.move(subArray, target - loStart, source - loStart, len);
- // ...and then put them back
- for (int i = 0; i < subArray.length; i++) {
- this.listBox.setItem(loStart + i, subArray[i]);
- }
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listItemsReplaced(ListChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- int i = event.index();
- for (ListIterator<E> stream = this.items(event); stream.hasNext(); ) {
- this.listBox.setItem(i++, this.convert(stream.next()));
- }
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listCleared(ListChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- this.listBox.removeAll();
- }
-
- /**
- * The model has changed - synchronize the list box.
- */
- protected void listChanged(ListChangeEvent event) {
- this.synchronizeListBoxItems();
- }
-
- // minimized unchecked code
- @SuppressWarnings("unchecked")
- protected ListIterator<E> items(ListChangeEvent event) {
- return ((ListIterator<E>) event.items());
- }
-
-
- // ********** selected items **********
-
- protected int indexOf(E item) {
- int len = this.listHolder.size();
- for (int i = 0; i < len; i++) {
- if (this.listHolder.get(i) == item) {
- return i;
- }
- }
- return -1;
- }
-
- protected void synchronizeListBoxSelection() {
- if (this.listBox.isDisposed()) {
- return;
- }
- int[] indices = new int[this.selectedItemsHolder.size()];
- int i = 0;
- for (Iterator<E> stream = this.selectedItemsHolder.iterator(); stream.hasNext(); ) {
- indices[i++] = this.indexOf(stream.next());
- }
- this.listBox.deselectAll();
- this.listBox.select(indices);
- }
-
- protected void selectedItemsAdded(CollectionChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- int[] indices = new int[event.itemsSize()];
- int i = 0;
- for (Iterator<E> stream = this.items(event); stream.hasNext(); ) {
- indices[i++] = this.indexOf(stream.next());
- }
- this.listBox.select(indices);
- }
-
- protected void selectedItemsRemoved(CollectionChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- int[] indices = new int[event.itemsSize()];
- int i = 0;
- for (Iterator<E> stream = this.items(event); stream.hasNext(); ) {
- indices[i++] = this.indexOf(stream.next());
- }
- this.listBox.deselect(indices);
- }
-
- protected void selectedItemsCleared(CollectionChangeEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- this.listBox.deselectAll();
- }
-
- protected void selectedItemsChanged(CollectionChangeEvent event) {
- this.synchronizeListBoxSelection();
- }
-
- // minimized unchecked code
- @SuppressWarnings("unchecked")
- protected Iterator<E> items(CollectionChangeEvent event) {
- return ((Iterator<E>) event.items());
- }
-
-
- // ********** list box events **********
-
- protected void listBoxSelectionChanged(SelectionEvent event) {
- if (this.selectionChangeListeners.length > 0) {
- @SuppressWarnings("unchecked")
- SelectionChangeEvent<E> scEvent = new SelectionChangeEvent(this, this.selectedItems());
- for (SelectionChangeListener<E> selectionChangeListener : this.selectionChangeListeners) {
- selectionChangeListener.selectionChanged(scEvent);
- }
- }
- }
-
- protected Collection<E> selectedItems() {
- if (this.listBox.isDisposed()) {
- return Collections.emptySet();
- }
- @SuppressWarnings("unchecked")
- ArrayList<E> selectedItems = new ArrayList(this.listBox.getSelectionCount());
- for (int selectionIndex : this.listBox.getSelectionIndices()) {
- selectedItems.add(this.listHolder.get(selectionIndex));
- }
- return selectedItems;
- }
-
- protected void listBoxDoubleClicked(SelectionEvent event) {
- if (this.listBox.isDisposed()) {
- return;
- }
- if (this.doubleClickListeners.length > 0) {
- // there should be only a single item selected during a double-click(?)
- E selection = this.listHolder.get(this.listBox.getSelectionIndex());
- @SuppressWarnings("unchecked")
- DoubleClickEvent<E> dcEvent = new DoubleClickEvent(this, selection);
- for (DoubleClickListener<E> doubleClickListener : this.doubleClickListeners) {
- doubleClickListener.doubleClick(dcEvent);
- }
- }
- }
-
-
- // ********** dispose **********
-
- protected void listBoxDisposed(DisposeEvent event) {
- // the list box is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.listBox.removeDisposeListener(this.listBoxDisposeListener);
- this.listBox.removeSelectionListener(this.listBoxSelectionListener);
- this.selectedItemsHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.selectedItemsChangeListener);
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-
- // ********** double click support **********
-
- public void addDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListeners = CollectionTools.add(this.doubleClickListeners, listener);
- }
-
- public void removeDoubleClickListener(DoubleClickListener<E> listener) {
- this.doubleClickListeners = CollectionTools.remove(this.doubleClickListeners, listener);
- }
-
- public interface DoubleClickListener<E> {
- void doubleClick(DoubleClickEvent<E> event);
- }
-
- public static class DoubleClickEvent<E> extends EventObject {
- private final E selection;
- private static final long serialVersionUID = 1L;
-
- protected DoubleClickEvent(ListBoxModelAdapter<E> source, E selection) {
- super(source);
- if (selection == null) {
- throw new NullPointerException();
- }
- this.selection = selection;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public ListBoxModelAdapter<E> getSource() {
- return (ListBoxModelAdapter<E>) super.getSource();
- }
-
- public E selection() {
- return this.selection;
- }
-
- }
-
-
- // ********** selection support **********
-
- public void addSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListeners = CollectionTools.add(this.selectionChangeListeners, listener);
- }
-
- public void removeSelectionChangeListener(SelectionChangeListener<E> listener) {
- this.selectionChangeListeners = CollectionTools.remove(this.selectionChangeListeners, listener);
- }
-
- public interface SelectionChangeListener<E> {
- void selectionChanged(SelectionChangeEvent<E> event);
- }
-
- public static class SelectionChangeEvent<E> extends EventObject {
- private final Collection<E> selection;
- private static final long serialVersionUID = 1L;
-
- protected SelectionChangeEvent(ListBoxModelAdapter<E> source, Collection<E> selection) {
- super(source);
- if (selection == null) {
- throw new NullPointerException();
- }
- this.selection = selection;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public ListBoxModelAdapter<E> getSource() {
- return (ListBoxModelAdapter<E>) super.getSource();
- }
-
- public Iterator<E> selection() {
- return this.selection.iterator();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TextFieldModelAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TextFieldModelAdapter.java
deleted file mode 100644
index ac7aa998f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TextFieldModelAdapter.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.swt;
-
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Text;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class TextFieldModelAdapter {
-
- /**
- * A value model on the underlying model list.
- */
- protected final WritablePropertyValueModel<String> textHolder;
-
- /**
- * A listener that allows us to synchronize the text field's contents with
- * the model list.
- */
- protected final PropertyChangeListener propertyChangeListener;
-
- /**
- * The text field we keep synchronized with the model string.
- */
- protected final Text textField;
-
- /**
- * A listener that allows us to synchronize our selection list holder
- * with the list box's selection.
- */
- protected final ModifyListener textFieldModifyListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the list box
- * is disposed.
- */
- protected final DisposeListener textFieldDisposeListener;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified model list and selections to the specified list box.
- * Use the specified string converter to convert the model items to strings
- * to be displayed in the list box.
- */
- public static TextFieldModelAdapter adapt(
- WritablePropertyValueModel<String> textHolder,
- Text textField)
- {
- return new TextFieldModelAdapter(textHolder, textField);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder, selections holder, list box, and
- * string converter are required.
- */
- protected TextFieldModelAdapter(WritablePropertyValueModel<String> textHolder, Text textField) {
- super();
- if ((textHolder == null) || (textField == null)) {
- throw new NullPointerException();
- }
- this.textHolder = textHolder;
- this.textField = textField;
-
- this.propertyChangeListener = this.buildPropertyChangeListener();
- this.textHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
-
- this.textFieldModifyListener = this.buildTextFieldModifyListener();
- this.textField.addModifyListener(this.textFieldModifyListener);
-
- this.textFieldDisposeListener = this.buildTextFieldDisposeListener();
- this.textField.addDisposeListener(this.textFieldDisposeListener);
-
- String text = textHolder.value();
- this.textField.setText((text == null) ? "" : text);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildPropertyChangeListener_());
- }
-
- protected PropertyChangeListener buildPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TextFieldModelAdapter.this.textChanged(event);
- }
- @Override
- public String toString() {
- return "text listener";
- }
- };
- }
-
- protected ModifyListener buildTextFieldModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- TextFieldModelAdapter.this.textFieldModified(event);
- }
- @Override
- public String toString() {
- return "text field modify listener";
- }
- };
- }
-
- protected DisposeListener buildTextFieldDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TextFieldModelAdapter.this.textFieldDisposed(event);
- }
- @Override
- public String toString() {
- return "text field dispose listener";
- }
- };
- }
-
-
- // ********** model events **********
-
- protected void textChanged(PropertyChangeEvent event) {
- String text = (String) event.newValue();
- // the model can be null, but the text field cannot
- if (text == null) {
- text = "";
- }
- if ( ! text.equals(this.textField.getText())) { // ???
- this.textField.setText(text);
- }
- }
-
-
- // ********** text field events **********
-
- protected void textFieldModified(ModifyEvent event) {
- this.textHolder.setValue(this.textField.getText());
- }
-
- protected void textFieldDisposed(DisposeEvent event) {
- // the text field is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.textField.removeDisposeListener(this.textFieldDisposeListener);
- this.textField.removeModifyListener(this.textFieldModifyListener);
- this.textHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.textHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TriStateCheckBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TriStateCheckBoxModelAdapter.java
deleted file mode 100644
index 6f7486fb03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/swt/TriStateCheckBoxModelAdapter.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.swt;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * This adapter can be used to keep a tri-state check box in synch with
- * a model Boolean where the value can be <code>null</code>.
- */
-@SuppressWarnings("nls")
-public class TriStateCheckBoxModelAdapter {
-
- /** A value model on the underlying model boolean. */
- protected final WritablePropertyValueModel<Boolean> booleanHolder;
-
- /**
- * A listener that allows us to synchronize the button's selection state with
- * the model boolean.
- */
- protected final PropertyChangeListener booleanChangeListener;
-
- /** The check box/toggle button we synchronize with the model boolean. */
- protected final TriStateCheckBox button;
-
- /**
- * A listener that allows us to synchronize the model boolean with
- * the button's selection state.
- */
- protected final SelectionListener buttonSelectionListener;
-
- /**
- * A listener that allows us to stop listening to stuff when the button
- * is disposed.
- */
- protected final DisposeListener buttonDisposeListener;
-
-
- // ********** static methods **********
-
- /**
- * Adapt the specified boolean to the specified button.
- * If the boolean is null, the button's value will be "partially checked"
- * (i.e. the button will be checked but grayed out).
- */
- public static TriStateCheckBoxModelAdapter adapt(WritablePropertyValueModel<Boolean> booleanHolder, TriStateCheckBox button) {
- return new TriStateCheckBoxModelAdapter(booleanHolder, button);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder and button are required.
- */
- protected TriStateCheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, TriStateCheckBox button) {
- super();
-
- Assert.isNotNull(booleanHolder, "The boolean holder cannot be null");
- Assert.isNotNull(button, "The check box cannot be null");
-
- this.booleanHolder = booleanHolder;
- this.button = button;
-
- this.booleanChangeListener = this.buildBooleanChangeListener();
- this.booleanHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
-
- this.buttonDisposeListener = this.buildButtonDisposeListener();
- this.button.addDisposeListener(this.buttonDisposeListener);
-
- this.buttonSelectionListener = this.buildButtonSelectionListener();
- this.button.addSelectionListener(this.buttonSelectionListener);
-
- this.setButtonSelection(this.booleanHolder.value());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- protected PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TriStateCheckBoxModelAdapter.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "tri-state boolean listener";
- }
- };
- }
-
- protected SelectionListener buildButtonSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- TriStateCheckBoxModelAdapter.this.buttonSelected(event);
- }
- @Override
- public String toString() {
- return "tri-state button selection listener";
- }
- };
- }
-
- protected DisposeListener buildButtonDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TriStateCheckBoxModelAdapter.this.buttonDisposed(event);
- }
- @Override
- public String toString() {
- return "tri-state button dispose listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * The model has changed - synchronize the button.
- * If the new model value is null, use the adapter's default value
- * (which is typically false).
- */
- protected void booleanChanged(PropertyChangeEvent event) {
- this.setButtonSelection((Boolean) event.newValue());
- }
-
- protected void setButtonSelection(Boolean selection) {
- if (this.button.isDisposed()) {
- return;
- }
- this.button.setSelection(selection);
- }
-
- /**
- * The button has been "selected" - synchronize the model.
- */
- protected void buttonSelected(SelectionEvent event) {
- if (this.button.isDisposed()) {
- return;
- }
- this.booleanHolder.setValue(button.getSelection());
- }
-
-
- // ********** dispose **********
-
- protected void buttonDisposed(DisposeEvent event) {
- // the button is not yet "disposed" when we receive this event
- // so we can still remove our listeners
- this.button.removeSelectionListener(this.buttonSelectionListener);
- this.button.removeDisposeListener(this.buttonDisposeListener);
- this.booleanHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlAligner.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlAligner.java
deleted file mode 100644
index 6a1bf82d98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlAligner.java
+++ /dev/null
@@ -1,850 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * This class is responsible to set a preferred width on the registered widgets
- * (either <code>Control</code> or <code>ControlAligner</code>) based on the
- * widest widget.
- * <p>
- * Important: The layout data has to be a <code>GridData</code>. If none is set,
- * then a new <code>GridData</code> is automatically created.
- * <p>
- * Here an example of the result if this aligner is used to align controls
- * within either one or two group boxes, the controls added are the labels in
- * this case. It is also possible to align controls on the right side of the
- * main component, a spacer can be used for extra space.
- * <p>
- * Here's an example:
- * <pre>
- * - Group Box 1 ---------------------------------------------------------------
- * | -------------------------------------- -------------- |
- * | Name: | I | | Browsse... | |
- * | -------------------------------------- -------------- |
- * | --------- |
- * | Preallocation Size: | |I| |
- * | --------- |
- * | -------------------------------------- |
- * | Descriptor: | |v| |
- * | -------------------------------------- |
- * -----------------------------------------------------------------------------
- *
- * - Group Box 2 ---------------------------------------------------------------
- * | -------------------------------------- |
- * | Mapping Type: | |V| |
- * | -------------------------------------- |
- * | -------------------------------------- |
- * | Check in Script: | I | |
- * | -------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class ControlAligner
-{
- /**
- * Flag used to prevent a validation so it can be done after an operation
- * completed.
- */
- private boolean autoValidate;
-
- /**
- * The utility class used to support bound properties.
- */
- private Collection<Listener> changeSupport;
-
- /**
- * The listener added to each of the controls that listens only to a text
- * change.
- */
- private Listener listener;
-
- /**
- * Prevents infinite recursion when recalculating the preferred width.
- * This happens in an hierarchy of <code>ControlAligner</code>s. The lock
- * has to be placed here and not in the {@link ControlAlignerWrapper}.
- */
- private boolean locked;
-
- /**
- * The length of the widest control. If the length was not calculated, then
- * this value is -1.
- */
- private int maximumWidth;
-
- /**
- * The collection of {@link Wrapper}s encapsulating either <code>Control</code>s
- * or {@link ControlAligner}s.
- */
- private Collection<Wrapper> wrappers;
-
- /**
- * A null-<code>Point</code> object used to clear the preferred size.
- */
- private static final Point DEFAULT_SIZE = new Point(SWT.DEFAULT, SWT.DEFAULT);
-
- /**
- * The types of events to listen in order to properly adjust the size of all
- * the widgets.
- */
- private static final int[] EVENT_TYPES = {
- SWT.Dispose,
- SWT.Hide,
- SWT.Resize,
- SWT.Show
- };
-
- /**
- * Creates a new <code>ControlAligner</code>.
- */
- public ControlAligner() {
- super();
- initialize();
- }
-
- /**
- * Creates a new <code>ControlAligner</code>.
- *
- * @param controls The collection of <code>Control</code>s
- */
- public ControlAligner(Collection<? extends Control> controls) {
- this();
- addAllControls(controls);
- }
-
- /**
- * Adds the given control. Its width will be used along with the width of all
- * the other registered controls in order to get the greater witdh and use
- * it as the width for all the controls.
- *
- * @param control The <code>Control</code> to be added
- */
- public void add(Control control) {
-
- Assert.isNotNull(control, "Can't add null to this ControlAligner");
-
- Wrapper wrapper = buildWrapper(control);
- wrapper.addListener(listener);
- wrappers.add(wrapper);
-
- revalidate();
- }
-
- /**
- * Adds the given control. Its width will be used along with the width of all
- * the other registered controls in order to get the greater witdh and use
- * it as the width for all the controls.
- *
- * @param controlAligner The <code>ControlAligner</code> to be added
- * @exception IllegalArgumentException Can't add the <code>ControlAligner</code>
- * to itself
- */
- public void add(ControlAligner controlAligner) {
-
- Assert.isNotNull(controlAligner, "Can't add null to this ControlAligner");
- Assert.isLegal(controlAligner != this, "Can't add the ControlAligner to itself");
-
- Wrapper wrapper = buildWrapper(controlAligner);
- wrapper.addListener(listener);
- wrappers.add(wrapper);
-
- if (!controlAligner.wrappers.isEmpty()) {
- revalidate();
- }
- }
-
- /**
- * Adds the items contained in the given collection into this
- * <code>ControlAligner</code>. The preferred width of each item will be
- * used along with the width of all the other items in order to get the
- * widest control and use its width as the width for all the controls.
- *
- * @param aligners The collection of <code>ControlAligner</code>s
- */
- public void addAllControlAligners(Collection<ControlAligner> aligners) {
-
- // Deactivate the auto validation while adding all the Controls and/or
- // ControlAligners in order to improve performance
- boolean oldAutoValidate = autoValidate;
- autoValidate = false;
-
- for (ControlAligner aligner : aligners) {
- add(aligner);
- }
-
- autoValidate = oldAutoValidate;
- revalidate();
- }
-
- /**
- * Adds the items contained in the given collection into this
- * <code>ControlAligner</code>. The preferred width of each item will be
- * used along with the width of all the other items in order to get the
- * widest control and use its width as the width for all the controls.
- *
- * @param controls The collection of <code>Control</code>s
- */
- public void addAllControls(Collection<? extends Control> controls) {
-
- // Deactivate the auto validation while adding all the Controls and/or
- // ControlAligners in order to improve performance
- boolean oldAutoValidate = autoValidate;
- autoValidate = false;
-
- for (Control control : controls) {
- add(control);
- }
-
- autoValidate = oldAutoValidate;
- revalidate();
- }
-
- /**
- * Adds the given <code>ControListener</code>.
- *
- * @param listener The <code>Listener</code> to be added
- */
- private void addListener(Listener listener) {
-
- if (changeSupport == null) {
- changeSupport = new ArrayList<Listener>();
- }
-
- changeSupport.add(listener);
- }
-
- /**
- * Creates a new <code>Wrapper</code> that encapsulates the given source.
- *
- * @param control The control to be wrapped
- * @return A new {@link Wrapper}
- */
- private Wrapper buildWrapper(Control control) {
- return new ControlWrapper(control);
- }
-
- /**
- * Creates a new <code>Wrapper</code> that encapsulates the given source.
- *
- * @param ControlAligner The <code>ControlAligner</code> to be wrapped
- * @return A new {@link ControlAlignerWrapper}
- */
- private Wrapper buildWrapper(ControlAligner ControlAligner) {
- return new ControlAlignerWrapper(ControlAligner);
- }
-
- /**
- * Reports a bound property change.
- *
- * @param oldValue the old value of the property (as an int)
- * @param newValue the new value of the property (as an int)
- */
- private void controlResized(int oldValue, int newValue) {
-
- if ((changeSupport != null) && (oldValue != newValue)) {
- Event event = new Event();
- event.widget = SWTUtil.getShell();
- event.data = this;
-
- for (Listener listener : changeSupport) {
- listener.handleEvent(event);
- }
- }
- }
-
- /**
- * Returns the length of the widest control. If the length was not
- * calculated, then this value is -1.
- *
- * @return The width of the widest control or -1 if the length has not
- * been calculated yet
- */
- public int getMaximumWidth() {
- return maximumWidth;
- }
-
- /**
- * Initializes this <code>ControlAligner</code>.
- */
- private void initialize() {
-
- this.autoValidate = true;
- this.maximumWidth = -1;
- this.listener = new ListenerHandler();
- this.wrappers = new ArrayList<Wrapper>();
- }
-
- /**
- * Invalidates the size of the given object.
- *
- * @param source The source object to be invalidated
- */
- private void invalidate(Object source) {
-
- Wrapper wrapper = retrieveWrapper(source);
-
- if (!wrapper.isLocked()) {
- Point size = wrapper.cachedSize();
- size.x = size.y = 0;
- wrapper.setSize(DEFAULT_SIZE);
- }
- }
-
- /**
- * Updates the maximum length based on the widest control. This methods
- * does not update the width of the controls.
- */
- private void recalculateWidth() {
-
- int width = -1;
-
- for (Wrapper wrapper : wrappers) {
- Point size = wrapper.cachedSize();
-
- // The size has not been calculated yet
- if (size.y == 0) {
- size = wrapper.size();
- }
-
- // Only keep the greatest width
- width = Math.max(size.x, width);
- }
-
- locked = true;
-
- try {
- setMaximumWidth(width);
- }
- finally {
- locked = false;
- }
- }
-
- /**
- * Removes the given control. Its preferred width will not be used when
- * calculating the preferred width.
- *
- * @param control The control to be removed
- * @exception AssertionFailedException If the given <code>Control</code> is
- * <code>null</code>
- */
- public void remove(Control control) {
-
- Assert.isNotNull(control, "The Control to remove cannot be null");
-
- Wrapper wrapper = retrieveWrapper(control);
- wrapper.removeListener(listener);
- wrappers.remove(wrapper);
-
- revalidate();
- }
-
- /**
- * Removes the given <code>ControlAligner</code>. Its preferred width
- * will not be used when calculating the preferred witdh.
- *
- * @param controlAligner The <code>ControlAligner</code> to be removed
- * @exception AssertionFailedException If the given <code>ControlAligner</code>
- * is <code>null</code>
- */
- public void remove(ControlAligner controlAligner) {
-
- Assert.isNotNull(controlAligner, "The ControlAligner to remove cannot be null");
-
- Wrapper wrapper = retrieveWrapper(controlAligner);
- wrapper.removeListener(listener);
- wrappers.remove(wrapper);
-
- revalidate();
- }
-
- /**
- * Removes the given <code>Listener</code>.
- *
- * @param listener The <code>Listener</code> to be removed
- */
- private void removeListener(Listener listener) {
-
- changeSupport.remove(listener);
-
- if (changeSupport.isEmpty()) {
- changeSupport = null;
- }
- }
-
- /**
- * Retrieves the <code>Wrapper</code> that is encapsulating the given object.
- *
- * @param source Either a <code>Control</code> or a <code>ControlAligner</code>
- * @return Its <code>Wrapper</code>
- */
- private Wrapper retrieveWrapper(Object source) {
-
- for (Wrapper wrapper : wrappers) {
- if (wrapper.source() == source) {
- return wrapper;
- }
- }
-
- throw new IllegalArgumentException("Can't retrieve the Wrapper for " + source);
- }
-
- /**
- * If the count of control is greater than one and {@link #isAutoValidate()}
- * returns <code>true</code>, then the size of all the registered
- * <code>Control</code>s will be udpated.
- */
- private void revalidate() {
-
- if (autoValidate) {
- recalculateWidth();
- revalidateImp();
- }
- }
-
- /**
- * Bases on the information contained in the given <code>Event</code>,
- * resize the controls.
- *
- * @param event The <code>Event</code> sent by the UI thread when the state
- * of a widget changed
- */
- private void revalidate(Event event) {
-
- // We don't need to revalidate during a revalidation process
- if (locked) {
- return;
- }
-
- Object source;
-
- if (event.widget != SWTUtil.getShell()) {
- source = event.widget;
- Control control = (Control) source;
-
- // When a dialog is opened, we need to actually force a layout of
- // the controls, this is required because the control is actually
- // not visible when the preferred width is caculated
- if (control == control.getShell()) {
- if (event.type == SWT.Dispose) {
- return;
- }
-
- source = null;
- }
- }
- else {
- source = event.data;
- }
-
- // Either remove the ControlWrapper if the widget was disposed or
- // invalidate the widget in order to recalculate the preferred size
- if (source != null) {
- if (event.type == SWT.Dispose) {
- Wrapper wrapper = retrieveWrapper(source);
- wrappers.remove(wrapper);
- }
- else {
- invalidate(source);
- }
- }
-
- // Now revalidate all the Controls and ControlAligners
- revalidate();
- }
-
- /**
- * Updates the size of every control based on the maximum width.
- */
- private void revalidateImp() {
-
- for (Wrapper wrapper : wrappers) {
- Point size = wrapper.cachedSize();
- size = new Point(maximumWidth, size.y);
- wrapper.setSize(size);
- }
- }
-
- /**
- * Sets the length of the widest control. If the length was not calulcated,
- * then this value is -1.
- *
- * @param maximumWidth The width of the widest control
- */
- private void setMaximumWidth(int maximumWidth) {
-
- int oldMaximumWidth = getMaximumWidth();
- this.maximumWidth = maximumWidth;
- controlResized(oldMaximumWidth, maximumWidth);
- }
-
- /**
- * Returns the size by determining which control has the greatest
- * width.
- *
- * @return The size of this <code>ControlAligner</code>, which is
- * {@link #getMaximumWidth()} for the width
- */
- private Point size() {
-
-// if (maximumWidth == -1) {
-// recalculateWidth();
-// }
-
- return new Point(maximumWidth, 0);
- }
-
- /**
- * Returns a string representation of this <code>ControlAligner</code>.
- *
- * @return Information about this object
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("maximumWidth=");
- sb.append(maximumWidth);
- sb.append(", wrappers=");
- sb.append(wrappers);
- return StringTools.buildToStringFor(this, sb);
- }
-
- /**
- * This <code>Wrapper</code> encapsulates a {@link ControlAligner}.
- */
- private class ControlAlignerWrapper implements Wrapper
- {
- /**
- * The cached size, which is {@link ControlAligner#maximumWidth}.
- */
- private final Point cachedSize;
-
- /**
- * The <code>ControlAligner</code> encapsulated by this
- * <code>Wrapper</code>.
- */
- private final ControlAligner controlAligner;
-
- /**
- * Creates a new <code>ControlAlignerWrapper</code> that encapsulates
- * the given <code>ControlAligner</code>.
- *
- * @param controlAligner The <code>ControlAligner</code> to be
- * encapsulated by this <code>Wrapper</code>
- */
- private ControlAlignerWrapper(ControlAligner controlAligner) {
- super();
-
- this.controlAligner = controlAligner;
- this.cachedSize = new Point(controlAligner.maximumWidth, 0);
- }
-
- /*
- * (non-Javadoc)
- */
- public void addListener(Listener listener) {
- controlAligner.addListener(listener);
- }
-
- /*
- * (non-Javadoc)
- */
- public Point cachedSize() {
- return cachedSize;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean isLocked() {
- return controlAligner.locked;
- }
-
- /*
- * (non-Javadoc)
- */
- public void removeListener(Listener listener) {
- controlAligner.removeListener(listener);
- }
-
- /*
- * (non-Javadoc)
- */
- public void setSize(Point size) {
-
- if (size == DEFAULT_SIZE) {
- controlAligner.maximumWidth = -1;
- }
- else if (controlAligner.maximumWidth != size.x) {
- controlAligner.maximumWidth = size.x;
- controlAligner.revalidateImp();
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Point size() {
- cachedSize.x = controlAligner.maximumWidth;
- return controlAligner.size();
- }
-
- /*
- * (non-Javadoc)
- */
- public Object source() {
- return controlAligner;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("Cached size=");
- sb.append(cachedSize);
- sb.append(", ControlAligner=");
- sb.append(controlAligner);
- return StringTools.buildToStringFor(this, sb);
- }
- }
-
- /**
- * This <code>Wrapper</code> encapsulates a {@link Control}.
- */
- private class ControlWrapper implements Wrapper
- {
- /**
- * The cached size, which is control's size.
- */
- private final Point cachedSize;
-
- /**
- * The control to be encapsulated by this <code>Wrapper</code>.
- */
- private final Control control;
-
- /**
- * Creates a new <code>controlWrapper</code> that encapsulates the given
- * control.
- *
- * @param control The control to be encapsulated by this <code>Wrapper</code>
- */
- private ControlWrapper(Control control) {
- super();
-
- this.control = control;
- this.cachedSize = new Point(0, 0);
- }
-
- /*
- * (non-Javadoc)
- */
- public void addListener(Listener listener) {
-
- for (int eventType : EVENT_TYPES) {
- control.addListener(eventType, listener);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Point cachedSize() {
- return cachedSize;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean isLocked() {
- return false;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean isVisible() {
- return control.isVisible();
- }
-
- /*
- * (non-Javadoc)
- */
- public void removeListener(Listener listener) {
-
- for (int eventType : EVENT_TYPES) {
- control.removeListener(eventType, listener);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setSize(Point size) {
-
- if (control.isDisposed()) {
- return;
- }
-
- // Update the GridData with the new size
- GridData data = (GridData) control.getLayoutData();
-
- if (data == null) {
- data = new GridData();
- data.horizontalAlignment = SWT.FILL;
- control.setLayoutData(data);
- }
-
- data.widthHint = size.x;
- data.heightHint = size.y;
-
- // Force the control to be resized, and tell its parent to layout
- // its widgets
- if (size.x > 0) {
- Rectangle bounds = control.getBounds();
-
- // Only update the control's width if it's
- // different from the current size
- if (bounds.width != size.x) {
- locked = true;
-
- try {
- control.setBounds(bounds.x, bounds.y, size.x, bounds.height);
- control.getParent().layout(true);
- }
- finally
- {
- locked = false;
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public Point size() {
- Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- cachedSize.x = size.x;
- cachedSize.y = size.y;
- return size;
- }
-
- /*
- * (non-Javadoc)
- */
- public Object source() {
- return control;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer();
- sb.append("Cached size=");
- sb.append(cachedSize);
- sb.append(", Control=");
- sb.append(control);
- return StringTools.buildToStringFor(this, sb);
- }
- }
-
- /**
- * The listener added to each of the control that is notified in order to
- * revalidate the preferred size.
- */
- private class ListenerHandler implements Listener
- {
- public void handleEvent(Event event) {
- ControlAligner.this.revalidate(event);
- }
- }
-
- /**
- * This <code>Wrapper</code> helps to encapsulate heterogeneous objects and
- * apply the same behavior on them.
- */
- private interface Wrapper
- {
- /**
- * Adds the given <code>Listener</code> to wrapped object in order to
- * receive notification when its property changed.
- *
- * @param listener The <code>Listener</code> to be added
- */
- void addListener(Listener listener);
-
- /**
- * Returns the cached size of the encapsulated source.
- *
- * @return A non-<code>null</code> <code>Point</code> where the x is the
- * width and the y is the height of the widget
- */
- Point cachedSize();
-
- /**
- * Prevents infinite recursion when recalculating the preferred width.
- * This happens in an hierarchy of <code>ControlAligner</code>s.
- *
- * @return <code>true</code> to prevent this <code>Wrapper</code> from
- * being invalidated; otherwise <code>false</code>
- */
- boolean isLocked();
-
- /**
- * Removes the given <code>Listener</code>.
- *
- * @param listener The <code>Listener</code> to be removed
- */
- void removeListener(Listener listener);
-
- /**
- * Sets the size on the encapsulated source.
- *
- * @param size The new size
- */
- void setSize(Point size);
-
- /**
- * Returns the preferred size of the wrapped source.
- *
- * @return The preferred size
- */
- Point size();
-
- /**
- * Returns the encapsulated object.
- *
- * @return The object that is been wrapped
- */
- Object source();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlEnabler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlEnabler.java
deleted file mode 100644
index 472918aecc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlEnabler.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This <code>ControlEnabler</code> keeps the "enabled" state of a collection of
- * controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class ControlEnabler extends StateController
-{
- /**
- * Creates a new <code>ControlEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "enabled" state is
- * kept in sync with the boolean holder's value
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Control> controls) {
-
- this(booleanHolder, controls, false);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "enabled" state is
- * kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Control> controls,
- boolean defaultValue) {
-
- this(booleanHolder, controls.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param control The control whose "enabled" state is
- * kept in sync with the boolean holder's value
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control control) {
-
- this(booleanHolder, control, false);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "enabled" state is
- * kept in sync with the boolean holder's value
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control... controls) {
-
- this(booleanHolder, CollectionTools.iterator(controls), false);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param control The control whose "enabled" state is
- * kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control control,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(control), false);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "enabled" state is
- * kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control[] controls,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(controls), defaultValue);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls An iterator on the collection of controls whose
- * "enabled" state is kept in sync with the boolean holder's value
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Control> controls) {
-
- this(booleanHolder, controls, false);
- }
-
- /**
- * Creates a new <code>ControlEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls An iterator on the collection of controls whose
- * "enabled" state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Control> controls,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(controls), defaultValue);
- }
-
- private static Collection<IControlHolder> wrap(Iterator<? extends Control> controls) {
- return CollectionTools.collection(new TransformationIterator<Control, IControlHolder>(controls) {
- @Override
- protected IControlHolder transform(Control control) {
- return new ControlHolder(control);
- }
- });
- }
-
- /**
- * This holder holds onto a <code>Control</code> and update its enabled state.
- */
- private static class ControlHolder implements IControlHolder {
-
- private final Control control;
-
- ControlHolder(Control control) {
- super();
- this.control = control;
- }
-
- public void updateState(boolean state) {
- if (!this.control.isDisposed()) {
- this.control.setEnabled(state);
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlSwitcher.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlSwitcher.java
deleted file mode 100644
index eafa8ed14e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlSwitcher.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This controller is responsible to switch the active page based on a value. A
- * <code>Transformer</code> is used to transformed that value into a
- * <code>Control</code>.
- *
- * @version 2.0
- * @since 2.0
- */
-public final class ControlSwitcher
-{
- /**
- * The widget that is used to show the active <code>Control</code>.
- */
- private PageBook pageBook;
-
- /**
- * The <code>Transformer</code> used to transform the value into a
- * <code>Control</code>.
- */
- private Transformer<?, Control> paneTransformer;
-
- /**
- * Creates a new <code>ControlSwitcher</code>.
- *
- * @param switchHolder The holder of the value that will be used to retrieve
- * the right <code>Control</code> when passed to the given transformer
- * @param paneTransformer The <code>Transformer</code> used to transform the value into a
- * <code>Control</code>
- * @param pageBook The <code>Transformer</code> used to transform the value
- * into a <code>Control</code>
- */
- public <T> ControlSwitcher(PropertyValueModel<? extends T> switchHolder,
- Transformer<T, Control> paneTransformer,
- PageBook pageBook)
- {
- super();
- initialize(switchHolder, paneTransformer, pageBook);
- }
-
- private PropertyChangeListener buildPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildPropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- switchPanes(e.newValue());
- }
- };
- }
-
- /**
- * Initializes this <code>ControlSwitcher</code>.
- *
- * @param switchHolder The holder of the value that will be used to retrieve
- * the right <code>Control</code> when passed to the given transformer
- * @param paneTransformer The <code>Transformer</code> used to transform the value into a
- * <code>Control</code>
- * @param pageBook The <code>Transformer</code> used to transform the value
- * into a <code>Control</code>
- */
- private void initialize(PropertyValueModel<?> switchHolder,
- Transformer<?, Control> paneTransformer,
- PageBook pageBook)
- {
- this.pageBook = pageBook;
- this.paneTransformer = paneTransformer;
-
- switchHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildPropertyChangeListener()
- );
-
- switchPanes(switchHolder.value());
- }
-
- /**
- * Switches the active page by transforming the given value into its
- * corresponding pane.
- *
- * @param value The state passed to the transformer in order to retrieve the
- * new pane
- */
- private void switchPanes(Object value) {
-
- if (pageBook.isDisposed()) {
- return;
- }
-
- // Retrieve the Control for the new value
- Control pane = transform(value);
- boolean visible = (pane != null);
-
- // Show the new page
- if (visible) {
- pageBook.showPage(pane);
- }
- else {
- // Note: We can't null due to a bug in PageBook
- pageBook.showPage(new Label(pageBook, SWT.SEPARATOR | SWT.HORIZONTAL));
- }
-
- if (pageBook.isVisible() != visible) {
- pageBook.setVisible(visible);
- }
-
- // Revalidate the parents in order to update the layout
- SWTUtil.reflow(pageBook);
- }
-
- @SuppressWarnings("unchecked")
- private Control transform(Object value) {
- return ((Transformer<Object, Control>) paneTransformer).transform(value);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlVisibilityEnabler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlVisibilityEnabler.java
deleted file mode 100644
index c74ab6a7e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/ControlVisibilityEnabler.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * This <code>ControlVisibilityEnabler</code> keeps the "visible" state of a
- * collection of controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class ControlVisibilityEnabler extends StateController
-{
- /**
- * Creates a new <code>ControlVisibilityEnabler</code> with a default value
- * of <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "visible" state is
- * kept in sync with the boolean holder's value
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Control> controls) {
-
- this(booleanHolder, controls, false);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "visible" state is
- * kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends Control> controls,
- boolean defaultValue) {
-
- this(booleanHolder, controls.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param control The control whose "visible" state is
- * kept in sync with the boolean holder's value
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control control) {
-
- this(booleanHolder, control, false);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "visible" state is
- * kept in sync with the boolean holder's value
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control... controls) {
-
- this(booleanHolder, CollectionTools.iterator(controls), false);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param control The control whose "visible" state is kept in sync with the
- * boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control control,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(control), false);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls The collection of controls whose "visible" state is kept
- * in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Control[] controls,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(controls), defaultValue);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code> with a default value
- * of <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls An iterator on the collection of controls whose "visible"
- * state is kept in sync with the boolean holder's value
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Control> controls) {
-
- this(booleanHolder, controls, false);
- }
-
- /**
- * Creates a new <code>ControlVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controls An iterator on the collection of controls whose "visible"
- * state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public ControlVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends Control> controls,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(controls), defaultValue);
- }
-
- private static Collection<IControlHolder> wrap(Iterator<? extends Control> controls) {
- return CollectionTools.collection(new TransformationIterator<Control, IControlHolder>(controls) {
- @Override
- protected IControlHolder transform(Control control) {
- return new ControlHolder(control);
- }
- });
- }
-
- /**
- * This holder holds onto a <code>Control</code> and update its visible state.
- */
- private static class ControlHolder implements IControlHolder {
- private final Control control;
-
- ControlHolder(Control control) {
- super();
- this.control = control;
- }
-
- public void updateState(boolean state) {
- if (!this.control.isDisposed()) {
- this.control.setVisible(state);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledButton.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledButton.java
deleted file mode 100644
index 4febb30c35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledButton.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-
-/**
- * A default implementation of <code>LabeledControl</code> that updates a
- * <code>Button</code> when required.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledButton implements LabeledControl
-{
- /**
- * The button to be updated with a different icon and text.
- */
- private final Button button;
-
- /**
- * Creates a new <code>LabeledButton</code>.
- *
- * @param button The button that will have its text and icon updated when
- * required
- * @exception AssertionFailedException If the given <code>Button</code> is
- * <code>null</code>
- */
- public LabeledButton(Button button) {
- super();
-
- Assert.isNotNull(button, "The button cannot be null");
- this.button = button;
- }
-
- /*
- * (non-Javadoc)
- */
- public void setImage(Image image) {
- if (!this.button.isDisposed()) {
- this.button.setImage(image);
- this.button.getParent().layout(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setText(String text) {
- if (!this.button.isDisposed()) {
- this.button.setText(text);
- this.button.getParent().layout(true);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControl.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControl.java
deleted file mode 100644
index 8a9716fa96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This <code>LabeledControl</code> is used to encapsulate a widget and update
- * its properties (icon and text).
- *
- * @see LabeledButton
- * @see LabeledLabel
- *
- * @version 2.0
- * @since 2.0
- */
-public interface LabeledControl {
- /**
- * Passes the image so the wrapped component can receive it.
- *
- * @param image The new <code>Image</code>
- */
- void setImage(Image image);
-
- /**
- * Passes the text so the wrapped component can receive it.
- *
- * @param text The new text
- */
- void setText(String text);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControlUpdater.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControlUpdater.java
deleted file mode 100644
index f058413a76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledControlUpdater.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This updater is responsible to update the <code>LabeledControl</code> when
- * the text and the icon need to change.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledControlUpdater {
-
- /**
- * The wrapper around a control that has text and icon.
- */
- private LabeledControl labeledControl;
-
- /**
- * Creates a new <code>LabeledControlUpdater</code>.
- *
- * @param labeledControl The wrapper around the control that needs to
- * have its text updated
- * @param textHolder The holder this class will listen for changes
- */
- public LabeledControlUpdater(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder)
- {
- this(labeledControl, textHolder, null);
- }
-
- /**
- * Creates a new <code>LabeledControlUpdater</code>.
- *
- * @param labeledControl The wrapper around the control that needs to
- * have its image and text updated
- * @param imageHolder The holder this class will listen for changes or
- * <code>null</code> if the text never changes
- * @param textHolder The holder this class will listen for changes or
- * <code>null</code> if the image never changes
- */
- public LabeledControlUpdater(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder,
- PropertyValueModel<Image> imageHolder)
- {
- super();
- initialize(labeledControl, textHolder, imageHolder);
- }
-
- private PropertyChangeListener buildIconListener() {
- return new SWTPropertyChangeListenerWrapper(buildIconListener_());
- }
-
- private PropertyChangeListener buildIconListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LabeledControlUpdater.this.setImage((Image) e.newValue());
- }
-
- @Override
- public String toString() {
- return "LabeledControlUpdater.imageListener";
- }
- };
- }
-
- private PropertyChangeListener buildTextListener() {
- return new SWTPropertyChangeListenerWrapper(buildTextListener_());
- }
-
- private PropertyChangeListener buildTextListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LabeledControlUpdater.this.setText((String) e.newValue());
- }
-
- @Override
- public String toString() {
- return "LabeledControlUpdater.textListener";
- }
- };
- }
-
- private void initialize(LabeledControl labeledControl,
- PropertyValueModel<String> textHolder,
- PropertyValueModel<Image> imageHolder)
- {
- Assert.isNotNull(labeledControl, "The LabeledControl cannot be null");
-
- this.labeledControl = labeledControl;
-
- if (textHolder != null) {
- textHolder.addPropertyChangeListener(PropertyValueModel.VALUE, buildTextListener());
- setText(textHolder.value());
- }
-
- if (imageHolder != null) {
- imageHolder.addPropertyChangeListener(PropertyValueModel.VALUE, buildIconListener());
- setImage(imageHolder.value());
- }
- }
-
- private void setImage(Image icon) {
- labeledControl.setImage(icon);
- }
-
- private void setText(String text) {
-
- if (text == null) {
- text = "";
- }
-
- labeledControl.setText(text);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledLabel.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledLabel.java
deleted file mode 100644
index ad4030b9a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/LabeledLabel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * A default implementation of <code>LabeledControl</code> that updates an
- * <code>Label</code> when required.
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class LabeledLabel implements LabeledControl
-{
- /**
- * The label to be updated with a different icon and text.
- */
- private final Label label;
-
- /**
- * Creates a new <code>LabeledButton</code>.
- *
- * @param label The label that will have its text and icon updated when
- * required
- * @exception AssertionFailedException If the given <code>Label</code> is
- * <code>null</code>
- */
- public LabeledLabel(Label label) {
- super();
-
- Assert.isNotNull(label, "The label cannot be null");
- this.label = label;
- }
-
- /*
- * (non-Javadoc)
- */
- public void setImage(Image image) {
- if (!this.label.isDisposed()) {
- this.label.setImage(image);
- this.label.getParent().layout(true);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- public void setText(String text) {
- if (!this.label.isDisposed()) {
- this.label.setText(text);
- this.label.getParent().layout(true);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneEnabler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneEnabler.java
deleted file mode 100644
index b183f85aa8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneEnabler.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.ui.internal.widgets.AbstractPane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This <code>PaneEnabler</code> keeps the "enabled" state of a collection of
- * controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class PaneEnabler extends StateController
-{
- /**
- * Creates a new <code>PaneEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "enabled" state is kept in sync with the
- * boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?> pane) {
-
- this(booleanHolder, pane, false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?>... panes) {
-
- this(booleanHolder, CollectionTools.collection(panes), false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "enabled" state is kept in sync with the
- * boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?> pane,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(pane), false);
- }
-
- /**
- * Creates a new <code>PaneEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?>[] panes,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(panes), defaultValue);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code> with a default value
- * of* <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends AbstractPane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "enabled" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends AbstractPane<?>> panes,
- boolean defaultValue) {
-
- this(booleanHolder, panes.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code> with a default value of
- * <code>false</code> (i.e. disabled).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "enabled" state
- * is kept in sync with the boolean holder's value
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends AbstractPane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>BaseJpaControllerEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "enabled" state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends AbstractPane<?>> panes,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(panes), defaultValue);
- }
-
- private static Collection<IControlHolder> wrap(Iterator<? extends AbstractPane<?>> panes) {
- return CollectionTools.collection(new TransformationIterator<AbstractPane<?>, IControlHolder>(panes) {
- @Override
- protected IControlHolder transform(AbstractPane<?> pane) {
- return new PaneHolder(pane);
- }
- });
- }
-
- /**
- * This holder holds onto an <code>AbstractPane</code> and update its enabled
- * state.
- */
- private static class PaneHolder implements IControlHolder {
- private final AbstractPane<?> pane;
-
- PaneHolder(AbstractPane<?> pane) {
- super();
- this.pane = pane;
- }
-
- public void updateState(boolean state) {
- this.pane.enableWidgets(state);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneVisibilityEnabler.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneVisibilityEnabler.java
deleted file mode 100644
index aee7581b62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/PaneVisibilityEnabler.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.ui.internal.widgets.AbstractPane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This <code>PaneVisibilityEnabler</code> keeps the "visible" state of a
- * collection of controls in synch with the provided boolean holder.
- *
- * @version 2.0
- * @since 2.0
- */
-public class PaneVisibilityEnabler extends StateController
-{
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "visible" state is kept in sync with the
- * boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?> pane) {
-
- this(booleanHolder, pane, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?>... panes) {
-
- this(booleanHolder, CollectionTools.collection(panes), false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param pane The pane whose "visible" state is kept in sync with the
- * boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?> pane,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.singletonIterator(pane), false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- AbstractPane<?>[] panes,
- boolean defaultValue) {
-
- this(booleanHolder, CollectionTools.iterator(panes), defaultValue);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends AbstractPane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes The collection of panes whose "visible" state is kept in sync
- * with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Collection<? extends AbstractPane<?>> panes,
- boolean defaultValue) {
-
- this(booleanHolder, panes.iterator(), defaultValue);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code> with a default value of
- * <code>false</code> (i.e. not visible).
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "visible" state
- * is kept in sync with the boolean holder's value
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends AbstractPane<?>> panes) {
-
- this(booleanHolder, panes, false);
- }
-
- /**
- * Creates a new <code>PaneVisibilityEnabler</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param panes An iterator on the collection of panes whose "visible" state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- public PaneVisibilityEnabler(PropertyValueModel<Boolean> booleanHolder,
- Iterator<? extends AbstractPane<?>> panes,
- boolean defaultValue) {
-
- super(booleanHolder, wrap(panes), defaultValue);
- }
-
- private static Collection<IControlHolder> wrap(Iterator<? extends AbstractPane<?>> panes) {
- return CollectionTools.collection(new TransformationIterator<AbstractPane<?>, IControlHolder>(panes) {
- @Override
- protected IControlHolder transform(AbstractPane<?> pane) {
- return new PaneHolder(pane);
- }
- });
- }
-
- /**
- * This holder holds onto an <code>AbstractPane</code> and update its visible
- * state.
- */
- private static class PaneHolder implements IControlHolder {
- private final AbstractPane<?> pane;
-
- PaneHolder(AbstractPane<?> pane) {
- super();
- this.pane = pane;
- }
-
- public void updateState(boolean state) {
- this.pane.setVisible(state);
- }
- }
-}
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 e2b5f4d10e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/SWTUtil.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.ui.internal.widgets.NullPostExecution;
-import org.eclipse.jpt.ui.internal.widgets.PostExecution;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * A suite of utility methods related to the user interface.
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class SWTUtil {
-
- /**
- * Causes the <code>run()</code> method of the given runnable to be invoked
- * by the user-interface thread at the next reasonable opportunity. The caller
- * of this method continues to run in parallel, and is not notified when the
- * runnable has completed.
- *
- * @param runnable Code to run on the user-interface thread
- * @exception org.eclipse.swt.SWTException
- * <ul>
- * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
- * </ul>
- * @see #syncExec
- */
- public static void asyncExec(Runnable runnable) {
- getStandardDisplay().asyncExec(runnable);
- }
-
- /**
- * Creates the <code>Runnable</code> that will invoke the given
- * <code>PostExecution</code> in order to its execution to be done in the
- * UI thread.
- *
- * @param dialog The dialog that was just diposed
- * @param postExecution The post execution once the dialog is disposed
- * @return The <code>Runnable</code> that will invoke
- * {@link PostExecution#execute(Dialog)}
- */
- @SuppressWarnings("unchecked")
- private static <D1 extends Dialog, D2 extends D1>
- Runnable buildPostExecutionRunnable(
- final D1 dialog,
- final PostExecution<D2> postExecution) {
-
- return new Runnable() {
- public void run() {
- setUserInterfaceActive(false);
- try {
- postExecution.execute((D2) dialog);
- }
- finally {
- setUserInterfaceActive(true);
- }
- }
- };
- }
-
- /**
- * Convenience method for getting the current shell. If the current thread is
- * not the UI thread, then an invalid thread access exception will be thrown.
- *
- * @return The shell, never <code>null</code>
- */
- public static Shell getShell() {
-
- // Retrieve the active shell, which can be the shell from any window
- Shell shell = getStandardDisplay().getActiveShell();
-
- // No shell could be found, revert back to the active workbench window
- if (shell == null) {
- shell = getWorkbench().getActiveWorkbenchWindow().getShell();
- }
-
- // Make sure it's never null
- if (shell == null) {
- shell = new Shell(getStandardDisplay().getActiveShell());
- }
-
- return shell;
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if the
- * thread calling this method has an associated display. If so, this display
- * is returned. Otherwise the method returns the default display.
- *
- * @return The current display if not <code>null</code> otherwise the default
- * display is returned
- */
- public static Display getStandardDisplay()
- {
- Display display = Display.getCurrent();
-
- if (display == null) {
- display = Display.getDefault();
- }
-
- return display;
- }
-
- 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;
- }
-
- /**
- * Returns the Platform UI workbench.
- *
- * @return The workbench for this plug-in
- */
- public static IWorkbench getWorkbench() {
- return PlatformUI.getWorkbench();
- }
-
- /**
- * Relays out the parents of the <code>Control</code>. This was taken from
- * the widget <code>Section</code>.
- *
- * @param pane The pane to revalidate as well as its parents
- */
- public static void reflow(Composite pane) {
-
- for (Composite composite = pane; composite != null; ) {
- composite.setRedraw(false);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm) {
- break;
- }
- }
-
- for (Composite composite = pane; composite != null; ) {
- composite.layout(true);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm) {
- ((ScrolledForm) composite).reflow(true);
- break;
- }
- }
-
- for (Composite composite = pane; composite != null; ) {
- composite.setRedraw(true);
- composite = composite.getParent();
-
- if (composite instanceof ScrolledForm) {
- break;
- }
- }
- }
-
- /**
- * Sets whether the entire shell and its widgets should be enabled or
- * everything should be unaccessible.
- *
- * @param active <code>true</code> to make all the UI active otherwise
- * <code>false</code> to deactivate it
- */
- public static void setUserInterfaceActive(boolean active) {
- Shell[] shells = getStandardDisplay().getShells();
-
- for (Shell shell : shells) {
- shell.setEnabled(active);
- }
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- public static <D1 extends Dialog, D2 extends D1>
- void show(final D1 dialog, final PostExecution<D2> postExecution) {
-
- try {
- Assert.isNotNull(dialog, "The dialog cannot be null");
- Assert.isNotNull(postExecution, "The PostExecution cannot be null");
- }
- catch (AssertionFailedException e) {
- // Make sure the UI is interactive
- setUserInterfaceActive(true);
- throw e;
- }
-
- new Thread() {
- @Override
- public void run() {
- asyncExec(
- new Runnable() { public void run() {
- showImp(dialog, postExecution);
- }
- }
- );
- }}.start();
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- */
- public static void show(Dialog dialog) {
- show(dialog, NullPostExecution.<Dialog>instance());
- }
-
- /**
- * Asynchronously launches the specified dialog in the UI thread.
- *
- * @param dialog The dialog to show on screen
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- private static <D1 extends Dialog, D2 extends D1>
- void showImp(D1 dialog, PostExecution<D2> postExecution) {
-
- setUserInterfaceActive(true);
- dialog.open();
-
- if (postExecution != NullPostExecution.<D2>instance()) {
- asyncExec(buildPostExecutionRunnable(dialog, postExecution));
- }
- }
-
- /**
- * Causes the <code>run()</code> method of the given runnable to be invoked
- * by the user-interface thread at the next reasonable opportunity. The
- * thread which calls this method is suspended until the runnable completes.
- *
- * @param runnable code to run on the user-interface thread.
- * @see #asyncExec
- */
- public static void syncExec(Runnable runnable) {
- getStandardDisplay().syncExec(runnable);
- }
-
- /**
- * Determines if the current thread is the UI event thread.
- *
- * @return <code>true</code> if it's the UI event thread, <code>false</code>
- * otherwise
- */
- public static boolean uiThread() {
- return getStandardDisplay().getThread() == Thread.currentThread();
- }
-
- /**
- * Determines if the current thread is the UI event thread by using the
- * thread from which the given viewer's display was instantiated.
- *
- * @param viewer The viewer used to determine if the current thread
- * is the UI event thread
- * @return <code>true</code> if the current thread is the UI event thread;
- * <code>false</code> otherwise
- */
- public static boolean uiThread(Viewer viewer) {
- return uiThread(viewer.getControl());
- }
-
- /**
- * Determines if the current thread is the UI event thread by using the
- * thread from which the given widget's display was instantiated.
- *
- * @param widget The widget used to determine if the current thread
- * is the UI event thread
- * @return <code>true</code> if the current thread is the UI event thread;
- * <code>false</code> otherwise
- */
- public static boolean uiThread(Widget widget) {
- return widget.getDisplay().getThread() == Thread.currentThread();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/StateController.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/StateController.java
deleted file mode 100644
index fa1183fa61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/StateController.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>StateController</code> keeps the state of a collection of widgets in
- * synch with the provided boolean holder.
- *
- * @see ControlEnabler
- * @see ControlVisibilityEnabler
- * @see PaneEnabler
- * @see PaneVisibilityEnabler
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-abstract class StateController
-{
- /**
- * A listener that allows us to synchronize the controlHolders with changes
- * made to the underlying boolean model.
- */
- private PropertyChangeListener booleanChangeListener;
-
- /**
- * A value model on the underlying boolean model
- */
- private PropertyValueModel<Boolean> booleanHolder;
-
- /**
- * The collection of <code>IControlHolder</code>s whose state is kept in sync
- * with the boolean holder's value.
- */
- private Collection<IControlHolder> controlHolders;
-
- /**
- * The default setting for the state; for when the underlying model is
- * <code>null</code>. The default [default value] is <code>false<code>.
- */
- private boolean defaultValue;
-
- /**
- * Creates a new <code>StateController</code>.
- */
- StateController() {
- super();
- initialize();
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>IControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Collection<IControlHolder> controlHolders) {
-
- this(booleanHolder, controlHolders, false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>IControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Collection<IControlHolder> controlHolders,
- boolean defaultValue) {
-
- this();
- initialize(booleanHolder, controlHolders, defaultValue);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolder The <code>IControlHolder</code> whose state is kept
- * in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- IControlHolder controlHolder) {
-
- this(booleanHolder, controlHolder, false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>IControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- IControlHolder... controlHolders) {
-
- this(booleanHolder, CollectionTools.collection(controlHolders), false);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolder The <code>IControlHolder</code> whose state is kept
- * in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- IControlHolder controlHolder,
- boolean defaultValue) {
-
- this(booleanHolder, new IControlHolder[] { controlHolder }, false);
- }
-
- /**
- * Creates a new <code>StateController</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders The collection of <code>IControlHolder</code>s whose
- * state is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- IControlHolder[] controlHolders,
- boolean defaultValue) {
-
- this();
- this.initialize(booleanHolder, CollectionTools.collection(controlHolders), defaultValue);
- }
-
- /**
- * Creates a new <code>StateController</code> with a default value of
- * <code>false</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders An iterator on the collection of
- * <code>IControlHolder</code>s whose state is kept in sync with the boolean
- * holder's value
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Iterator<IControlHolder> controlHolders) {
-
- this(booleanHolder, CollectionTools.collection(controlHolders), false);
- }
-
- /**
- * Creates a new <code>StateController</code>.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders An iterator on the collection of
- * <code>IControlHolder</code>s whose state is kept in sync with the boolean
- * holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- StateController(PropertyValueModel<Boolean> booleanHolder,
- Iterator<IControlHolder> controlHolders,
- boolean defaultValue) {
-
- this();
- initialize(booleanHolder, CollectionTools.collection(controlHolders), defaultValue);
- }
-
- /**
- * Returns the boolean primitive of the given <code>Boolean</code> value but
- * also checks for <code>null</code>, if that is the case, then
- * {@link #defaultValue} is returned.
- *
- * @param value The <code>Boolean</code> value to be returned as a primitive
- * @return The primitive of the given value or {@link #defaultValue}when the
- * value is <code>null</code>
- */
- protected boolean booleanValue(Boolean value) {
- return (value == null) ? this.defaultValue : value;
- }
-
- /**
- * Creates a listener for the boolean holder.
- *
- * @return A new <code>PropertyChangeListener</code>
- */
- private PropertyChangeListener buildBooleanChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildBooleanChangeListener_()
- )
- {
- @Override
- public String toString() {
- return "StateController.SWTPropertyChangeListenerWrapper";
- }
- };
- }
-
- /**
- * Creates a listener for the boolean holder.
- *
- * @return A new <code>PropertyChangeListener</code>
- */
- private PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- updateState(booleanValue(booleanHolder.value()));
- }
-
- @Override
- public String toString() {
- return "StateController.PropertyChangeListener";
- }
- };
- }
-
- /**
- * Returns an <code>Iterator</code> over the collection of
- * <code>IControlHolder</code>s.
- *
- * @return The iteration of <code>IControlHolder</code>s
- */
- protected final Iterator<IControlHolder> controlHolders() {
- return new CloneIterator<IControlHolder>(this.controlHolders);
- }
-
- /**
- * Initializes this <code>StateController</code> by building the appropriate
- * listeners.
- */
- protected void initialize() {
- this.booleanChangeListener = this.buildBooleanChangeListener();
- }
-
- /**
- * Initializes this <code>StateController</code> with the given state.
- *
- * @param booleanHolder A value model on the underlying boolean model
- * @param controlHolders A <code>IControlHolder</code>s whose enablement state
- * is kept in sync with the boolean holder's value
- * @param defaultValue The value to use when the underlying model is
- * <code>null</code>
- */
- protected void initialize(PropertyValueModel<Boolean> booleanHolder,
- Collection<IControlHolder> controlHolders,
- boolean defaultValue) {
-
- Assert.isNotNull(booleanHolder, "The holder of the boolean value cannot be null");
- Assert.isNotNull(controlHolders, "The collection of ControlHolders cannot be null");
-
- this.controlHolders = new ArrayList<IControlHolder>(controlHolders);
- this.defaultValue = defaultValue;
- this.booleanHolder = booleanHolder;
-
- this.booleanHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- this.booleanChangeListener
- );
-
- this.updateState();
- }
-
- /**
- * Updates the state of the control holders.
- */
- protected void updateState() {
- this.updateState(booleanValue(booleanHolder.value()));
- }
-
- /**
- * Updates the state of the <code>Control</code>s.
- *
- * @param state The new state the widgets need to have
- */
- protected void updateState(boolean state) {
- for (IControlHolder controlHolder : this.controlHolders) {
- controlHolder.updateState(state);
- }
- }
-
- /**
- * The holder of the actual widget.
- */
- static interface IControlHolder {
-
- /**
- * Updates the state of the wrapped control.
- *
- * @param state The new state the control should have
- */
- void updateState(boolean state);
- }
-}
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 a037b12bd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/util/TableLayoutComposite.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-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;
-
-/**
- * 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<ColumnLayoutData> columns= new ArrayList<ColumnLayoutData>();
-
- /**
- * Creates a new <code>TableLayoutComposite</code>.
- */
- public TableLayoutComposite(Composite parent, int style) {
- super(parent, style);
- addControlListener(new ControlAdapter() {
- @Override
- 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= 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= 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= 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= 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 8d729c6ca6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/AbstractJpaView.java
+++ /dev/null
@@ -1,156 +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.JpaSelection;
-import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
-import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This is the abstract implementation of the JPA view. The selection is changed
- * by receiving a <code>IJpaSelection</code>.
- *
- * @see JpaSelection
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class AbstractJpaView extends ViewPart
-{
- /**
- * The default page used when nothing can be shown.
- */
- private Composite defaultComposite;
-
- /**
- * The string to display when there is no view content
- */
- private String defaultLabel;
-
- /**
- * The container of the current page.
- */
- private PageBook pageBook;
-
- /**
- *
- */
- private TabbedPropertySheetWidgetFactory widgetFactory;
-
- /**
- * Creates a new <code>AbstractJpaView</code>.
- *
- * @param defaultLabel
- */
- public AbstractJpaView(String defaultLabel) {
- super();
- this.defaultLabel = defaultLabel;
- this.initialize();
- }
-
- private Composite buildDefaultComposite() {
- Composite composite = getWidgetFactory().createComposite(pageBook, SWT.NONE);
- composite.setLayout(new FillLayout(SWT.VERTICAL));
- getWidgetFactory().createLabel(composite, defaultLabel);
- return composite;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public final void createPartControl(Composite parent) {
- pageBook = new PageBook(parent, SWT.NONE);
-
- defaultComposite = buildDefaultComposite();
- pageBook.showPage(defaultComposite);
-
- subcreatePartControl(parent);
-
- JpaSelectionManager selectionManager =
- SelectionManagerFactory.getSelectionManager(getViewSite().getWorkbenchWindow());
-
- selectionManager.register(this);
- select(selectionManager.getCurrentSelection());
- }
-
- protected final PageBook getPageBook() {
- return pageBook;
- }
-
- public final TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return this.widgetFactory;
- }
-
- /**
- * Initializes this JPA view.
- */
- protected void initialize() {
- this.widgetFactory = new TabbedPropertySheetWidgetFactory();
- }
-
- /**
- * The selection has changed, update the current page by using the given
- * selection state.
- *
- * @param jpaSelection The new selection used to update this JPA view
- */
- public abstract void select(JpaSelection jpaSelection);
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void setFocus() {
- pageBook.setFocus();
- }
-
- /**
- * Changes the current page and show the default one.
- */
- protected void showDefaultPage() {
- showPage(defaultComposite);
- }
-
- /**
- * Changes the current page and show the given one.
- *
- * @param page The new page to show, <code>null</code> can't be passed
- */
- protected final void showPage(Control page) {
- pageBook.getParent().setRedraw(false);
- try {
- // It seems the scroll pane has to be installed right before showing
- // the page, if it is installed during the creation of the pane then
- // its layout will not always revalidate correctly, i.e. will not show
- // all the time the vertical scroll bar
- ScrolledForm scrolledForm = widgetFactory.createScrolledForm(pageBook);
- scrolledForm.getBody().setLayout(new GridLayout(1, false));
- page.setParent(scrolledForm.getBody());
-
- pageBook.showPage(scrolledForm);
- }
- finally {
- pageBook.getParent().setRedraw(true);
- }
- }
-
- protected void subcreatePartControl(Composite parent) {
- // no op - for subclasses to override if wished
- }
-} \ No newline at end of file
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 8e225fbb38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/JpaDetailsView.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.ui.internal.views;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.Tracing;
-import org.eclipse.jpt.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.jpt.ui.internal.selection.JpaSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The JPA view that shows the details a mapping (either type or attribute).
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class JpaDetailsView extends AbstractJpaView
-{
- /**
- * The current <code>IJpaDetailsPage</code> that was retrieve based on the
- * current selection.
- */
- private JpaDetailsPage<JpaStructureNode> currentPage;
-
- /**
- * The current selection used to show the right <code>IJpaDetailsPage</code>.
- */
- private JpaSelection currentSelection;
-
- /**
- * key: Object content node id, value: Composite page.
- */
- private Map<Object, JpaDetailsPage<? extends JpaStructureNode>> detailsPages;
-
- /**
- * Creates a new <code>JpaDetailsView</code>.
- */
- public JpaDetailsView() {
- super(JptUiMessages.JpaDetailsView_viewNotAvailable);
- }
-
- private JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(JpaStructureNode structureNode) {
- JpaDetailsProvider detailsProvider = getDetailsProvider(structureNode);
-
- if (detailsProvider == null) {
- return null;
- }
-
- String id = structureNode.getId();
-
- Composite container = getWidgetFactory().createComposite(getPageBook());
- container.setLayout(new FillLayout(SWT.HORIZONTAL));
-
- JpaDetailsPage<? extends JpaStructureNode> page = detailsProvider.buildDetailsPage(
- container,
- id,
- getWidgetFactory()
- );
-
- if (page != null) {
- this.detailsPages.put(id, page);
- }
-
- return page;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void dispose() {
-
- detailsPages.clear();
-
- currentSelection = JpaSelection.NULL_SELECTION;
- currentPage = null;
-
- super.dispose();
- }
-
- private JpaDetailsPage<? extends JpaStructureNode> getDetailsPage(JpaStructureNode structureNode) {
- if (detailsPages.containsKey(structureNode.getId())) {
- JpaDetailsPage page = detailsPages.get(structureNode.getId());
-
- if ((page != null) &&
- (page.getControl().isDisposed())) {
- detailsPages.remove(structureNode.getId());
- }
- else {
- return page;
- }
- }
- return buildDetailsPage(structureNode);
- }
-
- private JpaDetailsProvider getDetailsProvider(JpaStructureNode structureNode) {
-
- String platformId = structureNode.jpaProject().jpaPlatform().getId();
- JpaPlatformUi jpaPlatformUI = JpaPlatformUiRegistry.instance().jpaPlatform(platformId);
- return jpaPlatformUI.detailsProvider(structureNode);
-
- //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.
- }
-
- public JpaSelection getSelection() {
- return currentSelection;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
-
- this.currentSelection = JpaSelection.NULL_SELECTION;
- this.detailsPages = new HashMap<Object, JpaDetailsPage<? extends JpaStructureNode>>();
- }
-
- private void log(String message) {
- if (Tracing.booleanDebugOption(Tracing.UI_DETAILS_VIEW)) {
- Tracing.log(message);
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void select(JpaSelection jpaSelection) {
- if (jpaSelection.equals(currentSelection)) {
- return;
- }
-
- currentSelection = jpaSelection;
-
- if (jpaSelection != JpaSelection.NULL_SELECTION) {
- JpaStructureNode newNode = jpaSelection.getSelectedNode();
- JpaDetailsPage<? extends JpaStructureNode> newPage = getDetailsPage(newNode);
- setCurrentPage(newPage);
- }
- else {
- setCurrentPage(null);
- }
- }
-
- /**
- * Changes the current page and shows the given page.
- *
- * @param newPage The new page to display
- */
- private void setCurrentPage(JpaDetailsPage<? extends JpaStructureNode> page) {
-
- // Unpopulate old page
- if (currentPage != null) {
- try {
- log("JpaDetailsView.setCurrentPage() : disposing of current page");
-
- currentPage.setSubject(null);
- }
- catch (Exception e) {
- JptUiPlugin.log(e);
- }
- }
-
- JpaDetailsPage<JpaStructureNode> newPage = (JpaDetailsPage<JpaStructureNode>) page;
-
- // Populate new page
- if (page != null) {
- try {
- log("JpaDetailsView.setCurrentPage() : populating new page");
- newPage.setSubject(currentSelection.getSelectedNode());
- }
- catch (Exception e) {
- // Show error page
- page = null;
- JptUiPlugin.log(e);
- }
- }
- else {
- log("JpaDetailsView.setCurrentPage() : No page to populate");
- }
-
- currentPage = newPage;
-
- // Show new page
- if (page == null) {
- showDefaultPage();
- }
- else {
- showPage(page.getControl());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructurePage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructurePage.java
deleted file mode 100644
index e37c59bba0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructurePage.java
+++ /dev/null
@@ -1,188 +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.views.structure;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-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.util.SafeRunnable;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.selection.DefaultJpaSelection;
-import org.eclipse.jpt.ui.internal.selection.JpaSelection;
-import org.eclipse.jpt.ui.internal.structure.JpaStructureProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.Page;
-
-public class JpaStructurePage extends Page
- implements ISelectionProvider, ISelectionChangedListener
-{
- private JpaStructureProvider structureProvider;
-
- private ListenerList selectionChangedListeners;
-
- private Composite control;
-
- private TreeViewer viewer;
-
- private JpaStructureView jpaStructureView;
-
- public JpaStructurePage(JpaStructureView jpaStructureView, JpaStructureProvider structureProvider) {
- this.jpaStructureView = jpaStructureView;
- this.structureProvider = structureProvider;
- this.selectionChangedListeners = new ListenerList();
- }
-
- @Override
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.setSelectionProvider(this);
- }
-
- @Override
- public void createControl(Composite parent) {
- control = new Composite(parent, SWT.NULL);
- control.setLayout(new FillLayout());
- viewer = new TreeViewer(control, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setAutoExpandLevel(2);
- DelegatingTreeContentAndLabelProvider contentAndLabelProvider
- = new DelegatingTreeContentAndLabelProvider(
- structureProvider.treeItemContentProviderFactory(),
- structureProvider.itemLabelProviderFactory());
- viewer.setContentProvider(contentAndLabelProvider);
- // TODO Use problem decorator
- viewer.setLabelProvider(contentAndLabelProvider);
- viewer.setInput(structureProvider.getInput());
- viewer.addSelectionChangedListener(this);
- initContextMenu();
- }
-
- @Override
- public void dispose() {
- viewer.removeSelectionChangedListener(this);
- structureProvider.dispose();
- super.dispose();
- }
-
- //TODO this isn't really working. our jpa actions appear, but along with a bunch of other actions!!
- 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);
- this.jpaStructureView.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));
- }
-
- @Override
- public Control getControl() {
- return control;
- }
-
- @Override
- public void setFocus() {
- control.setFocus();
- }
-
-
-
- void select(JpaSelection selection) {
- if (selection.isEmpty()) {
- viewer.setSelection(StructuredSelection.EMPTY);
- }
- else {
- viewer.setSelection(new StructuredSelection(selection.getSelectedNode()), true);
- }
- }
-
-
- // **************** ISelectionProvider impl ********************************
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.add(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.remove(listener);
- }
-
- public JpaSelection getSelection() {
- ITreeSelection viewerSelection = (ITreeSelection) viewer.getSelection();
-
- if (viewerSelection.isEmpty() || viewerSelection.size() > 1) {
- return JpaSelection.NULL_SELECTION;
- }
- return new DefaultJpaSelection((JpaStructureNode) viewerSelection.getFirstElement());
- }
-
- public void setSelection(ISelection selection) {
- if (viewer != null) {
- viewer.setSelection(selection);
- }
- }
-
-
-
- // **************** ISelectionChangedListener impl *************************
-
- public void selectionChanged(SelectionChangedEvent event) {
- fireSelectionChanged(event.getSelection());
- }
-
- protected void fireSelectionChanged(ISelection selection) {
- // create an event
- final SelectionChangedEvent event =
- new SelectionChangedEvent(this, selection);
-
- // fire the event
- Object[] listeners = selectionChangedListeners.getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
- SafeRunner.run(
- new SafeRunnable() {
- public void run() {
- l.selectionChanged(event);
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructureView.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructureView.java
deleted file mode 100644
index 1e0b68c165..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/views/structure/JpaStructureView.java
+++ /dev/null
@@ -1,126 +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.structure;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.selection.JpaSelection;
-import org.eclipse.jpt.ui.internal.selection.JpaSelectionManager;
-import org.eclipse.jpt.ui.internal.selection.SelectionManagerFactory;
-import org.eclipse.jpt.ui.internal.structure.JpaStructureProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-
-public class JpaStructureView extends PageBookView
-{
- public JpaStructureView() {
- super();
- }
-
- @Override
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
-
- JpaSelectionManager selectionManager =
- SelectionManagerFactory.getSelectionManager(getViewSite().getWorkbenchWindow());
-
- selectionManager.register(this);
- select(selectionManager.getCurrentSelection());
- }
-
- @Override
- protected boolean isImportant(IWorkbenchPart part) {
- return part instanceof IEditorPart;
- }
-
- @Override
- protected IWorkbenchPart getBootstrapPart() {
- IWorkbenchPage page = getSite().getPage();
- if (page != null) {
- return page.getActiveEditor();
- }
-
- return null;
- }
-
- @Override
- protected IPage createDefaultPage(PageBook book) {
- MessagePage page = new MessagePage();
- initPage(page);
- page.createControl(book);
- page.setMessage(JptUiMessages.JpaStructureView_structureNotAvailable);
- return page;
- }
-
- @Override
- protected PageRec doCreatePage(IWorkbenchPart part) {
- JpaStructureProvider structureProvider =
- structureProvider(part);
- if (structureProvider != null) {
- JpaStructurePage page = new JpaStructurePage(this, structureProvider);
- initPage(page);
- page.createControl(getPageBook());
- return new PageRec(part, page);
- }
- return null;
- }
-
- private JpaStructureProvider structureProvider(IWorkbenchPart part) {
- JpaFile jpaFile =
- (JpaFile) part.getAdapter(JpaFile.class);
-
- if (jpaFile == null) {
- return null;
- }
-
- JpaPlatformUi platformUi = JptUiPlugin.getPlugin().jpaPlatformUi(jpaFile.jpaProject().jpaPlatform());
- return platformUi.buildStructureProvider(jpaFile);
- }
-
- @Override
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- JpaStructurePage page = (JpaStructurePage) pageRecord.page;
- removeSelectionChangedListener(page);
- page.dispose();
- pageRecord.dispose();
- }
-
- public JpaSelection getSelection() {
- if (getCurrentPage() != getDefaultPage()) {
- return ((JpaStructurePage) getCurrentPage()).getSelection();
- }
- else {
- return JpaSelection.NULL_SELECTION;
- }
- }
-
- public void select(JpaSelection newSelection) {
- // correct page should be shown
- if (getCurrentPage() != getDefaultPage()) {
- ((JpaStructurePage) getCurrentPage()).select(newSelection);
- }
- }
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- getSelectionProvider().addSelectionChangedListener(listener);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- getSelectionProvider().removeSelectionChangedListener(listener);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialog.java
deleted file mode 100644
index 1eb51331ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialog.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-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.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-/**
- * The abstract implementation of a dialog using a "state object" (model object)
- * for behavior.
- * <p>
- * The main pane of this dialog should be extending <code>AbstractDialogPane</code>
- * for creating the right type of widgets and it has the "state object" (subject)
- * behavior built-in.
- *
- * @see Node
- * @see AbstractDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class AbstractDialog<T extends Node> extends TitleAreaDialog
-{
- /**
- * The main content pane of this dialog.
- */
- private AbstractDialogPane<?> pane;
-
- /**
- * The holder of the "state object" used by this dialog.
- */
- private WritablePropertyValueModel<T> subjectHolder;
-
- /**
- * Caches the title text until the dialog is created and the dialog's shell
- * needs to be configured.
- */
- private String title;
-
- /**
- * Creates a new <code>AbstractDialog</code>.
- *
- * @param parent The parent shell
- */
- protected AbstractDialog(Shell parent) {
- this(parent, "");
- }
-
- /**
- * Creates a new <code>AbstractDialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
- */
- protected AbstractDialog(Shell parent, String title) {
- super(parent);
- this.title = title;
- initialize();
- }
-
- /**
- * Initializes the main pane of this dialog. This method is invoked only
- * when the dialog is requested to show on screen and not during
- * initialization.
- *
- * @param container The container to which the widgets should be added to,
- * the layout is already set
- */
- protected abstract AbstractDialogPane<?> buildLayout(Composite container);
-
- /**
- * Creates the state object (model object) that will be used to keep track
- * of the information entered in this dialog. The state object will be stored
- * in the subject holder and can be retrieved using {@link #subject()}.
- *
- * @return A new state object
- */
- protected T buildStateObject() {
- return null;
- }
-
- /**
- * Creates the <code>Validator</code> that will be notified when changes are
- * made to the state object.
- *
- * @return The validator that will be set on the state object
- */
- Node.Validator buildValidator() {
- return Node.NULL_VALIDATOR;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean close() {
-
- // Dispose the pane in order to remove any listeners that could
- // have been installed outside the scrope of the state object
- if (pane != null) {
- pane.dispose();
- pane = null;
- }
-
- return super.close();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(title());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void create() {
- super.create();
- installSubject();
- getButton(OK).setEnabled(false);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Control createContents(Composite parent) {
- if (hasTitleArea()) {
- return super.createContents(parent);
- }
-
- return createDefaultContent(parent);
- }
-
- /**
- * Creates the default main container of this dialog when the title area is
- * not required. The top part is the dialog area populated by the subclass
- * and the lower part is the button pane having the OK and Cancel buttons.
- *
- * @param parent The parent container
- * @return The
- */
- private Composite createDefaultContent(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- applyDialogFont(composite);
- initializeDialogUnits(composite);
- dialogArea = createDialogArea(composite);
- buttonBar = createButtonBar(composite);
-
- return composite;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Composite createDialogArea(Composite parent) {
-
- // If the title area needs to be shown, then leave the superclass to
- // create the necessary widgets
- if (hasTitleArea()) {
- parent = (Composite) super.createDialogArea(parent);
- }
-
- // Create the main area's container
- Composite container = new Composite(parent, SWT.NULL);
- container.setLayout(new GridLayout(1, false));
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- container.setLayoutData(gridData);
-
- // Initialize the content pane
- pane = buildLayout(container);
- pane.populate();
-
- // Initialize the UI part, which requires the widgets being created
- initializeUI();
-
- return parent;
- }
-
- /**
- * Determines whether the description area (where a title, description and
- * image) should be visible or hidden. <code>AbstractValidatingDialog</code>
- * automatically show the description area in order to show problems.
- *
- * @return <code>false</code> by default, which means the methods used to
- * update the title, description and image shouldn't be called; <code>true</code>
- * to make the description pane visible
- */
- protected boolean hasTitleArea() {
- return false;
- }
-
- /**
- * Returns the helps system.
- *
- * @return The platform's help system
- *
- * @category Helper
- */
- protected final IWorkbenchHelpSystem helpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- /**
- * Initializes this dialog.
- */
- protected void initialize() {
- this.subjectHolder = new SimplePropertyValueModel<T>();
- }
-
- /**
- * Initializes the UI part of this dialog, this is called after the widgets
- * have been created.
- */
- protected void initializeUI() {
- }
-
- /**
- * Creates the state object, if one is needed and install a <code>Validator</code>
- * in order to receive notification of changes done to that state object. The
- * subject can be retrieved from the subject holder.
- */
- private void installSubject() {
-
- T subject = buildStateObject();
-
- if (subject != null) {
- subject.setValidator(buildValidator());
- }
-
- subjectHolder.setValue(subject);
- }
-
- /**
- * Asynchronously launches this dialog in the UI thread.
- */
- public final void openDialog() {
- SWTUtil.setUserInterfaceActive(false);
- SWTUtil.show(this);
- }
-
- /**
- * Asynchronously launches this dialog in the UI thread and invoke the given
- * <code>PostExecution</code> to perform any post-task.
- *
- * @param postExecution This interface let the caller to invoke a piece of
- * code once the dialog is disposed
- */
- public final void openDialog(PostExecution<? extends AbstractDialog<T>> execution) {
- SWTUtil.setUserInterfaceActive(false);
- SWTUtil.show(this, execution);
- }
-
- /**
- * Returns the subject of this dialog.
- *
- * @return The subject of this dialog or <code>null</code> if no subject was
- * used
- */
- public T subject() {
- return subjectHolder.value();
- }
-
- /**
- * Returns the holder of the subject.
- *
- * @return The subject holder used to be passed to the dialog pane, which is
- * an instance of <code>AbstractDialogPane</code>
- */
- protected final PropertyValueModel<T> subjectHolder() {
- return subjectHolder;
- }
-
- /**
- * Retrieves the dialog's title. The title passed to the constructor will be
- * returned by default but if it wasn't specified, this method can be used
- * to return it.
- *
- * @return Either the title passed to the constructor or a different title
- */
- protected String title() {
- return title;
- }
-
- /**
- * Determines whether the dialog was cancelled or not.
- *
- * @return <code>true</code> if the dialog was cancelled; <code>false</code>
- * if it was confirmed
- */
- public final boolean wasCancelled() {
- return getReturnCode() == CANCEL;
- }
-
- /**
- * Determines whether the dialog was confirmed or not.
- *
- * @return <code>true</code> if the dialog was confirmed; <code>false</code>
- * if it was cancelled
- */
- public final boolean wasConfirmed() {
- return getReturnCode() == OK;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialogPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialogPane.java
deleted file mode 100644
index 18bf5a5868..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractDialogPane.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The abstract pane to use when the pane is shown in an <code>AbstractDialog</code>.
- *
- * @see AbstractDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractDialogPane<T extends Node> extends AbstractPane<T> {
-
- /**
- * Creates a new <code>AbstractDialog</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractDialogPane(AbstractDialogPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>AbstractDialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractDialogPane(AbstractDialogPane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractDialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractDialogPane(AbstractDialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>AbstractDialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractDialogPane(AbstractDialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractDialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent, DefaultWidgetFactory.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractEnumComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractEnumComboViewer.java
deleted file mode 100644
index 15954281a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractEnumComboViewer.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import java.text.Collator;
-import java.util.Arrays;
-import java.util.Comparator;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelection;
-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.ui.internal.JptUiMessages;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane simply shows a combo where its data is populating through
- * {@link #choices()} and a default value can also be added.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | I |v| |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 1.0
- */
-@SuppressWarnings("nls")
-abstract class AbstractEnumComboViewer<T extends Model, V> extends AbstractPane<T>
-{
- /**
- * The main widget of this pane.
- */
- private ComboViewer comboViewer;
-
- /**
- * A constant used to represent the <code>null</code> value.
- */
- public static final String NULL_VALUE = "null";
-
- /**
- * Creates a new <code>AbstractEnumComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- AbstractEnumComboViewer(AbstractPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>AbstractEnumComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- AbstractEnumComboViewer(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>AbstractEnumComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- AbstractEnumComboViewer(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /**
- * Creates the list of choices and add an extra element that represents the
- * default value.
- *
- * @return The combo's choices including the default value
- */
- private Object[] buildChoices() {
- V[] choices = choices();
- Arrays.sort(choices, buildComparator());
-
- Object[] extendedChoices = new Object[choices.length + 1];
- System.arraycopy(choices, 0, extendedChoices, 1, choices.length);
- extendedChoices[0] = NULL_VALUE;
-
- return extendedChoices;
- }
-
- /**
- * Creates the <code>ComboViewer</code> with the right combo widgets.
- *
- * @param container The container of the combo
- * @return A new <code>ComboViewer</code> containing the right combo widget
- */
- abstract ComboViewer buildComboViewer(Composite container);
-
- private Comparator<Object> buildComparator() {
- return new Comparator<Object>() {
- final LabelProvider labelProvider = buildLabelProvider();
-
- public int compare(Object value1, Object value2) {
- String displayString1 = labelProvider.getText(value1);
- String displayString2 = labelProvider.getText(value2);
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param compositeClass The class used for creating the key, its short class
- * name is the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- protected final String buildDisplayString(Class<?> nlsClass,
- Class<?> compositeClass,
- Object value) {
-
- StringBuilder sb = new StringBuilder();
- sb.append(ClassTools.shortNameFor(compositeClass));
- sb.append("_");
- sb.append(value.toString().toLowerCase());
-
- return (String) ClassTools.staticFieldValue(nlsClass, sb.toString());
- }
-
- /**
- * Retrieves the localized string from the given NLS class by creating the
- * key. That key is the concatenation of the composite's short class name
- * with the toString() of the given value separated by an underscore.
- *
- * @param nlsClass The NLS class used to retrieve the localized text
- * @param composite The object used to retrieve the short class name that is
- * the beginning of the key
- * @param value The value used to append its toString() to the generated key
- * @return The localized text associated with the value
- */
- protected final String buildDisplayString(Class<?> nlsClass,
- Object composite,
- Object value) {
-
- return this.buildDisplayString(nlsClass, composite.getClass(), value);
- }
-
- /**
- * Creates the display string for the given element. If the element is the
- * virtual <code>null</code> value then its display string will be "Default"
- * appended by the actual default value, if it exists.
- *
- * @param value The value to convert into a human readable string
- * @return The string representation of the given element
- */
- @SuppressWarnings("unchecked")
- private String buildDisplayString(Object value) {
- if (value == NULL_VALUE) {
- V defaultValue = (subject() != null) ? defaultValue() : null;
-
- if (defaultValue != null) {
- String displayString = displayString(defaultValue);
- return NLS.bind(JptUiMessages.EnumComboViewer_defaultWithDefault, displayString);
- }
- else {
- return JptUiMessages.EnumComboViewer_default;
- }
- }
-
- return displayString((V) value);
- }
-
- final LabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildDisplayString(element);
- }
- };
- }
-
- private ISelection buildSelection() {
- Object value = (subject() != null) ? getValue() : null;
-
- if (value == null) {
- value = NULL_VALUE;
- }
-
- return new StructuredSelection(value);
- }
-
- private ISelectionChangedListener buildSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent e) {
- if (!isPopulating()) {
- StructuredSelection selection = (StructuredSelection) e.getSelection();
- valueChanged(selection.getFirstElement());
- }
- }
- };
- }
-
- /**
- * Returns the possible choices to show in the viewer.
- *
- * @return The items to show in the combos
- */
- protected abstract V[] choices();
-
- /**
- * Returns the default value, this method is not called if the subject is
- * <code>null</code>.
- *
- * @return The value that is declared as being the default when it is not
- * defined or <code>null</code> if there is no default value
- */
- protected abstract V defaultValue();
-
- /**
- * Returns the displayable string for the given value.
- *
- * @param value The value to translate into a human readable string
- * @return The localized text representing the given value
- */
- protected abstract String displayString(V value);
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.populateCombo();
- }
-
- /**
- * Returns
- *
- * @return
- */
- final ComboViewer getComboViewer() {
- return comboViewer;
- }
-
- /**
- * Retrieves the subject's value. The subject is never <code>null</code>.
- *
- * @return The subject' value, which can be <code>null</code>
- */
- protected abstract V getValue();
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected final void initializeLayout(Composite container) {
-
- this.comboViewer = this.buildComboViewer(container);
- this.comboViewer.addSelectionChangedListener(buildSelectionChangedListener());
- }
-
- /**
- * Populates the combo by re-adding all the items.
- */
- private void populateCombo() {
-
- removeAll();
- comboViewer.add(buildChoices());
- updateSelection();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- this.updateSelection();
- }
-
- /**
- * Removes all the items from the combo.
- */
- abstract void removeAll();
-
- /**
- * Requests the given new value be set on the subject.
- *
- * @param value The new value to be set
- */
- protected abstract void setValue(V value);
-
- /**
- * Updates the cursor, which is required to show the entire selected item
- * within the combo's area.
- */
- abstract void updateCursor();
-
- /**
- * Updates the combo's selected item.
- */
- private void updateSelection() {
- comboViewer.setSelection(buildSelection());
- updateCursor();
- }
-
- /**
- * The selection changes, notify the subclass to set the value.
- *
- * @param value The new selected item
- */
- @SuppressWarnings("unchecked")
- private void valueChanged(Object value) {
-
- // Convert the default "null" value to a real null
- if (value == NULL_VALUE) {
- value = null;
- }
-
- setPopulating(true);
-
- try {
- setValue((V) value);
- }
- finally {
- setPopulating(false);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractFormPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractFormPane.java
deleted file mode 100644
index 7bf05d4d9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractFormPane.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * The abstract pane to use when the pane is shown using the form look and feel,
- * which is handled by <code>TabbedPropertySheetWidgetFactory</code>.
- *
- * @see TabbedPropertySheetWidgetFactory
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractFormPane<T extends Model> extends AbstractPane<T>
-{
- /**
- * Creates a new <code>BaseJpaController</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractFormPane(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>AbstractFormPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractFormPane(AbstractFormPane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractFormPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractFormPane(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>AbstractFormPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent controller;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractFormPane(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractFormPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- *
- * @category Constructor
- */
- protected AbstractFormPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /**
- * Creates a new <code>AbstractFormPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- *
- * @category Constructor
- */
- protected AbstractFormPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory) {
-
- this(subjectHolder, parent, new FormWidgetFactory(widgetFactory));
- }
-
- /**
- * Returns the actual widget factory wrapped by the <code>IWidgetFactory</code>.
- *
- * @return The factory used to create the widgets with the form style
- * (flat-style) look and feel
- */
- protected final TabbedPropertySheetWidgetFactory getFormWidgetFactory() {
- FormWidgetFactory widgetFactory = (FormWidgetFactory) getWidgetFactory();
- return widgetFactory.getWidgetFactory();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractPane.java
deleted file mode 100644
index d41f85020a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractPane.java
+++ /dev/null
@@ -1,2733 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jpt.ui.internal.Tracing;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.swt.BooleanButtonModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * The abstract definition of a pane which holds onto a <code>PropertyValueModel</code>
- * that contains the subject of this pane.
- * <p>
- * It also contains convenience methods for building buttons, labels, check
- * boxes, and radio buttons, etc.
- * <p>
- * It is possible to easily listen to any property changes coming from the
- * subject, {@link #addPropertyNames(Collection)} is specify which properties
- * are of interest and {@link #propertyChanged(String)} is used to notify the
- * pane when the property has changed.
- *
- * @see AbstractFormPane
- * @see AbstractDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class AbstractPane<T extends Model>
-{
- /**
- * The listener registered with the subject in order to be notified when a
- * property has changed, the property names are determined by
- * {@link #propertyNames()}.
- */
- private PropertyChangeListener aspectChangeListener;
-
- /**
- * The container of this composite.
- */
- private Composite container;
-
- /**
- * The aligner responsible to align the left controls.
- */
- private ControlAligner leftControlAligner;
-
- /**
- * Flag used to stop the circular population of widgets.
- */
- private boolean populating;
-
- /**
- * The aligner responsible to align the left controls.
- */
- private ControlAligner rightControlAligner;
-
- /**
- * This listener is registered with the subject holder in order to
- * automatically repopulate this pane with the new subject.
- */
- private PropertyChangeListener subjectChangeListener;
-
- /**
- * The subject of this pane.
- */
- private PropertyValueModel<T> subjectHolder;
-
- /**
- * The collection of registered sub-panes will be automatically notified
- * when listeners need to be engaged or disengaged or when to populate its
- * widgets.
- */
- private Collection<AbstractPane<?>> subPanes;
-
- /**
- * The factory used to create various common widgets.
- */
- private WidgetFactory widgetFactory;
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @category Constructor
- */
- @SuppressWarnings("unused")
- private AbstractPane() {
- super();
- }
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractPane(AbstractPane<? extends T> parentPane,
- Composite parent) {
-
- this(parentPane, parent, true);
- }
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractPane(AbstractPane<? extends T> parentPane,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- this(parentPane,
- parentPane.getSubjectHolder(),
- parent,
- automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
- */
- protected AbstractPane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- this(parentPane, subjectHolder, parent, true);
- }
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
- */
- protected AbstractPane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- this(subjectHolder,
- parent,
- parentPane.getWidgetFactory());
-
- initialize(parentPane, automaticallyAlignWidgets);
- }
-
- /**
- * Creates a new <code>AbstractSubjectPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- *
- * @category Constructor
- */
- protected AbstractPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super();
-
- this.initialize(subjectHolder, widgetFactory);
-
- try {
- this.populating = true;
-
- this.container = this.buildContainer(parent);
- this.initializeLayout(this.container);
- }
- finally {
- this.populating = false;
- }
- }
-
- /**
- * Adds the given pane's widgets (those that were registered with its
- * left <code>ControlAligner</code>) to this pane's left
- * <code>ControlAligner</code> so that their width can be adjusted to have
- * the width of the widest widget.
- *
- * @param pane The pane containing the widgets to add
- *
- * @category Layout
- */
- protected final void addAlignLeft(AbstractPane<?> container) {
- this.leftControlAligner.add(container.leftControlAligner);
- }
-
- /**
- * Adds the given control to the collection of widgets that have their width
- * adjust with the width of the widest widget. The left alignment is usually
- * used for labels.
- *
- * @param pane The pane to add
- *
- * @category Layout
- */
- protected final void addAlignLeft(Control control) {
- this.leftControlAligner.add(control);
- }
-
- /**
- * Adds the given pane's widgets (those that were registered with its
- * right <code>ControlAligner</code>) to this pane's right
- * <code>ControlAligner</code> so that their width can be adjusted to have
- * the width of the widest widget.
- *
- * @param pane The pane containing the widgets to add
- *
- * @category Layout
- */
- protected final void addAlignRight(AbstractPane<?> container) {
- this.rightControlAligner.add(container.rightControlAligner);
- }
-
- /**
- * Adds the given control to the collection of widgets that have their width
- * adjust with the width of the widest widget. The left alignment is usually
- * used for buttons.
- *
- * @param pane The pane to add
- *
- * @category Layout
- */
- protected final void addAlignRight(Control control) {
- this.rightControlAligner.add(control);
- }
-
- /**
- * Adds the given pane's controls (those that were registered for
- * alignment) from this pane.
- *
- * @param pane The pane containing the widgets to add for
- * alignment
- *
- * @category Layout
- */
- protected final void addPaneForAlignment(AbstractPane<?> container) {
- addAlignLeft(container);
- addAlignRight(container);
- }
-
- /**
- * Adds any property names to the given collection in order to be notified
- * when the actual property changes in the subject.
- *
- * @param propertyNames The collection of property names to register with the
- * subject
- */
- protected void addPropertyNames(Collection<String> propertyNames) {
- }
-
- private PropertyChangeListener buildAspectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(buildAspectChangeListener_());
- }
-
- private PropertyChangeListener buildAspectChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- updatePane(e.propertyName());
- }
- };
- }
-
- /**
- * Creates a new button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildButton(Composite container,
- String text,
- final Runnable buttonAction) {
-
- return this.buildButton(container, text, null, buttonAction);
- }
-
- /**
- * Creates a new button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param helpId The topic help ID to be registered for the new check box
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildButton(Composite container,
- String text,
- String helpId,
- final Runnable buttonAction) {
-
- Button button = this.widgetFactory.createButton(container, text);
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SWTUtil.asyncExec(buttonAction);
- }
- });
-
- if (helpId != null) {
- helpSystem().setHelp(button, helpId);
- }
-
- return button;
- }
-
- /**
- * Creates a new non-editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final CCombo buildCCombo(Composite container) {
-
- CCombo combo = this.widgetFactory.createCCombo(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- combo.setLayoutData(gridData);
-
- return combo;
- }
-
- /**
- * Creates a new <code>ComboViewer</code> using a <code>CCombo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer buildCComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- CCombo combo = this.buildCCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
- * Creates a new check box using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildCheckBox(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder) {
-
- return this.buildCheckBox(parent, buttonText, booleanHolder, null);
- }
-
- /**
- * Creates a new check box using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildCheckBox(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- return this.buildToggleButton(
- parent,
- buttonText,
- booleanHolder,
- helpId,
- SWT.CHECK
- );
- }
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final Combo buildCombo(Composite container) {
-
- Combo combo = this.widgetFactory.createCombo(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- combo.setLayoutData(gridData);
-
- return combo;
- }
-
- /**
- * Creates a new <code>ComboViewer</code> using a <code>Combo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer buildComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- Combo combo = this.buildCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
- * Creates the main container of this pane. The layout and layout data are
- * automatically set.
- *
- * @param parent The parent container
- * @return The newly created <code>Composite</code> that will holds all the
- * widgets created by this pane through {@link #initializeLayout(Composite)}
- */
- protected Composite buildContainer(Composite parent) {
- return this.buildSubPane(parent);
- }
-
- /**
- * Creates a new editable <code>CCombo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildEditableCCombo(Composite container) {
-
- CCombo combo = this.widgetFactory.createEditableCCombo(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- combo.setLayoutData(gridData);
-
- return combo;
- }
-
- /**
- * Creates a new editable <code>ComboViewer</code> using a <code>CCombo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer buildEditableCComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- CCombo combo = this.buildEditableCCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param container The parent container
- * @return The newly created <code>Combo</code>
- *
- * @category Layout
- */
- protected final Combo buildEditableCombo(Composite container) {
-
- Combo combo = this.widgetFactory.createEditableCombo(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- combo.setLayoutData(gridData);
-
- return combo;
- }
-
- /**
- * Creates a new editable <code>ComboViewer</code> using a <code>Combo</code>.
- *
- * @param container The parent container
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @return The newly created <code>ComboViewer</code>
- *
- * @category Layout
- */
- protected final ComboViewer buildEditableComboViewer(Composite container,
- IBaseLabelProvider labelProvider) {
-
- Combo combo = this.buildEditableCombo(container);
- ComboViewer viewer = new ComboViewer(combo);
- viewer.setLabelProvider(labelProvider);
- return viewer;
- }
-
- private PropertyChangeListener buildExpandedStateChangeListener(final Section section) {
- return new SWTPropertyChangeListenerWrapper(buildExpandedStateChangeListener_(section));
- }
-
- private PropertyChangeListener buildExpandedStateChangeListener_(final Section section) {
- return new PropertyChangeListener() {
- public void propertyChanged(final PropertyChangeEvent e) {
- Boolean value = (Boolean) e.newValue();
- if (value == null) {
- value = Boolean.TRUE;
- }
- section.setExpanded(value);
- }
- };
- }
-
- /**
- * Creates a new <code>Hyperlink</code> that will invoked the given
- * <code>Runnable</code> when selected. The given action is always invoked
- * from the UI thread.
- *
- * @param parent The parent container
- * @param text The hyperlink's text
- * @param hyperLinkAction The action to be invoked when the link was selected
- * return The newly created <code>Hyperlink</code>
- */
- protected final Hyperlink buildHyperLink(Composite parent,
- String text,
- final Runnable hyperLinkAction) {
-
- Hyperlink link = this.widgetFactory.createHyperlink(parent, text);
- link.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseUp(MouseEvent e) {
- SWTUtil.asyncExec(hyperLinkAction);
- }
- });
- return link;
- }
-
- /**
- * Creates a new lable using the given information.
- *
- * @param parent The parent container
- * @param labelText The label's text
- *
- * @category Layout
- */
- protected final Label buildLabel(Composite container,
- String labelText) {
-
- return this.widgetFactory.createLabel(container, labelText);
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledCCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- Control rightControl,
- String helpId) {
-
- CCombo combo = this.buildCCombo(container);
- combo.addModifyListener(comboListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledCCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- String helpId) {
-
- return this.buildLabeledCCombo(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have a non-editable combo labeled with
- * the given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Combo buildLabeledCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- Control rightControl,
- String helpId) {
-
- Combo combo = this.buildCombo(container);
- combo.addModifyListener(comboListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Combo buildLabeledCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- String helpId) {
-
- return this.buildLabeledCombo(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- Control leftControl,
- Control centerControl,
- Control rightControl,
- String helpId) {
-
- // Container for the label and main composite
- container = this.buildSubPane(container, 3, 5, 0, 0, 0);
-
- // Left control
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.BEGINNING;
- gridData.grabExcessHorizontalSpace = false;
- leftControl.setLayoutData(gridData);
-
- // Re-parent the left control to the new sub pane
- leftControl.setParent(container);
- this.leftControlAligner.add(leftControl);
-
- // Center control
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- centerControl.setLayoutData(gridData);
-
- // Re-parent the center control to the new sub pane
- centerControl.setParent(container);
-
- // Register the help id for the center control
- if (helpId != null) {
- helpSystem().setHelp(centerControl, helpId);
- }
-
- // Right control
- if (rightControl == null) {
- Composite spacer = this.buildPane(container);
- spacer.setLayout(buildSpacerLayout());
- this.rightControlAligner.add(spacer);
- }
- else {
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL_HORIZONTAL;
- gridData.grabExcessHorizontalSpace = false;
-
- rightControl.setLayoutData(gridData);
- rightControl.setParent(container);
-
- this.rightControlAligner.add(rightControl);
-
- // Register the help id for the right control
- if (helpId != null) {
- helpSystem().setHelp(rightControl, helpId);
- }
- }
-
- return container;
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param label The label used to describe the center control
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * control
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- Control label,
- Control centerControl,
- String helpId) {
-
- return this.buildLabeledComposite(
- container,
- label,
- centerControl,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param label The label used to describe the center control
- * @param centerControl The main widget
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- Label label,
- Control centerControl) {
-
- return this.buildLabeledComposite(
- container,
- label,
- centerControl,
- null
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerPane The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- AbstractPane<?> centerPane,
- Control rightCentrol,
- String helpId) {
-
- return this.buildLabeledComposite(
- container,
- labelText,
- centerPane.getControl(),
- rightCentrol,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerPane The main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- AbstractPane<?> centerPane,
- String helpId) {
-
- return this.buildLabeledComposite(
- container,
- labelText,
- centerPane.getControl(),
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- Control centerControl) {
-
-
- return this.buildLabeledComposite(
- container,
- labelText,
- centerControl,
- null,
- null
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- Control centerControl,
- Control rightControl) {
-
-
- return this.buildLabeledComposite(
- container,
- labelText,
- centerControl,
- rightControl,
- null
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- Control centerControl,
- Control rightCentrol,
- String helpId) {
-
- Label label = this.buildLabel(container, labelText);
-
- return this.buildLabeledComposite(
- container,
- label,
- centerControl,
- rightCentrol,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center composite labeled
- * with the given label text.
- *
- * @param container The parent container
- * @param labelText The text to label the main composite
- * @param centerControl The main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Composite buildLabeledComposite(Composite container,
- String labelText,
- Control centerControl,
- String helpId) {
-
- Label label = this.buildLabel(container, labelText);
-
- return this.buildLabeledComposite(
- container,
- label,
- centerControl,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledEditableCCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- Control rightControl,
- String helpId) {
-
- CCombo combo = this.buildEditableCCombo(container);
- combo.addModifyListener(comboListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledEditableCCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- String helpId) {
-
- return this.buildLabeledEditableCCombo(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledEditableCComboViewer(Composite container,
- String labelText,
- ModifyListener comboListener,
- ILabelProvider labelProvider,
- Control rightControl,
- String helpId) {
-
- ComboViewer comboViewer = this.buildEditableCComboViewer(
- container,
- labelProvider
- );
-
- CCombo combo = comboViewer.getCCombo();
- combo.addModifyListener(comboListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param labelProvider The provider responsible to convert the combo's items
- * into human readable strings
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The newly created <code>CCombo</code>
- *
- * @category Layout
- */
- protected final CCombo buildLabeledEditableCComboViewer(Composite container,
- String labelText,
- ModifyListener comboListener,
- ILabelProvider labelProvider,
- String helpId) {
-
- return this.buildLabeledEditableCComboViewer(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have the given center control labeled
- * with the given label.
- *
- * @param container The parent container
- * @param leftControl The widget shown to the left of the main widget
- * @param centerControl The main widget
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Combo buildLabeledEditableCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- Control rightControl,
- String helpId) {
-
- Combo combo = this.buildEditableCombo(container);
- combo.addModifyListener(comboListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- (combo.getParent() != container) ? combo.getParent() : combo,
- rightControl,
- helpId
- );
-
- return combo;
- }
-
- /**
- * Creates a new container that will have an editable combo labeled with the
- * given text.
- *
- * @param container The parent container
- * @param labelText The text of the label
- * @param comboListener The listener that will be notified when the selection
- * changes
- * @param helpId The topic help ID to be registered for the given center
- * compositer
- * @return The container of the label and the given center control
- *
- * @category Layout
- */
- protected final Combo buildLabeledEditableCombo(Composite container,
- String labelText,
- ModifyListener comboListener,
- String helpId) {
-
- return this.buildLabeledEditableCombo(
- container,
- labelText,
- comboListener,
- null,
- helpId
- );
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textListener The listener that is notified when the text field's
- * input changes
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text buildLabeledText(Composite container,
- String labelText,
- ModifyListener textListener) {
-
- Text text = this.buildText(container);
- text.addModifyListener(textListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- text
- );
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textListener The listener that is notified when the text field's
- * input changes
- * @param rightControl The control shown to the right of the main widget
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text buildLabeledText(Composite container,
- String labelText,
- ModifyListener textListener,
- Control rightControl) {
-
- Text text = this.buildText(container);
- text.addModifyListener(textListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- text,
- rightControl
- );
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textListener The listener that is notified when the text field's
- * input changes
- * @param rightControl The control shown to the right of the main widget
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text buildLabeledText(Composite container,
- String labelText,
- ModifyListener textListener,
- Control rightControl,
- String helpId) {
-
- Text text = this.buildText(container);
- text.addModifyListener(textListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- text,
- rightControl,
- helpId
- );
-
- return text;
- }
-
- /**
- * Creates a new container that will have a text field as the center control
- * labeled with the given label.
- *
- * @param container The parent container
- * @param textListener The listener that is notified when the text field's
- * input changes
- * @param helpId The topic help ID to be registered for the text field
- * @return The newly created <code>Text</code>
- *
- * @category Layout
- */
- protected final Text buildLabeledText(Composite container,
- String labelText,
- ModifyListener textListener,
- String helpId) {
-
- Text text = this.buildText(container);
- text.addModifyListener(textListener);
-
- this.buildLabeledComposite(
- container,
- labelText,
- text,
- helpId
- );
-
- return text;
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List buildList(Composite container) {
-
- return this.buildList(container, (String) null);
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List buildList(Composite container, String helpId) {
-
- return this.buildList(
- container,
- new SimplePropertyValueModel<String>(),
- helpId
- );
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @param selectionHolder The holder of the unique selected item
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List buildList(Composite container,
- WritablePropertyValueModel<String> selectionHolder) {
-
- return this.buildList(container, selectionHolder, null);
- }
-
- /**
- * Creates a new list and notify the given selection holder when the
- * selection changes. If the selection count is different than one than the
- * holder will receive <code>null</code>.
- *
- * @param container The parent container
- * @param selectionHolder The holder of the unique selected item
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>List</code>
- *
- * @category Layout
- */
- protected final List buildList(Composite container,
- WritablePropertyValueModel<String> selectionHolder,
- String helpId) {
-
- List list = this.widgetFactory.createList(
- container,
- SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI
- );
-
- list.addSelectionListener(buildSelectionListener(selectionHolder));
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- list.setLayoutData(gridData);
-
- if (helpId != null) {
- helpSystem().setHelp(list, helpId);
- }
-
- return list;
- }
-
- /**
- * Creates a new <code>PageBook</code> and set the proper layout and layout
- * data.
- *
- * @param container The parent container
- * @return The newly created <code>PageBook</code>
- */
- protected final PageBook buildPageBook(Composite container) {
-
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return pageBook;
- }
-
- /**
- * Creates a new container without specifying any layout manager.
- *
- * @param container The parent of the new container
- * @return The newly created <code>Composite</code>
- *
- * @category Layout
- */
- protected final Composite buildPane(Composite parent) {
- return this.widgetFactory.createComposite(parent);
- }
-
- /**
- * Creates a new container using the given layout manager.
- *
- * @param parent The parent of the new container
- * @param layout The layout manager of the new container
- * @return The newly created container
- *
- * @category Layout
- */
- protected final Composite buildPane(Composite container, Layout layout) {
-
- container = this.widgetFactory.createComposite(container);
- container.setLayout(layout);
-
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
-
- return container;
- }
-
- /**
- * Creates a new push button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildPushButton(Composite parent,
- String buttonText,
- final Runnable buttonAction) {
-
- return this.buildPushButton(parent, buttonText, null, buttonAction);
- }
-
- /**
- * Creates a new push button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param buttonAction The action to be invoked when the button is pressed
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildPushButton(Composite parent,
- String buttonText,
- String helpId,
- final Runnable buttonAction) {
-
- Button button = this.widgetFactory.createPushButton(parent, buttonText);
-
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SWTUtil.asyncExec(buttonAction);
- }
- });
-
- button.setLayoutData(new GridData());
-
- if (helpId != null) {
- helpSystem().setHelp(button, helpId);
- }
-
- return button;
- }
-
- /**
- * Creates a new radio button using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildRadioButton(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder) {
-
- return this.buildRadioButton(parent, buttonText, booleanHolder, null);
- }
-
- /**
- * Creates a new check box using the given information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new radio button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- protected final Button buildRadioButton(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- return this.buildToggleButton(
- parent,
- buttonText,
- booleanHolder,
- helpId,
- SWT.RADIO
- );
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSection(Composite container,
- String sectionText) {
-
- return this.buildSection(
- container,
- sectionText,
- ExpandableComposite.TITLE_BAR
- );
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param type The type of section to create
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite buildSection(Composite container,
- String sectionText,
- int type) {
-
- return this.buildSection(
- container,
- sectionText,
- type,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param type The type of section to create
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- private Composite buildSection(Composite container,
- String sectionText,
- int type,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- Section section = this.widgetFactory.createSection(
- container,
- ExpandableComposite.TWISTIE | type
- );
-
- section.setText(sectionText);
- section.marginWidth = 0;
- section.marginHeight = 0;
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- section.setLayoutData(gridData);
-
- Composite subPane = this.buildSubPane(section);
- section.setClient(subPane);
-
- expandedStateHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildExpandedStateChangeListener(section)
- );
-
- section.setExpanded(
- expandedStateHolder.value() != null ? expandedStateHolder.value() : true
- );
-
- return subPane;
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client and is the returned <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSection(Composite container,
- String sectionText,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return this.buildSection(
- container,
- sectionText,
- ExpandableComposite.TITLE_BAR,
- expandedStateHolder
- );
- }
-
- private SelectionListener buildSelectionListener(final WritablePropertyValueModel<String> selectionHolder) {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- List list = (List) e.widget;
- String[] selectedItems = list.getSelection();
- if ((selectedItems == null) || (selectedItems.length != 1)) {
- selectionHolder.setValue(null);
- }
- else {
- selectionHolder.setValue(selectedItems[0]);
- }
- }
- };
- }
-
- private Layout buildSpacerLayout() {
-
- return new Layout() {
-
- @Override
- protected Point computeSize(Composite composite,
- int widthHint,
- int heightHint,
- boolean flushCache) {
-
- return new Point(widthHint, heightHint);
- }
-
- @Override
- protected void layout(Composite composite, boolean flushCache) {
- GridData data = (GridData) composite.getLayoutData();
- composite.setBounds(0, 0, data.widthHint, data.heightHint);
- }
- };
- }
-
- private PropertyChangeListener buildSubjectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
- }
-
- private PropertyChangeListener buildSubjectChangeListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- AbstractPane.this.subjectChanged((T) e.oldValue(), (T) e.newValue());
- }
- };
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubPane(Composite container) {
- return this.buildSubPane(container, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubPane(Composite container, int topMargin) {
- return this.buildSubPane(container, topMargin, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubPane(Composite container,
- int topMargin,
- int leftMargin) {
-
- return this.buildSubPane(container, topMargin, leftMargin, 0, 0);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane, the new widget
- * will have its layout and layout data already initialized, the layout will
- * be a <code>GridLayout</code> with 1 column.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @param bottomMargin The extra spacing to add at the bottom of the pane
- * @param rightMargin The extra spacing to add to the right of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubPane(Composite container,
- int topMargin,
- int leftMargin,
- int bottomMargin,
- int rightMargin) {
-
- return this.buildSubPane(
- container,
- 1,
- topMargin,
- leftMargin,
- bottomMargin,
- rightMargin);
- }
-
- /**
- * Creates a new <code>Composite</code> used as a sub-pane, the new widget
- * will have its layout and layout data already initialized, the layout will
- * be a <code>GridLayout</code> with 1 column.
- *
- * @param container The parent container
- * @param topMargin The extra spacing to add at the top of the pane
- * @param leftMargin The extra spacing to add to the left of the pane
- * @param bottomMargin The extra spacing to add at the bottom of the pane
- * @param rightMargin The extra spacing to add to the right of the pane
- * @return The newly created <code>Composite</code> used as a sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubPane(Composite container,
- int columnCount,
- int topMargin,
- int leftMargin,
- int bottomMargin,
- int rightMargin) {
-
- GridLayout layout = new GridLayout(columnCount, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = topMargin;
- layout.marginLeft = leftMargin;
- layout.marginBottom = bottomMargin;
- layout.marginRight = rightMargin;
-
- container = this.buildPane(container, layout);
-
- return container;
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client which can be typed cast directly as a
- * <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubSection(Composite container,
- String sectionText) {
-
- return this.buildSubSection(
- container,
- sectionText,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
- }
-
- /**
- * Creates a new <code>Section</code> with flat style. A sub-pane is
- * automatically added as its client which can be typed cast directly as a
- * <code>Composite</code>.
- *
- * @param container The container of the new widget
- * @param sectionText The text of the new section
- * @param expandedStateHolder The holder of the boolean that will dictate
- * when to expand or collapse the section
- * @return The <code>Section</code>'s sub-pane
- *
- * @category Layout
- */
- protected final Composite buildSubSection(Composite container,
- String sectionText,
- PropertyValueModel<Boolean> expandedStateHolder) {
-
- return this.buildSection(
- container,
- sectionText,
- SWT.NULL,
- expandedStateHolder
- );
- }
-
- /**
- * Creates a new <code>Text</code> widget, the widget is created with the
- * flat-style look.
- *
- * @param container The parent container
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text buildText(Composite container) {
- return this.widgetFactory.createText(container);
- }
-
- /**
- * Creates a new <code>Text</code> widget, the widget is created with the
- * flat-style look.
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new text
- * @return The newly created <code>Text</code> widget
- *
- * @category Layout
- */
- protected final Text buildText(Composite container, String helpId) {
- Text text = this.widgetFactory.createText(container);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
-
- if (helpId != null) {
- helpSystem().setHelp(text, helpId);
- }
-
- return text;
- }
-
- /**
- * Creates a new container with a titled border.
- *
- * @param title The text of the titled border
- * @param container The parent container
- * @return The newly created <code>Composite</code> with a titled border
- *
- * @category Layout
- */
- protected final Group buildTitledPane(Composite container, String title) {
- return this.buildTitledPane(container, title, null);
- }
-
- /**
- * Creates a new container with a titled border.
- *
- * @param title The text of the titled border
- * @param container The parent container
- * @param helpId The topic help ID to be registered for the new group
- * @return The newly created <code>Composite</code> with a titled border
- *
- * @category Layout
- */
- protected final Group buildTitledPane(Composite container,
- String title,
- String helpId) {
-
- Group group = this.widgetFactory.createGroup(container, title);
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 2;
- layout.marginLeft = 5;
- layout.marginBottom = 9;
- layout.marginRight = 5;
- group.setLayout(layout);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.verticalIndent = 0;
- group.setLayoutData(gridData);
-
- if (helpId != null) {
- helpSystem().setHelp(group, helpId);
- }
-
- return group;
- }
-
- /**
- * Creates a new toggle button (radio button or check box) using the given
- * information.
- *
- * @param parent The parent container
- * @param buttonText The button's text
- * @param booleanHolder The holder of the selection state
- * @param helpId The topic help ID to be registered for the new button
- * @return The newly created <code>Button</code>
- *
- * @category Layout
- */
- private Button buildToggleButton(Composite parent,
- String buttonText,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId,
- int toggleButtonType) {
-
- Button button;
-
- if (toggleButtonType == SWT.PUSH) {
- button = this.widgetFactory.createPushButton(parent, buttonText);
- }
- else if (toggleButtonType == SWT.RADIO) {
- button = this.widgetFactory.createRadioButton(parent, buttonText);
- }
- else if (toggleButtonType == SWT.CHECK) {
- button = this.widgetFactory.createCheckBox(parent, buttonText);
- }
- else {
- button = this.widgetFactory.createButton(parent, buttonText);
- }
-
- button.setLayoutData(new GridData());
- BooleanButtonModelAdapter.adapt(booleanHolder, button);
-
- if (helpId != null) {
- helpSystem().setHelp(button, helpId);
- }
-
- return button;
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @return The newly created <code>TriStateCheckBox</code>
- */
- protected final TriStateCheckBox buildTriStateCheckBox(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder) {
-
- return this.buildTriStateCheckBox(parent, text, booleanHolder, null);
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>TriStateCheckBox</code>
- */
- protected final TriStateCheckBox buildTriStateCheckBox(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder,
- String helpId) {
-
- TriStateCheckBox checkBox = new TriStateCheckBox(
- parent,
- text,
- this.getWidgetFactory()
- );
-
- TriStateCheckBoxModelAdapter.adapt(
- booleanHolder,
- checkBox
- );
-
- if (helpId != null) {
- helpSystem().setHelp(checkBox.getCheckBox(), helpId);
- }
-
- return checkBox;
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @param stringHolder The holder of the string to put in parenthesis after
- * the check box's text when it is partially selected
- * @return The newly created <code>TriStateCheckBox</code>
- */
- protected final TriStateCheckBox buildTriStateCheckBoxWithDefault(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder,
- PropertyValueModel<String> stringHolder) {
-
- return this.buildTriStateCheckBoxWithDefault(
- parent,
- text,
- booleanHolder,
- stringHolder,
- null
- );
- }
-
- /**
- * Creates a new check box that can have 3 selection states (selected,
- * unselected and partially selected.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param booleanHolder The holder of the boolean value where <code>null</code>
- * means partially selected
- * @param stringHolder The holder of the string to put in parenthesis after
- * the check box's text when it is partially selected
- * @param helpId The topic help ID to be registered for the new check box
- * @return The newly created <code>TriStateCheckBox</code>
- */
- protected final TriStateCheckBox buildTriStateCheckBoxWithDefault(Composite parent,
- String text,
- WritablePropertyValueModel<Boolean> booleanHolder,
- PropertyValueModel<String> stringHolder,
- String helpId) {
-
- TriStateCheckBox checkBox = this.buildTriStateCheckBox(
- parent,
- text,
- booleanHolder,
- helpId
- );
-
- new LabeledControlUpdater(
- new LabeledButton(checkBox.getCheckBox()),
- stringHolder
- );
-
- return checkBox;
- }
-
- /**
- * Uninstalls any listeners from the subject in order to stop being notified
- * for changes made outside of this panes.
- *
- * @category Populate
- */
- protected void disengageListeners() {
-
- this.log(Tracing.UI_LAYOUT, " ->disengageListeners()");
-
- this.subjectHolder.removePropertyChangeListener(
- PropertyValueModel.VALUE,
- this.subjectChangeListener
- );
-
- this.disengageListeners(this.subject());
-
- for (AbstractPane<?> subPane : this.subPanes) {
- subPane.disengageListeners();
- }
- }
-
- /**
- * Removes any property change listeners from the given subject.
- *
- * @param subject The old subject
- *
- * @category Populate
- */
- protected void disengageListeners(T subject) {
- if (subject != null) {
-// this.log(" ->disengageListeners() from " + subject);
-
- for (String propertyName : this.propertyNames()) {
- subject.removePropertyChangeListener(propertyName, this.aspectChangeListener);
- }
- }
- }
-
- /**
- * Notifies this pane is should dispose itself.
- *
- * @category Populate
- */
- public final void dispose() {
- if (!this.container.isDisposed()) {
- this.log(Tracing.UI_LAYOUT, "dispose()");
- this.performDispose();
- this.disengageListeners();
- }
- }
-
- /**
- * Requests this pane to dispose itself.
- *
- * @category Populate
- */
- protected void doDispose() {
- this.log(Tracing.UI_LAYOUT, " ->doDispose()");
- }
-
- /**
- * Requests this pane to populate its widgets with the subject's values.
- *
- * @category Populate
- */
- protected void doPopulate() {
- this.log(Tracing.UI_LAYOUT, " ->doPopulate()");
- }
-
- /**
- * Changes the enablement state of the widgets of this pane.
- *
- * @param enabled <code>true</code> to enable the widgets or <code>false</code>
- * to disable them
- *
- * @category Layout
- */
- public void enableWidgets(boolean enabled) {
-
- if (!container.isDisposed()) {
-
- container.setEnabled(enabled);
-
- for (AbstractPane<?> subPane : this.subPanes) {
- subPane.enableWidgets(enabled);
- }
- }
- }
-
- /**
- * Installs the listeners on the subject in order to be notified from changes
- * made outside of this panes and notifies the sub-panes to do the same.
- *
- * @category Populate
- */
- protected void engageListeners() {
-
- this.log(Tracing.UI_LAYOUT, " ->engageListeners()");
-
- this.engageSubjectHolder();
- this.engageListeners(this.subject());
-
- for (AbstractPane<?> subPane : this.subPanes) {
- subPane.engageListeners();
- }
- }
-
- /**
- * TODO
- *
- * @param subject
- *
- * @category Populate
- */
- protected void engageListeners(T subject) {
- if (subject != null) {
-
-// this.log(" ->engageListeners() on " + subject);
-
- for (String propertyName : this.propertyNames()) {
- subject.addPropertyChangeListener(propertyName, this.aspectChangeListener);
- }
- }
- }
-
- private void engageSubjectHolder() {
- this.subjectHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- this.subjectChangeListener
- );
- }
-
- /**
- * Returns the main <code>Control</code> of this pane.
- *
- * @return The main container
- *
- * @category Layout
- */
- public Composite getControl() {
- return this.container;
- }
-
- /**
- * Returns the subject holder used by this pane.
- *
- * @return The holder of the subject
- *
- * @category Populate
- */
- protected final PropertyValueModel<T> getSubjectHolder() {
- return this.subjectHolder;
- }
-
- /**
- * Returns
- *
- * @return
- *
- * @category Layout
- */
- protected final WidgetFactory getWidgetFactory() {
- return this.widgetFactory;
- }
-
- /**
- * Returns the margin taken by a group box, which is the number of pixel the
- * group box border and its margin takes before displaying its widgets plus
- * 5 pixels since the widgets inside of the group box and the border should
- * have that extra 5 pixels.
- *
- * @return The width taken by the group box border with its margin
- *
- * @category Layout
- */
- protected final int groupBoxMargin() {
- Group group = this.widgetFactory.createGroup(Display.getCurrent().getActiveShell(), "");
- Rectangle clientArea = group.getClientArea();
- group.dispose();
- return clientArea.x + 5;
- }
-
- /**
- * Returns the helps system.
- *
- * @return The platform's help system
- *
- * @category Helper
- */
- protected final IWorkbenchHelpSystem helpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- /**
- * Initializes this <code>AbstractSubjectPane</code>.
- *
- * @category Initialization
- */
- protected void initialize() {
- }
-
- /**
- * Registers this pane with the parent pane.
- *
- * @param parentPane The parent pane
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Initialization
- */
- private void initialize(AbstractPane<?> parentPane,
- boolean automaticallyAlignWidgets) {
-
- // Register this pane with the parent pane, it will call the methods
- // automatically (engageListeners(), disengageListeners(), populate(),
- // dispose(), etc)
- parentPane.registerSubPane(this);
-
- // Align the left and right controls with the controls from the parent
- // pane
- if (automaticallyAlignWidgets) {
- parentPane.leftControlAligner .add(this.leftControlAligner);
- parentPane.rightControlAligner.add(this.rightControlAligner);
- }
- }
-
- /**
- * Initializes this <code>AbstractSubjectPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param widgetFactory The factory used to create various widgets
- *
- * @category Initialization
- */
- @SuppressWarnings("unchecked")
- private void initialize(PropertyValueModel<? extends T> subjectHolder,
- WidgetFactory widgetFactory)
- {
- Assert.isNotNull(subjectHolder, "The subject holder cannot be null");
-
- this.subjectHolder = (PropertyValueModel<T>) subjectHolder;
- this.widgetFactory = widgetFactory;
- this.subPanes = new ArrayList<AbstractPane<?>>();
- this.leftControlAligner = new ControlAligner();
- this.rightControlAligner = new ControlAligner();
- this.subjectChangeListener = this.buildSubjectChangeListener();
- this.aspectChangeListener = this.buildAspectChangeListener();
-
- this.initialize();
- }
-
- /**
- * Initializes the layout of this pane.
- *
- * @param container The parent container
- *
- * @category Layout
- */
- protected abstract void initializeLayout(Composite container);
-
- /**
- * Determines whether
- *
- * @return
- *
- * @category Populate
- */
- protected final boolean isPopulating() {
- return this.populating;
- }
-
- /**
- * Logs the given message if the <code>Tracing.DEBUG_LAYOUT</code> is enabled.
- *
- * @param flag
- * @param message The logging message
- */
- protected void log(String flag, String message) {
-
- if (Tracing.UI_LAYOUT.equals(flag) &&
- Tracing.booleanDebugOption(Tracing.UI_LAYOUT)) {
-
- Class<?> thisClass = getClass();
- String className = ClassTools.shortNameFor(thisClass);
-
- if (thisClass.isAnonymousClass()) {
- className = className.substring(0, className.indexOf('$'));
- className += "->" + ClassTools.shortNameFor(thisClass.getSuperclass());
- }
-
- Tracing.log(className + ": " + message);
- }
- }
-
- /**
- * Notifies this pane is should dispose itself.
- *
- * @category Populate
- */
- protected void performDispose() {
- this.log(Tracing.UI_LAYOUT, " ->performDispose()");
-
- // Dispose this pane
- doDispose();
-
- // Ask the sub-panes to perform the dispose themselves
- for (AbstractPane<?> subPane : this.subPanes) {
- subPane.performDispose();
- }
- }
-
- /**
- * Notifies this pane to populate itself using the subject's information.
- *
- * @category Populate
- */
- public final void populate() {
- if (!this.container.isDisposed()) {
- this.log(Tracing.UI_LAYOUT, "populate()");
- this.engageListeners();
- this.repopulate();
- }
- }
-
- /**
- * Notifies the subject's property associated with the given property name
- * has changed.
- *
- * @param propertyName The property name associated with the property change
- *
- * @category Populate
- */
- protected void propertyChanged(String propertyName) {
- }
-
- /**
- * Returns the list of names to listen for properties changing from the
- * subject.
- *
- * @return A non-<code>null</code> list of property names
- *
- * @category Populate
- */
- protected Collection<String> propertyNames() {
- ArrayList<String> propertyNames = new ArrayList<String>();
- addPropertyNames(propertyNames);
- return propertyNames;
- }
-
- /**
- * Registers another <code>AbstractSubjectPane</code> with this one so it can
- * be automatically notified about certain events such as engaging or
- * disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to register
- *
- * @category Controller
- */
- protected final void registerSubPane(AbstractPane<?> subPane) {
- this.subPanes.add(subPane);
- }
-
- /**
- * Removes the given pane's widgets (those that were registered with
- * its left <code>ControlAligner</code>) from this pane's left
- * <code>ControlAligner</code> so that their width will no longer be adjusted
- * with the width of the widest widget.
- *
- * @param pane The pane containing the widgets to remove
- *
- * @category Layout
- */
- protected final void removeAlignLeft(AbstractPane<?> pane) {
- this.leftControlAligner.remove(pane.leftControlAligner);
- }
-
- /**
- * Removes the given control from the collection of widgets that are aligned
- * to have the same width when they are shown to the left side of the 3
- * widget colums.
- *
- * @param pane The pane to remove, its width will no longer be
- * ajusted to be the width of the longest widget
- *
- * @category Layout
- */
- protected final void removeAlignLeft(Control control) {
- this.leftControlAligner.remove(control);
- }
-
- /**
- * Removes the given pane's widgets (those that were registered with
- * its right <code>ControlAligner</code>) from this pane's right
- * <code>ControlAligner</code> so that their width will no longer be adjusted
- * with the width of the widest widget.
- *
- * @param pane The pane containing the widgets to remove
- *
- * @category Layout
- */
- protected final void removeAlignRight(AbstractPane<?> pane) {
- this.rightControlAligner.remove(pane.rightControlAligner);
- }
-
- /**
- * Removes the given control from the collection of widgets that are aligned
- * to have the same width when they are shown to the right side of the 3
- * widget colums.
- *
- * @param pane The pane to remove, its width will no longer be
- * ajusted to be the width of the longest widget
- *
- * @category Layout
- */
- protected final void removeAlignRight(Control control) {
- this.rightControlAligner.remove(control);
- }
-
- /**
- * Removes the given pane's controls (those that were registered for
- * alignment) from this pane.
- *
- * @param pane The pane containing the widgets that no longer
- * requires their width adjusted with the width of the longest widget
- *
- * @category Layout
- */
- protected final void removePaneForAlignment(AbstractPane<?> pane) {
- removeAlignLeft(pane);
- removeAlignRight(pane);
- }
-
- /**
- * This method is called (perhaps internally) when this needs to repopulate
- * but the object of interest has not changed.
- *
- * @category Populate
- */
- protected final void repopulate() {
-
- this.log(Tracing.UI_LAYOUT, " ->repopulate()");
-
- // Populate this pane
- try {
- setPopulating(true);
- doPopulate();
- }
- finally {
- setPopulating(false);
- }
-
- // Ask the sub-panes to repopulate themselves
- for (AbstractPane<?> subPane : this.subPanes) {
- subPane.repopulate();
- }
- }
-
- /**
- * Determines whether this pane should be repopulate even if the subject if
- * <code>null</code>.
- *
- * @return <code>true</code> is returned by default
- */
- protected boolean repopulateWithNullSubject() {
- return true;
- }
-
- /**
- * Sets (TODO)
- *
- * @param populating
- *
- * @category Populate
- */
- protected final void setPopulating(boolean populating) {
- this.populating = populating;
- }
-
- /**
- * Either show or hides this pane.
- *
- * @param visible The new visibility state
- */
- public void setVisible(boolean visible) {
- if (!this.container.isDisposed()) {
- this.container.setVisible(visible);
- }
- }
-
- /**
- * Returns the nearest <code>Shell</code> displaying the main widget of this
- * pane.
- *
- * @return The nearest window displaying this pane
- */
- protected final Shell shell() {
- return this.container.getShell();
- }
-
- /**
- * Returns the subject of this pane.
- *
- * @return The subject if this pane was not disposed; <code>null</code>
- * if it was
- *
- * @category Populate
- */
- protected T subject() {
- return this.subjectHolder.value();
- }
-
- /**
- * The subject has changed, disconnects any listeners from the old subject
- * and connects those listeners onto the new subject.
- *
- * @param oldsubject The old subject or <code>null</code> if none was set
- * @param newSubject The new subject or <code>null</code> if none needs to be
- * set
- *
- * @category Populate
- */
- protected final void subjectChanged(T oldSubject, T newSubject) {
- if (!this.container.isDisposed()) {
-
- this.log(Tracing.UI_LAYOUT, "subjectChanged()");
- this.disengageListeners(oldSubject);
-
- // Only repopulate if it is allowed when the subject is null
- if (newSubject != null ||
- (newSubject == null && repopulateWithNullSubject()))
- {
- this.repopulate();
- }
-
- this.engageListeners(newSubject);
- }
- }
-
- /**
- * Unregisters the given <code>AbstractSubjectPane</code> from this one so it
- * can no longer be automatically notified about certain events such as
- * engaging or disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to unregister
- *
- * @category Controller
- */
- protected final void unregisterSubPane(AbstractPane<?> subPane) {
- this.subPanes.remove(subPane);
- }
-
- private void updatePane(String propertyName) {
- if (!isPopulating() && !container.isDisposed()) {
- populating = true;
-
- try {
- propertyChanged(propertyName);
- }
- finally {
- populating = false;
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractValidatingDialog.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractValidatingDialog.java
deleted file mode 100644
index cb6ec038ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AbstractValidatingDialog.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.internal.node.Problem;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is similar to it superclass, <code>AbstractDialog</code>, with
- * the added value of an error message label below the main panel. A subclass
- * can set this error message as needed so that it can inform the user something
- * incorrect has been entered.
- * <p>
- * If there is an error message, it will be shown. If there is a warning
- * message, it will only be shown if there is no error message. Warning messages
- * have a different icon than error messages.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractValidatingDialog<T extends Node> extends AbstractDialog<T> {
-
- /**
- * Creates a new <code>AbstractValidatingDialog</code>.
- *
- * @param parent The parent shell
- */
- public AbstractValidatingDialog(Shell parent) {
- super(parent);
- }
-
- /**
- * Creates a new <code>AbstractValidatingDialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
- */
- public AbstractValidatingDialog(Shell parent, String title) {
- super(parent, title);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- final Node.Validator buildValidator() {
- return new Node.Validator() {
- public void pause() {
- }
-
- public void resume() {
- }
-
- public void validate() {
- AbstractValidatingDialog.this.validate();
- }
- };
- }
-
- /**
- * Clears the error message from the description pane.
- */
- protected final void clearErrorMessage() {
- setErrorMessage(null);
- }
-
- /**
- * Returns the description shown in the description pane.
- *
- * @return The description under the description's title
- */
- protected String description() {
- return null;
- }
-
- /**
- * Returns the image shown in the description pane.
- *
- * @return The image of the description pane or <code>null</code> if none is
- * required
- */
- protected Image descriptionImage() {
- return null;
- }
-
- /**
- * Returns the title of the description pane.
- *
- * @return The title shown in the description pane
- */
- protected String descriptionTitle() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected final boolean hasTitleArea() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeUI() {
-
- super.initializeUI();
-
- // Update the description title
- String descriptionTitle = descriptionTitle();
-
- if (descriptionTitle != null) {
- setTitle(descriptionTitle);
- }
-
- // Update the description title
- String description = description();
-
- if (description != null) {
- setMessage(description);
- }
-
- // Update the description image
- Image image = descriptionImage();
-
- if (image != null) {
- setTitleImage(image);
- }
- }
-
- /**
- * Updates the description pane by showing the given error message and format
- * the text with the given list of arguments if any exists.
- *
- * @param errorMessage The error message to show in the description pane
- * @param arguments The list of arguments used to format the error message
- */
- protected final void setErrorMessage(String errorMessage, Object... arguments) {
- setErrorMessage(NLS.bind(errorMessage, arguments));
- }
-
- /**
- * Updates the error message, either shows the first error problem or hides
- * the error pane. If the progress bar is shown, then the error message will
- * not be shown.
- */
- private void updateErrorMessage() {
- if (subject().hasBranchProblems()) {
- Problem problem = subject().branchProblems().next();
- setErrorMessage(problem.messageKey(), problem.messageArguments());
- }
- // TODO: It would be nice to add warnings to the model
-// else if (this.subject().hasBranchWarnings()) {
-// Problem problem = this.subject().branchWarnings().next();
-// this.setWarningMessageKey(problem.getMessageKey(), problem.getMessageArguments());
-// }
- else {
- clearErrorMessage();
- }
- }
-
- /**
- * Validates the state object and based on its status, update the description
- * pane to show the first error if any exists and update the enablement of
- * the OK button.
- */
- private void validate() {
- subject().validateBranch();
- updateErrorMessage();
- getButton(OK).setEnabled(!subject().hasBranchProblems());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java
deleted file mode 100644
index 8098c25fdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemoveListPane.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.List;
-
-/**
- * This implementation of the <code>AddRemovePane</code> uses a <code>List</code>
- * as its main widget.
- * <p>
- * Here the layot of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------- ----------- |
- * | | Item 1 | | Add... | |
- * | | ... | ----------- |
- * | | Item n | ----------- |
- * | | | | Edit... | |
- * | | | ----------- |
- * | | | ----------- |
- * | | | | Remove | |
- * | | | ----------- |
- * | ------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 1.0
- */
-public class AddRemoveListPane<T extends Model> extends AddRemovePane<T>
-{
- /**
- * The main widget of this add/remove pane.
- */
- private List list;
-
- /**
- * Flag used to prevent circular
- */
- private boolean locked;
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- public AddRemoveListPane(AbstractPane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveListPane(AbstractPane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- public AddRemoveListPane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider);
- }
-
- /**
- * Creates a new <code>AddRemoveListPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- public AddRemoveListPane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
- }
-
- private WritablePropertyValueModel<String> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<String>();
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildSelectedItemPropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildSelectedItemPropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (list.isDisposed()) {
- return;
- }
- if (!locked) {
- locked = true;
-
- try {
- Object value = e.newValue();
- getSelectionModel().setSelectedValue(e.newValue());
- int index = -1;
-
- if (value != null) {
- index = CollectionTools.indexOf(getListHolder().iterator(), value);
- }
-
- list.select(index);
- updateButtons();
- }
- finally {
- locked = false;
- }
- }
- }
- };
- }
-
- private SelectionChangeListener<Object> buildSelectionListener() {
- return new SelectionChangeListener<Object>() {
- public void selectionChanged(SelectionChangeEvent<Object> e) {
- AddRemoveListPane.this.selectionChanged();
- }
- };
- }
-
- private StringConverter<Object> buildStringConverter(final ILabelProvider labelProvider) {
- return new StringConverter<Object>() {
- public String convertToString(Object item) {
- return labelProvider.getText(item);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- @SuppressWarnings("unchecked")
- protected void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- list = buildList(container, buildSelectedItemHolder(), helpId);
-
- ListBoxModelAdapter<Object> listModel = ListBoxModelAdapter.adapt(
- (ListValueModel<Object>) listHolder,
- new SimplePropertyValueModel<Object>(),
- list,
- buildStringConverter(labelProvider)
- );
-
- listModel.addSelectionChangeListener(buildSelectionListener());
-
- selectedItemHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildSelectedItemPropertyChangeListener()
- );
- }
-
- /**
- * The selection has changed, update (1) the selected item holder, (2) the
- * selection model and (3) the buttons.
- */
- private void selectionChanged() {
-
- if (locked) {
- return;
- }
-
- locked = true;
-
- try {
- WritablePropertyValueModel<Object> selectedItemHolder = getSelectedItemHolder();
- ObjectListSelectionModel selectionModel = getSelectionModel();
- int selectionCount = list.getSelectionCount();
-
- if (selectionCount == 0) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
- }
- else if (selectionCount != 1) {
- selectedItemHolder.setValue(null);
- selectionModel.clearSelection();
-
- for (int index : list.getSelectionIndices()) {
- selectionModel.addSelectionInterval(index, index);
- }
- }
- else {
- int selectedIndex = list.getSelectionIndex();
- Object selectedItem = getListHolder().get(selectedIndex);
-
- selectedItemHolder.setValue(selectedItem);
- selectionModel.setSelectedValue(selectedItem);
- }
-
- updateButtons();
- }
- finally {
- locked = false;
- }
- }
-
- /**
- * Selects the given value, which can be <code>null</code>.
- *
- * @param value The new selected value
- */
- public void setSelectedItem(Object value) {
- getSelectedItemHolder().setValue(value);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java
deleted file mode 100644
index 42c02f29ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/AddRemovePane.java
+++ /dev/null
@@ -1,771 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The abstract definition of a pane that has buttons for adding, removing and
- * possibly editing the items.
- *
- * @see AddRemoveListPane
- *
- * @version 1.0
- * @since 2.0
- */
-public abstract class AddRemovePane<T extends Model> extends AbstractPane<T>
-{
- private Adapter adapter;
- private Button addButton;
- private Composite container;
- private ILabelProvider labelProvider;
- private ListValueModel<?> listHolder;
- private Button optionalButton;
- private Button removeButton;
- private WritablePropertyValueModel<Object> selectedItemHolder;
- private ObjectListSelectionModel selectionModel;
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- protected AddRemovePane(AbstractPane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- this(parentPane,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- null);
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- protected AddRemovePane(AbstractPane<? extends T> parentPane,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane, parent);
-
- initialize(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider
- );
-
- initializeLayout(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- */
- protected AddRemovePane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider) {
-
- this(parentPane,
- subjectHolder,
- parent,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- null);
- }
-
- /**
- * Creates a new <code>AddRemovePane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param parent The parent container
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- */
- protected AddRemovePane(AbstractPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- super(parentPane, subjectHolder, parent);
-
- initialize(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider
- );
-
- initializeLayout(
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
- }
-
- /**
- * @category Add
- */
- protected void addItem() {
- adapter.addNewItem(selectionModel);
- }
-
- /**
- * @category Initialize
- */
- protected Adapter buildAdapter() {
- return adapter;
- }
-
- /**
- * @category Add
- */
- protected Button buildAddButton(Composite parent) {
- return buildButton(
- parent,
- adapter.addButtonText(),
- buildAddItemAction()
- );
- }
-
- /**
- * @category Add
- */
- private Runnable buildAddItemAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.addItem();
- }
- };
- }
-
- private ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(buildListChangeListener_());
- }
-
- private ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
-
- public void itemsAdded(ListChangeEvent e) {
- }
-
- public void itemsMoved(ListChangeEvent e) {
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- Object selectedItem = selectedItemHolder.value();
-
- if (selectedItem == null) {
- return;
- }
-
- if (CollectionTools.contains(e.items(), selectedItem)) {
- selectedItemHolder.setValue(null);
- updateButtons();
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- }
-
- public void listChanged(ListChangeEvent e) {
- }
-
- public void listCleared(ListChangeEvent e) {
- selectedItemHolder.setValue(null);
- updateButtons();
- }
- };
- }
-
- /**
- * @category Option
- */
- private Runnable buildOptionalAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.editItem();
- }
- };
- }
-
- /**
- * @category Option
- */
- protected Button buildOptionalButton(Composite container) {
- return buildButton(
- container,
- adapter.optionalButtonText(),
- buildOptionalAction()
- );
- }
-
- /**
- * @category Add
- */
- protected Button buildRemoveButton(Composite parent) {
- return buildButton(
- parent,
- adapter.removeButtonText(),
- buildRemoveItemsAction()
- );
- }
-
- /**
- * @category Remove
- */
- private Runnable buildRemoveItemsAction() {
- return new Runnable() {
- public void run() {
- AddRemovePane.this.removeItems();
- }
- };
- }
-
- protected ObjectListSelectionModel buildRowSelectionModel(ListValueModel<?> listModel) {
- return new ObjectListSelectionModel(new ListModelAdapter(listModel));
- }
-
- /**
- * @category Option
- */
- protected void editItem() {
- this.adapter.optionOnSelection(getSelectionModel());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- updateButtons();
- }
-
- protected final Composite getContainer() {
- return container;
- }
-
- protected final ILabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- protected final ListValueModel<?> getListHolder() {
- return listHolder;
- }
-
- protected final WritablePropertyValueModel<Object> getSelectedItemHolder() {
- return selectedItemHolder;
- }
-
- public final ObjectListSelectionModel getSelectionModel() {
- return selectionModel;
- }
-
- /**
- * Initializes this add/remove pane.
- *
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- *
- * @category Initialization
- */
- @SuppressWarnings("unchecked")
- protected void initialize(Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider)
- {
- this.listHolder = listHolder;
- this.labelProvider = labelProvider;
- this.adapter = (adapter == null) ? buildAdapter() : adapter;
- this.selectedItemHolder = (WritablePropertyValueModel<Object>) selectedItemHolder;
- this.selectionModel = new ObjectListSelectionModel(new ListModelAdapter(listHolder));
-
- this.listHolder.addListChangeListener(
- ListValueModel.LIST_VALUES,
- buildListChangeListener()
- );
- }
-
- /**
- * Initializes the pane containing the buttons (Add, optional (if required)
- * and Remove).
- *
- * @param container The parent container
- * @param helpId The topic help ID to be registered with the buttons
- *
- * @category Layout
- */
- protected void initializeButtonPane(Composite container, String helpId) {
-
- container = buildSubPane(container);
-
- GridData gridData = new GridData();
- gridData.grabExcessVerticalSpace = true;
- gridData.verticalAlignment = SWT.TOP;
- container.setLayoutData(gridData);
-
- // Add button
- addButton = buildAddButton(container);
- addAlignRight(addButton);
-
- // Optional button
- if (adapter.hasOptionalButton()) {
- optionalButton = buildOptionalButton(container);
- addAlignRight(optionalButton);
- }
-
- // Remove button
- removeButton = buildRemoveButton(container);
- addAlignRight(removeButton);
-
- // Update the help topic ID
- if (helpId != null) {
- helpSystem().setHelp(addButton, helpId);
- helpSystem().setHelp(removeButton, helpId);
-
- if (optionalButton != null) {
- helpSystem().setHelp(optionalButton, helpId);
- }
- }
- }
-
- /**
- * Initializes this add/remove pane by creating the widgets. The subclass is
- * required to build the main widget.
- *
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane
- *
- * @category Layout
- */
- protected void initializeLayout(Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId) {
-
- initializeMainComposite(
- container,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId);
-
- initializeButtonPane(container, helpId);
- enableWidgets(subject() != null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeLayout(Composite container) {
- this.container = buildSubPane(container, 2, 0, 0, 0, 0);
- }
-
- /**
- * Initializes the main widget of this add/remove pane.
- *
- * @param container The parent container
- * @param adapter This <code>Adapter</code> is used to dictacte the behavior
- * of this <code>AddRemovePane</code> and by delegating to it some of the
- * behavior
- * @param listHolder The <code>ListValueModel</code> containing the items
- * @param selectedItemHolder The holder of the selected item, if more than
- * one item or no items are selected, then <code>null</code> will be passed
- * @param labelProvider The renderer used to format the list holder's items
- * @param helpId The topic help ID to be registered with this pane or
- * <code>null</code> if it was not specified
- *
- * @category Layout
- */
- protected abstract void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- WritablePropertyValueModel<?> selectedItemHolder,
- ILabelProvider labelProvider,
- String helpId);
-
- /**
- * @category Remove
- */
- protected void removeItems() {
- adapter.removeSelectedItems(selectionModel);
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateAddButton(Button addButton) {
- addButton.setEnabled(
- getControl().isEnabled() &&
- (subject() != null)
- );
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateButtons() {
- if (!container.isDisposed()) {
- updateAddButton(addButton);
- updateRemoveButton(removeButton);
- updateOptionalButton(optionalButton);
- }
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateOptionalButton(Button optionalButton) {
- if (optionalButton != null) {
- optionalButton.setEnabled(
- getControl().isEnabled() &&
- adapter.enableOptionOnSelectionChange(selectionModel)
- );
- }
- }
-
- /**
- * @category UpdateButtons
- */
- protected void updateRemoveButton(Button removeButton) {
- removeButton.setEnabled(
- getControl().isEnabled() &&
- selectionModel.selectedValue() != null
- );
- }
-
- /**
- * An abstract implementation of <code>Adapter</code>.
- */
- public static abstract class AbstractAdapter implements Adapter {
-
- /**
- * The text of the add button.
- */
- private String addButtonText;
-
- /**
- * Determines whether the optional button should be shown or not.
- */
- private boolean hasOptionalButton;
-
- /**
- * The text of the optional button, if used.
- */
- private String optionalButtonText;
-
- /**
- * The text of the remove button.
- */
- private String removeButtonText;
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- */
- public AbstractAdapter() {
- this(JptUiMessages.AddRemovePane_AddButtonText,
- JptUiMessages.AddRemovePane_RemoveButtonText);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- *
- * @param hasOptionalButton <code>true</code> to show an optional button
- * and to use the behavior related to the optional button;
- * <code>false</code> to not use it
- */
- public AbstractAdapter(boolean hasOptionalButton) {
- this();
- this.setHasOptionalButton(hasOptionalButton);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code> with default text for the
- * add and remove buttons.
- *
- * @param optionalButtonText The text of the optional button, which means
- * the optional button will be shown
- */
- public AbstractAdapter(String optionalButtonText) {
- this(true);
- this.setOptionalButtonText(optionalButtonText);
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code>.
- *
- * @param addButtonText The add button's text
- * @param removeButtonText The remove button's text
- */
- public AbstractAdapter(String addButtonText,
- String removeButtonText) {
-
- super();
- this.addButtonText = addButtonText;
- this.removeButtonText = removeButtonText;
- }
-
- /**
- * Creates a new <code>AbstractAdapter</code>.
- *
- * @param addButtonText The add button's text
- * @param removeButtonText The remove button's text
- * @param optionalButtonText The text of the optional button, which means
- * the optional button will be shown
- */
- public AbstractAdapter(String addButtonText,
- String removeButtonText,
- String optionalButtonText) {
-
- this(optionalButtonText);
- this.setAddButtonText(addButtonText);
- this.setRemoveButtonText(removeButtonText);
- }
-
- /*
- * (non-Javadoc)
- */
- public String addButtonText() {
- return addButtonText;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- return listSelectionModel.selectedValuesSize() == 1;
- }
-
- /*
- * (non-Javadoc)
- */
- public boolean hasOptionalButton() {
- return hasOptionalButton;
- }
-
- /*
- * (non-Javadoc)
- */
- public String optionalButtonText() {
- return optionalButtonText;
- }
-
- /*
- * (non-Javadoc)
- */
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- }
-
- /*
- * (non-Javadoc)
- */
- public String removeButtonText() {
- return removeButtonText;
- }
-
- /**
- * Changes the text of the add button. This method has to be called before
- * the <code>AddRemoveListPane</code> is initialized.
- *
- * @param addButtonText The add button's text
- */
- public void setAddButtonText(String addButtonText) {
- this.addButtonText = addButtonText;
- }
-
- /**
- * Changes the state of the optional button, meaning if it should be shown
- * between the add and remove buttons or not.
- *
- * @param hasOptionalButton <code>true</code> to show an optional button
- * and to use the behavior related to the optional button;
- * <code>false</code> to not use it
- */
- public void setHasOptionalButton(boolean hasOptionalButton) {
- this.hasOptionalButton = hasOptionalButton;
- }
-
- /**
- * Changes the text of the optional button. This method has to be called
- * before the <code>AddRemoveListPane</code> is initialized. This does not
- * make the optional button visible.
- *
- * @param optionalButtonText The optional button's text
- */
- public void setOptionalButtonText(String optionalButtonText) {
- this.optionalButtonText = optionalButtonText;
- }
-
- /**
- * Changes the text of the remove button. This method has to be called
- * before the <code>AddRemoveListPane</code> is initialized.
- *
- * @param removeButtonText The remove button's text
- */
- public void setRemoveButtonText(String removeButtonText) {
- this.removeButtonText = removeButtonText;
- }
- }
-
- /**
- * This adapter is used to perform the actual action when adding a new item
- * or removing the selected items. It is possible to add an optional button.
- */
- public static interface Adapter {
-
- /**
- * The add button's text.
- *
- * @return The text shown on the add button
- */
- String addButtonText();
-
- /**
- * Invoked when the user selects the Add button.
- */
- void addNewItem(ObjectListSelectionModel listSelectionModel);
-
- /**
- * Invoked when selection changes. Implementation dictates whether button
- * should be enabled.
- */
- boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel);
-
- /**
- * Determines whether an optional button should be added between the add
- * and remove buttons.
- *
- * @return <code>true</code> to show an optional button and to use the
- * behavior related to the optional button; <code>false</code> to not use
- * it
- */
- boolean hasOptionalButton();
-
- /**
- * Resource string key for the optional button.
- */
- String optionalButtonText();
-
- /**
- * Invoked when the user selects the optional button
- */
- void optionOnSelection(ObjectListSelectionModel listSelectionModel);
-
- /**
- * The remove button's text.
- *
- * @return The text shown on the remove button
- */
- String removeButtonText();
-
- /**
- * Invoked when the user selects the Remove button.
- */
- void removeSelectedItems(ObjectListSelectionModel listSelectionModel);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java
deleted file mode 100644
index e4ccca8142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/DefaultWidgetFactory.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * This <code>IWidgetFactory</code> simply creates plain SWT widgets.
- *
- * @version 2.0
- * @since 2.0
- */
-public final class DefaultWidgetFactory implements WidgetFactory {
-
- /**
- * The singleton instance of this <code>IWidgetFactory</code>
- */
- private static final WidgetFactory INSTANCE = new DefaultWidgetFactory();
-
- /**
- * Creates a new <code>DefaultWidgetFactory</code>.
- */
- private DefaultWidgetFactory() {
- super();
- }
-
- /**
- * Returns the singleton instance of this <code>IWidgetFactory</code>.
- *
- * @return The singleton instance of this <code>IWidgetFactory</code>
- */
- public static WidgetFactory instance() {
- return INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.NULL);
- }
-
- private Button createButton(Composite parent, String text, int style) {
- Button button = new Button(parent, style);
- button.setText(text);
- return button;
- }
-
- /*
- * (non-Javadoc)
- */
- public CCombo createCCombo(Composite parent) {
- return new CCombo(parent, SWT.BORDER | SWT.READ_ONLY);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createCheckBox(Composite parent, String text) {
- return this.createButton(parent, text, SWT.CHECK);
- }
-
- /*
- * (non-Javadoc)
- */
- public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- }
-
- /*
- * (non-Javadoc)
- */
- public Composite createComposite(Composite parent) {
- return new Composite(parent, SWT.NULL);
- }
-
- /*
- * (non-Javadoc)
- */
- public CCombo createEditableCCombo(Composite parent) {
- return new CCombo(parent, SWT.BORDER);
- }
-
- /*
- * (non-Javadoc)
- */
- public Combo createEditableCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER);
- }
-
- /*
- * (non-Javadoc)
- */
- public Group createGroup(Composite parent, String title) {
- Group group = new Group(parent, SWT.NULL);
- group.setText(title);
- return group;
- }
-
- /*
- * (non-Javadoc)
- */
- public Hyperlink createHyperlink(Composite parent, String text) {
- Hyperlink hyperlink = new Hyperlink(parent, SWT.NULL);
- hyperlink.setText(text);
- return hyperlink;
- }
-
- /*
- * (non-Javadoc)
- */
- public Label createLabel(Composite parent, String labelText) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(labelText);
- return label;
- }
-
- /*
- * (non-Javadoc)
- */
- public List createList(Composite parent, int style) {
- return new List(parent, SWT.BORDER | style);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createPushButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.PUSH);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createRadioButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.RADIO);
- }
-
- /*
- * (non-Javadoc)
- */
- public Section createSection(Composite parent, int style) {
- return new Section(parent, style);
- }
-
- /*
- * (non-Javadoc)
- */
- public Text createText(Composite parent) {
- return new Text(parent, SWT.BORDER);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createTriStateCheckBox(Composite parent, String text) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
- return checkBox.getCheckBox();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java
deleted file mode 100644
index bc85479931..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumDialogComboViewer.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>EnumComboViewer</code> should be used within a dialog pane.
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class EnumDialogComboViewer<T extends Model, V> extends AbstractEnumComboViewer<T, V>
-{
- /**
- * Creates a new <code>EnumDialogComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumDialogComboViewer(AbstractDialogPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EnumDialogComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumDialogComboViewer(AbstractDialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>EnumDialogComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumDialogComboViewer(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- ComboViewer buildComboViewer(Composite container) {
- return buildComboViewer(container, buildLabelProvider());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
-
- super.enableWidgets(enabled);
-
- Combo combo = getCombo();
-
- if (combo.isDisposed()) {
- combo.setEnabled(enabled);
- }
- }
-
- protected final Combo getCombo() {
- return getComboViewer().getCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- void removeAll() {
- getCombo().removeAll();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- void updateCursor() {
- getCombo().setSelection(new Point(0, 0));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java
deleted file mode 100644
index 39aa111079..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/EnumFormComboViewer.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>EnumComboViewer</code> should be used within a form pane.
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class EnumFormComboViewer<T extends Model, V> extends AbstractEnumComboViewer<T, V>
-{
- /**
- * Creates a new <code>EnumFormComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumFormComboViewer(AbstractFormPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>EnumFormComboViewer</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumFormComboViewer(AbstractFormPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>EnumFormComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- protected EnumFormComboViewer(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- ComboViewer buildComboViewer(Composite container) {
- return buildCComboViewer(container, buildLabelProvider());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
-
- super.enableWidgets(enabled);
-
- CCombo combo = getCombo();
-
- if (combo.isDisposed()) {
- combo.setEnabled(enabled);
- }
- }
-
- protected final CCombo getCombo() {
- return this.getComboViewer().getCCombo();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- void removeAll() {
- getCombo().removeAll();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- void updateCursor() {
- getCombo().setSelection(new Point(0, 0));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java
deleted file mode 100644
index 668c8a446b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FormWidgetFactory.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-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.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- * This <code>IWidgetFactory</code> is responsible to create the widgets
- * using the <code>TabbedPropertySheetWidgetFactory</code> in order use the
- * form style (flat-style) look and feel.
- *
- * @see TabbedPropertySheetWidgetFactory
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public final class FormWidgetFactory implements WidgetFactory {
-
- /**
- * The actual factory responsible for creating the new widgets.
- */
- private final TabbedPropertySheetWidgetFactory widgetFactory;
-
- /**
- * Creates a new <code>FormWidgetFactory</code>.
- *
- * @param widgetFactory The actual factory responsible for creating the new
- * widgets
- */
- public FormWidgetFactory(TabbedPropertySheetWidgetFactory widgetFactory) {
- super();
-
- Assert.isNotNull(widgetFactory, "The widget factory cannot be null");
- this.widgetFactory = widgetFactory;
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.NULL);
- }
-
- private Button createButton(Composite parent, String text, int style) {
- return widgetFactory.createButton(parent, text, SWT.FLAT | style);
- }
-
- /*
- * (non-Javadoc)
- */
- public CCombo createCCombo(Composite parent) {
- return createCombo(parent, SWT.READ_ONLY);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createCheckBox(Composite parent, String text) {
- return this.createButton(parent, text, SWT.CHECK);
- }
-
- /*
- * (non-Javadoc)
- */
- public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY);
- }
-
- private CCombo createCombo(Composite parent, int style) {
- parent = fixComboBorderNotPainted(parent);
- return widgetFactory.createCCombo(parent, SWT.FLAT | style);
- }
-
- /*
- * (non-Javadoc)
- */
- public Composite createComposite(Composite parent) {
- return widgetFactory.createComposite(parent);
- }
-
- /*
- * (non-Javadoc)
- */
- public CCombo createEditableCCombo(Composite parent) {
- return createCombo(parent, SWT.NULL);
- }
-
- /*
- * (non-Javadoc)
- */
- public Combo createEditableCombo(Composite parent) {
- return new Combo(parent, SWT.FLAT);
- }
-
- /*
- * (non-Javadoc)
- */
- public Group createGroup(Composite parent, String title) {
- return widgetFactory.createGroup(parent, title);
- }
-
- /*
- * (non-Javadoc)
- */
- public Hyperlink createHyperlink(Composite parent, String text) {
- return widgetFactory.createHyperlink(parent, text, SWT.FLAT);
- }
-
- /*
- * (non-Javadoc)
- */
- public Label createLabel(Composite container, String labelText) {
- return widgetFactory.createLabel(container, labelText);
- }
-
- /*
- * (non-Javadoc)
- */
- public List createList(Composite container, int style) {
- return widgetFactory.createList(container, SWT.FLAT | style);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createPushButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.PUSH);
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createRadioButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.RADIO);
- }
-
- /*
- * (non-Javadoc)
- */
- public Section createSection(Composite parent, int style) {
- return widgetFactory.createSection(parent, SWT.FLAT | style);
- }
-
- /*
- * (non-Javadoc)
- */
- public Text createText(Composite parent) {
- parent = fixTextBorderNotPainted(parent);
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
-
- Text text = widgetFactory.createText(parent, null, SWT.FLAT);
- text.setLayoutData(gridData);
-
- return text;
- }
-
- /*
- * (non-Javadoc)
- */
- public Button createTriStateCheckBox(Composite parent, String text) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
- return checkBox.getCheckBox();
- }
-
- /**
- * Wraps the given <code>Composite</code> into a new <code>Composite</code>
- * in order to have the widgets' border painted. This must be a bug in the
- * <code>GridLayout</code> used in a form.
- *
- * @param container The parent of the sub-pane with 1 pixel border
- * @return A new <code>Composite</code> that has the necessary space to paint
- * the border
- */
- private Composite fixComboBorderNotPainted(Composite container) {
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 1;
- layout.marginLeft = 1;
- layout.marginBottom = 1;
- layout.marginRight = 1;
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
-
- container = widgetFactory.createComposite(container);
- container.setLayoutData(gridData);
- container.setLayout(layout);
-
- return container;
- }
-
- /**
- * Wraps the given <code>Composite</code> into a new <code>Composite</code>
- * in order to have the widgets' border painted. This must be a bug in the
- * <code>GridLayout</code> used in a form.
- *
- * @param container The parent of the sub-pane with 2 pixel border
- * @return A new <code>Composite</code> that has the necessary space to paint
- * the border
- */
- private Composite fixTextBorderNotPainted(Composite container) {
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 2;
- layout.marginLeft = 2;
- layout.marginBottom = 2;
- layout.marginRight = 2;
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
-
- container = widgetFactory.createComposite(container);
- container.setLayoutData(gridData);
- container.setLayout(layout);
-
- return container;
- }
-
- /**
- * Returns the actual factory responsible for creating the new widgets.
- *
- * @return The factory creating the widgets with the form style (flat-style)
- */
- public TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return widgetFactory;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/NullPostExecution.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/NullPostExecution.java
deleted file mode 100644
index 1f5edba3ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/NullPostExecution.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * A <code>null</code> instance of <code>PostExecution</code>.
- *
- * @version 2.0
- * @since 1.0
- */
-public final class NullPostExecution implements PostExecution<Dialog> {
-
- /**
- * The singleton instance of this <code>NullPostExecution</code>.
- */
- private static PostExecution<Dialog> INSTANCE;
-
- /**
- * Creates a new <code>NullPostExecution</code>.
- */
- private NullPostExecution() {
- super();
- }
-
- /**
- * Returns the singleton instance of this <code>NullPostExecution</code>.
- *
- * @param <T> The dialog where this <code>PostExecution</code> will be used
- * @return The singleton instance with the proper type
- */
- @SuppressWarnings("unchecked")
- public static synchronized <T extends Dialog> PostExecution<T> instance() {
-
- if (INSTANCE == null) {
- INSTANCE = new NullPostExecution();
- }
-
- return (PostExecution<T>) INSTANCE;
- }
-
- /*
- * (non-Javadoc)
- */
- public void execute(Dialog dialog) {
- // Nothing to do
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/PostExecution.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/PostExecution.java
deleted file mode 100644
index 0b6b920ba1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/PostExecution.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * This <code>PostExecution</code> is used to post execute a portion of code
- * once a dialog, that was launched into a different UI thread, has been
- * disposed.
- *
- * @version 2.0
- * @since 1.0
- */
-public interface PostExecution<T extends Dialog> {
-
- /**
- * Notifies this post exection the dialog that was launched into a different
- * UI thread has been disposed.
- *
- * @param dialog The dialog that was launched into a different thread
- */
- public void execute(T dialog);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/TriStateCheckBox.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/TriStateCheckBox.java
deleted file mode 100644
index 6e77b469b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/TriStateCheckBox.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.swt.events.DisposeListener;
-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.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This <code>TriStateCheckBox</code> can display one of three states:
- * unchecked, checked, or partially checked. It can be modified via a mouse
- * selection, via a keyboard selection, or programmatically. The selection state is
- * represented by a <code>Boolean</code> value where a <code>null</code>
- * value means partially checked.
- * <p>
- * The order of state changes is: unchecked -> partially checked -> checked.
- *
- * @version 2.0
- * @since 2.0
- */
-public final class TriStateCheckBox
-{
- /**
- * A check box button.
- */
- private final Button button;
-
- /**
- * The current selection state.
- */
- private TriState state;
-
- /**
- * Creates a new <code>TriStateCheckBox</code> with no text.
- *
- * @param parent The parent composite
- * @param widgetFactory The factory used to create the check box
- */
- public TriStateCheckBox(Composite parent, WidgetFactory widgetFactory) {
- this(parent, null, widgetFactory);
- }
-
- /**
- * Creates a new <code>TriStateCheckBox</code>.
- *
- * @param parent The parent composite
- * @param text The check box's text
- * @param widgetFactory The factory used to create the check box
- */
- public TriStateCheckBox(Composite parent,
- String text,
- WidgetFactory widgetFactory) {
- super();
- this.state = TriState.UNCHECKED;
- this.button = widgetFactory.createCheckBox(parent, text);
- this.button.addSelectionListener(this.buildSelectionListener());
- }
-
- /**
- * Convenience method: Adds a dispose listener to the check box.
- * The source of any events sent to the listener will be the check box widget.
- */
- public void addDisposeListener(DisposeListener disposeListener) {
- this.button.addDisposeListener(disposeListener);
- }
-
- /**
- * Convenience method: Adds a selection listener to the check box.
- * The source of any events sent to the listener will be the check box widget.
- */
- public void addSelectionListener(SelectionListener selectionListener) {
- this.button.addSelectionListener(selectionListener);
- }
-
- private SelectionListener buildSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- TriStateCheckBox.this.checkBoxClicked();
- }
- };
- }
-
- /**
- * The check box was clicked, change the tri-state to the next value and
- * update the check box's state.
- */
- void checkBoxClicked() {
- this.state = this.nextState();
- this.updateCheckBox();
- }
-
- /**
- * Disposes the check box widget.
- */
- public void dispose() {
- this.button.dispose();
- }
-
- /**
- * Returns the <code>Button</code> used to show a tri-state check box.
- *
- * @return The <code>Button</code> used to show a tri-state check box
- */
- public Button getCheckBox() {
- return this.button;
- }
-
- /**
- * Returns the check box's image.
- *
- * @return The check box's image.
- */
- public Image getImage() {
- return this.button.getImage();
- }
-
- /**
- * Returns the check box's selection state.
- *
- * @return Either <code>true</code> or <code>false</code> for checked or
- * unchecked; or <code>null</code> for partially selected
- */
- public Boolean getSelection() {
- return (this.state == TriState.PARTIALLY_CHECKED) ? null : Boolean.valueOf(this.state == TriState.CHECKED);
- }
-
- /**
- * Returns the check box's text.
- *
- * @return The text of the check box
- */
- public String getText() {
- return this.button.getText();
- }
-
- /**
- * Returns whether the check box is disposed.
- *
- * @return <code>true</code> if the check box is disposed; <code>false</code>
- * otherwise
- */
- public boolean isDisposed() {
- return this.button.isDisposed();
- }
-
- /**
- * Returns whether the check box is enabled.
- *
- * @return <code>true</code> if the check box is enabled; <code>false</code>
- * otherwise
- */
- public boolean isEnabled() {
- return this.button.isEnabled();
- }
-
- /**
- * Returns the next state:
- * UNCHECKED -> PARTIALLY_CHECKED
- * PARTIALLY_CHECKED -> CHECKED
- * CHECKED -> UNCHECKED
- */
- private TriState nextState() {
- switch (this.state) {
- case UNCHECKED:
- return TriState.PARTIALLY_CHECKED;
- case PARTIALLY_CHECKED:
- return TriState.CHECKED;
- case CHECKED:
- return TriState.UNCHECKED;
- default:
- throw new IllegalStateException("unknown state: " + this.state);
- }
- }
-
- /**
- * Convenience method: Removes a dispose listener from the check box.
- */
- public void removeDisposeListener(DisposeListener disposeListener) {
- this.button.removeDisposeListener(disposeListener);
- }
-
- /**
- * Convenience method: Removes a selection listener from the check box.
- */
- public void removeSelectionListener(SelectionListener selectionListener) {
- this.button.removeSelectionListener(selectionListener);
- }
-
- /**
- * Changes the check box's enablement state.
- *
- * @param enabled <code>true</code> to enable the check box or <code>false</code>
- * to disable it
- */
- public void setEnabled(boolean enabled) {
- this.button.setEnabled(enabled);
- }
-
- /**
- * Sets the check box's image.
- *
- * @param image The new image of the check box
- */
- public void setImage(Image image) {
- this.button.setImage(image);
- }
-
- /**
- * Changes the check box's selection state.
- *
- * @param selection Either <code>true</code> or <code>false</code> for
- * checked and unchecked; or <code>null</code> for partially selected
- */
- public void setSelection(Boolean selection) {
- TriState old = this.state;
- this.state = this.stateForBoolean(selection);
- if (old != this.state) {
- this.updateCheckBox();
- }
- }
-
- /**
- * Sets the check box's text.
- *
- * @param text The new text of the check box
- */
- public void setText(String text) {
- this.button.setText(text);
- }
-
- /**
- * Returns the tri-state corresponding to the boolean.
- *
- * @param selection The boolean to be converted to a tri-state
- */
- private TriState stateForBoolean(Boolean selection) {
- return (selection == null) ? TriState.PARTIALLY_CHECKED :
- selection.booleanValue() ? TriState.CHECKED : TriState.UNCHECKED;
- }
-
- /**
- * Updates the selection state of the of the check box based on the tri-state
- * value.
- */
- void updateCheckBox() {
- switch (this.state) {
- case UNCHECKED:
- this.button.setSelection(false);
- this.button.setGrayed(false);
- break;
- case PARTIALLY_CHECKED:
- this.button.setSelection(true);
- this.button.setGrayed(true);
- break;
- case CHECKED:
- this.button.setSelection(true);
- this.button.setGrayed(false);
- break;
- default:
- throw new IllegalStateException("unknown state: " + this.state);
- }
- }
-
- /**
- * An enum containing the possible selections.
- */
- enum TriState {
- CHECKED,
- PARTIALLY_CHECKED,
- UNCHECKED
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/WidgetFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/WidgetFactory.java
deleted file mode 100644
index 689f670f59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/WidgetFactory.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.widgets;
-
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Hyperlink;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * A widget factory is responsible for creating an SWT widget based on the right
- * style. Some style shows the widgets differently, for instance, the flat style
- * shows the widgets with less borders.
- *
- * @version 2.0
- * @since 2.0
- */
-public interface WidgetFactory {
-
- /**
- * Creates a new regular button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createButton(Composite parent, String text);
-
- /**
- * Creates a new non-editable custom <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>CCombo</code>
- */
- CCombo createCCombo(Composite parent);
-
- /**
- * Creates a new check box button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createCheckBox(Composite parent, String text);
-
- /**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
- */
- Combo createCombo(Composite parent);
-
- /**
- * Creates a new container.
- *
- * @param parent The parent container
- * @return A new <code>Composite</code>
- */
- Composite createComposite(Composite parent);
-
- /**
- * Creates a new editable custom <code>CCombo</code>.
- *
- * @param parent The parent container
- * @return A new <code>CCombo</code>
- */
- CCombo createEditableCCombo(Composite parent);
-
- /**
- * Creates a new editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
- */
- Combo createEditableCombo(Composite parent);
-
- /**
- * Creates a new titled pane (group box).
- *
- * @param parent The parent container
- * @param title The group pane's title
- * @return A new <code>Group</code>
- */
- Group createGroup(Composite parent, String title);
-
- /**
- * Creates a new label that is shown as a hyperlink.
- *
- * @param parent The parent container
- * @param text The label's text
- * @return A new <code>Hyperlink</code>
- */
- Hyperlink createHyperlink(Composite parent, String text);
-
- /**
- * Creates a new label.
- *
- * @param container The parent container
- * @param labelText The label's text
- * @return A new <code>Label</code>
- */
- Label createLabel(Composite container, String labelText);
-
- /**
- * Creates a new list.
- *
- * @param container The parent container
- * @param style The style is usually to tell what type of selection
- * (<code>SWT.MULTI</code> or <code>SWT.SINGLE</code>)
- * @return A new <code>Label</code>
- */
- List createList(Composite container, int style);
-
- /**
- * Creates a new push button (toggle between selected and unselected).
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createPushButton(Composite parent, String text);
-
- /**
- * Creates a new radio button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
- */
- Button createRadioButton(Composite parent, String text);
-
- /**
- * Creates a new section, which is a collapsable pane with a title bar.
- *
- * @param parent The parent container
- * @param style The style of the title bar, which can be
- * <code>ExpandableComposite.TWISTIE</code> and
- * <code>ExpandableComposite.TITLE_BAR</code>
- * @return A new <code>Section</code>
- */
- Section createSection(Composite parent, int style);
-
- /**
- * Creates a new editable text field.
- *
- * @param container The parent container
- * @return A new <code>Text</code>
- */
- Text createText(Composite parent);
-
- /**
- * Creates a new tri-state check box.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code> that has 3 selection states
- */
- Button createTriStateCheckBox(Composite parent, String text);
-}
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 4e1c056322..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/DatabaseReconnectWizardPage.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.internal.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.JpaProject;
-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.JpaHelpContextIds;
-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 JpaProject jpaProject;
-
- private ConnectionProfile profile;
- private ConnectionListener connectionListener;
-
- public DatabaseReconnectWizardPage( JpaProject 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);
- new DatabaseGroup( composite);
- Dialog.applyDialogFont( parent);
- // TODO Add Help - testing
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, JpaHelpContextIds.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.getDefaultSchema();
- 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()));
- }
-
- @Override
- public void dispose() {
- this.removeConnectionListener();
- super.dispose();
- }
-
- private void removeConnectionListener() {
- if ( this.connectionListener != null) {
- if ( this.profile != null) {
- this.profile.removeConnectionListener( this.connectionListener);
- }
- this.connectionListener = null;
- }
- }
-
-
- ConnectionProfile getProjectConnectionProfile() {
- String profileName = this.jpaProject.dataSource().connectionProfileName();
- return JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( profileName);
- }
-
- Schema getDefaultSchema() {
- return getProjectConnectionProfile().defaultSchema();
- }
-
- // ********** member classes **********
-
- private final class DatabaseGroup {
- private final Group group;
- private final Combo connectionCombo;
- private final Combo schemaCombo;
-
- 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);
- createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_connection);
- this.connectionCombo = createCombo( this.group, true);
- this.connectionCombo.addSelectionListener( new SelectionAdapter() {
- @Override
- public void widgetDefaultSelected( SelectionEvent e) {
- widgetSelected( e);
- }
-
- @Override
- public void widgetSelected( SelectionEvent e) {
- handleConnectionChange();
- }
- });
- createLabel( this.group, 1, JptUiMessages.DatabaseReconnectWizardPage_schema);
- this.schemaCombo = createCombo( this.group, true);
- this.schemaCombo.addSelectionListener( new SelectionAdapter() {
- @Override
- public void widgetDefaultSelected( SelectionEvent e) {
- widgetSelected( e);
- }
-
- @Override
- public void widgetSelected( SelectionEvent e) {
- handleSchemaChange();
- }
- });
- 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() {
- @Override
- 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() {
- @Override
- 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.dataSource().connectionProfileName();
- }
-
- Schema getDefaultSchema() {
- return getProjectConnectionProfile().defaultSchema();
- }
-
- private void openConnectionProfileNamed( String connectionProfileName) {
- DatabaseReconnectWizardPage.this.removeConnectionListener();
-
- DatabaseReconnectWizardPage.this.profile = JptDbPlugin.getDefault().getConnectionProfileRepository().profileNamed( connectionProfileName);
- DatabaseReconnectWizardPage.this.profile.connect();
- if( DatabaseReconnectWizardPage.this.profile.isConnected()) {
- this.populateSchemaCombo();
- DatabaseReconnectWizardPage.this.connectionListener = this.buildConnectionListener();
- DatabaseReconnectWizardPage.this.profile.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(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(stream.next());
- }
- // set login user name as default schema
- Schema schema = this.getDefaultSchema();
- 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()) {
- addedProfile.connect();
- this.populateConnectionCombo();
- this.connectionCombo.select( connectionCombo.indexOf( addedProfile.getName()));
- this.handleConnectionChange();
- }
- }
-
- private ConnectionListener buildConnectionListener() {
- return new ConnectionListener() {
-
- public void modified( ConnectionProfile profile) {
- // not interested to this event.
- }
-
- public boolean okToClose( ConnectionProfile profile) {
- // not interested to this event.
- return true;
- }
-
- public void opened( ConnectionProfile profile) {
- if( DatabaseReconnectWizardPage.this.profile.equals( profile)) {
- DatabaseGroup.this.populateSchemaCombo();
- }
- }
-
- public void aboutToClose( ConnectionProfile profile) {
- if( DatabaseReconnectWizardPage.this.profile.equals( profile)) {
- DatabaseReconnectWizardPage.this.removeConnectionListener();
- }
- }
-
- public void closed( ConnectionProfile profile) {
- // not interested to this event.
- }
-
- public void databaseChanged(ConnectionProfile profile, final Database database) {
- // not interested to this event.
- }
-
- public void schemaChanged(ConnectionProfile profile, final Schema schema) {
- // not interested to this event.
- }
-
- public void tableChanged(ConnectionProfile profile, 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 4f9be9c803..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizard.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.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.JpaProject;
-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 JpaProject 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( JpaProject 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);
- }
-
- @Override
- public void addPages() {
- super.addPages();
- this.dbSettingsPage = new DatabaseReconnectWizardPage( this.jpaProject);
- this.addPage(this.dbSettingsPage);
- this.generateEntitiesPage = new GenerateEntitiesWizardPage();
- this.addPage( this.generateEntitiesPage);
- this.generateEntitiesPage.init( this.selection);
- }
-
- @Override
- 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.projectDefaultSchemaExists()) ? CollectionTools.collection( this.getDefaultSchema().tables()) : Collections.<Table>emptyList();
- }
-
- ConnectionProfile getProjectConnectionProfile() {
- return this.jpaProject.connectionProfile();
- }
-
- JpaProject getJpaProject(){
- return this.jpaProject;
- }
-
- Schema getDefaultSchema() {
- return getProjectConnectionProfile().defaultSchema();
- }
-
- 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;
- }
-
- @Override
- public boolean canFinish() {
- boolean canFinish = true;
- if ( ! this.generateEntitiesPage.isPageComplete()) {
- canFinish = false;
- }
- return canFinish;
- }
-
- private boolean projectDefaultSchemaExists() {
- return ( this.getDefaultSchema() != 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 8df694ef16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/GenerateEntitiesWizardPage.java
+++ /dev/null
@@ -1,507 +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.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.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.util.TableLayoutComposite;
-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, JpaHelpContextIds.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().discoversAnnotatedClasses());
- setSynchronizePersistenceXml(synchronizeClassesCheckBox.getSelection());
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this.tableTable.getControl(), JpaHelpContextIds.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 = 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;
- }
-
- boolean fieldAccessType() {
- return this.fieldAccessType;
- }
-
- String getCollectionTypeName() {
- return this.collectionTypeName;
- }
-
- int getFieldVisibility() {
- return this.fieldVisibility;
- }
-
- int getMethodVisibility() {
- return this.methodVisibility;
- }
-
- boolean generateGettersAndSetters() {
- return this.generateGettersAndSetters;
- }
-
- boolean generateDefaultConstructor() {
- return this.generateDefaultConstructor;
- }
-
- boolean serializable() {
- return this.serializable;
- }
-
- boolean generateSerialVersionUID() {
- return this.generateSerialVersionUID;
- }
-
- boolean generateEmbeddedIdForCompoundPK() {
- return this.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 73edc5f566..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java
+++ /dev/null
@@ -1,494 +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.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.db.internal.ConnectionProfileRepository;
-import org.eclipse.jpt.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-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.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.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
-
-public class JpaFacetWizardPage
- extends DataModelFacetInstallPage
- implements JpaFacetDataModelProperties
-{
-
- 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);
-
- new PlatformGroup(composite);
- new ConnectionGroup(composite);
- new ClasspathConfigGroup(composite);
- new PersistentClassManagementGroup(composite);
- new OrmXmlGroup(composite);
-
- setUpRuntimeListener();
-
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.DIALOG_JPA_FACET);
-
- return composite;
- }
-
- private void setUpRuntimeListener() {
- final IFacetedProjectWorkingCopy wc = ( (ModifyFacetedProjectWizard) getWizard() ).getFacetedProjectWorkingCopy();
- // must do it manually the first time
- model.setProperty(RUNTIME, wc.getPrimaryRuntime());
- wc.addListener(
- new IFacetedProjectListener() {
- public void handleEvent( final IFacetedProjectEvent event ) {
- model.setProperty(RUNTIME, wc.getPrimaryRuntime());
- }
- },
- IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED
- );
- }
-
- 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, JpaHelpContextIds.DIALOG_JPA_PLATFORM);
-
- platformCombo = new ComboViewer(createCombo(group, 1, true));
- platformCombo.setContentProvider(
- new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return CollectionTools.array(JpaPlatformRegistry.instance().jpaPlatformIds());
- }
-
- 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().jpaPlatformLabel((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, JpaHelpContextIds.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 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, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- boolean useServerLib = model.getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION);
-
- useServerLibButton = createButton(group, 2, JptUiMessages.JpaFacetWizardPage_userServerLibLabel, SWT.RADIO);
- useServerLibButton.setSelection(useServerLib);
- 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.setSelection(! useServerLib);
- 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, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- boolean discoverClasses = model.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES);
-
- discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO);
- discoverClassesButton.setSelection(discoverClasses);
- 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.setSelection(! discoverClasses);
- 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, JpaHelpContextIds.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 b11156e277..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.JpaHelpContextIds;
-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(JpaHelpContextIds.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 770ba44c6c..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.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-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/java/details/AttributeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/AttributeMappingUiProvider.java
deleted file mode 100644
index 182b4dff8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/AttributeMappingUiProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.java.details;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface AttributeMappingUiProvider<T extends AttributeMapping>
-{
- /**
- * A unique string that corresponds to the key of a MappingProvider in the core
- * (IJavaAttributeMappingProvider and/or IXmlAttributeMappingProvider)
- */
- String attributeMappingKey();
-
- /**
- * 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 factory
- * @param parent
- * @param widgetFactory
- *
- * @return
- */
- JpaComposite<T> buildAttributeMappingComposite(
- JpaUiFactory factory,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory);
-
- /**
- * A label to be displayed to the label as an option in the mapping type combo box
- * @return
- */
- String label();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/TypeMappingUiProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/TypeMappingUiProvider.java
deleted file mode 100644
index fbd12412fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/java/details/TypeMappingUiProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.java.details;
-
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TypeMappingUiProvider<T extends TypeMapping>
-{
- /**
- * A unique string that corresponds to the key of a MappingProvider in the core
- */
- String mappingKey();
-
- /**
- * 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 widgetFactory
- * @return
- */
- JpaComposite<T> buildPersistentTypeMappingComposite(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- TabbedPropertySheetWidgetFactory widgetFactory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.classpath b/jpa/plugins/org.eclipse.jpt.utility/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.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.utility/.cvsignore b/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
deleted file mode 100644
index a128605b1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-@dot
-temp.folder
-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 8e5b2c2b65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:22 EST 2008
-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 82f606ead2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility
-Bundle-Version: 1.2.0.qualifier
-Bundle-Localization: plugin
-Export-Package: org.eclipse.jpt.utility,
- org.eclipse.jpt.utility.internal;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.iterators;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.listener.awt;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value.prefs;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value.swing;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.node;x-friends:="org.eclipse.jpt.core,org.eclipse.jpt.db,org.eclipse.jpt.db.ui,org.eclipse.jpt.gen,org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.model,
- org.eclipse.jpt.utility.model.event,
- org.eclipse.jpt.utility.model.listener,
- org.eclipse.jpt.utility.model.value
-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/Command.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java
deleted file mode 100644
index ffabf124af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility;
-
-/**
- * Simple interface for implementing the GOF Command design pattern.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Command {
-
- /**
- * Execute the command. The semantics of the command
- * is determined by the contract between the client and server.
- */
- void execute();
-
- final class Null implements Command {
- public static final Command INSTANCE = new Null();
- public static Command instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void execute() {
- // do nothing
- }
- @Override
- public String toString() {
- return "Command.Null";
- }
- }
-
- final class Disabled implements Command {
- public static final Command INSTANCE = new Disabled();
- public static Command instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public void execute() {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Command.Disabled";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java
deleted file mode 100644
index f58dbf6674..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility;
-
-/**
- * This interface allows clients to control how a command is executed
- * (e.g. dispatching the command to the UI thread).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface CommandExecutor {
-
- /**
- * Execute the specified command.
- */
- void execute(Command command);
-
-
- /**
- * Straightforward implementation of the command executor interface
- * that simply executes the command without any sort of enhancement.
- */
- final class Default implements CommandExecutor {
- public static final CommandExecutor INSTANCE = new Default();
- public static CommandExecutor instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public void execute(Command command) {
- command.execute();
- }
- @Override
- public String toString() {
- return "CommandExecutor.Default";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java
deleted file mode 100644
index 7e30cf7771..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutorProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility;
-
-/**
- * Yet another level of indirection to allow clients to control
- * how a command is executed by the server
- * (e.g. dispatching the command to the UI thread).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface CommandExecutorProvider {
-
- /**
- * Return the appropriate command executor.
- */
- CommandExecutor commandExecutor();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java
deleted file mode 100644
index b88c7f9a29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility;
-
-/**
- * Used by various "pluggable" classes to filter objects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface 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";
- }
- }
-
- final class Disabled<S> implements Filter<S> {
- @SuppressWarnings("unchecked")
- public static final Filter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public boolean accept(S next) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Filter.Disabled";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java
deleted file mode 100644
index 8ffa61d1d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-/**
- * Implement some of the methods in Association that can
- * be defined in terms of the other methods.
- */
-public abstract class AbstractAssociation<K, V>
- implements Association<K, V>
-{
-
- /**
- * Default constructor.
- */
- protected AbstractAssociation() {
- super();
- }
-
- @Override
- public synchronized boolean equals(Object o) {
- if ( ! (o instanceof Association)) {
- return false;
- }
- Association<?, ?> other = (Association<?, ?>) o;
- return (this.key() == null ?
- other.key() == null : this.key().equals(other.key()))
- && (this.value() == null ?
- other.value() == null : this.value().equals(other.value()));
- }
-
- @Override
- public synchronized int hashCode() {
- return (this.key() == null ? 0 : this.key().hashCode())
- ^ (this.value() == null ? 0 : this.value().hashCode());
- }
-
- @Override
- public synchronized String toString() {
- return this.key() + " => " + this.value();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java
deleted file mode 100644
index 03130e89be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-/**
- * Straightforward definition of an object pairing.
- * The key is immutable.
- */
-public interface Association<K, V> {
-
- /**
- * Return the association's key.
- */
- K key();
-
- /**
- * Return the association's value.
- */
- V value();
-
- /**
- * Set the association's value.
- * Return the previous value.
- */
- V setValue(V value);
-
- /**
- * Return true if both the associations' keys and values
- * are equal.
- */
- boolean equals(Object o);
-
- /**
- * Return a hash code based on the association's
- * key and value.
- */
- int hashCode();
-
-}
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 75905c81d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * 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.
- *
- * @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();
-
- /**
- * Return the number of times the specified object occurs in the bag.
- */
- int count(Object o);
-
- /**
- * Add the specified object the specified number of times to the bag.
- */
- boolean add(E o, int count);
-
- /**
- * Remove the specified number of occurrences of the specified object
- * from the bag. Return whether the bag changed.
- */
- boolean remove(Object o, int count);
-
- /**
- * 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.
- */
- java.util.Iterator<E> uniqueIterator();
-
-
- final class Empty<E> extends AbstractCollection<E> implements Bag<E>, Serializable {
- @SuppressWarnings("unchecked")
- public static final Bag INSTANCE = new Empty();
- @SuppressWarnings("unchecked")
- public static <T> Bag<T> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- @Override
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
- @Override
- public int size() {
- return 0;
- }
- public Iterator<E> uniqueIterator() {
- return EmptyIterator.instance();
- }
- public int count(Object o) {
- return 0;
- }
- public boolean remove(Object o, int count) {
- return false;
- }
- public boolean add(E o, int count) {
- throw new UnsupportedOperationException();
- }
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof Bag)) {
- return false;
- }
- return ((Bag<?>) o).size() == 0;
- }
- @Override
- public int hashCode() {
- return 0;
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java
deleted file mode 100644
index d102f9e267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import org.eclipse.jpt.utility.Filter;
-
-/**
- * Used by various "pluggable" classes to filter objects
- * in both directions.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiFilter<T> extends Filter<T> {
-
- /**
- * Return whether the specified object is "accepted" by the
- * "reverse" filter. What that means is determined by the client.
- */
- boolean reverseAccept(T o);
-
-
- final class Null<S> implements BidiFilter<S> {
- @SuppressWarnings("unchecked")
- public static final BidiFilter INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> BidiFilter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // nothing is filtered - everything is accepted
- public boolean accept(S next) {
- return true;
- }
- // nothing is "reverse-filtered" - everything is accepted
- public boolean reverseAccept(S o) {
- return true;
- }
- @Override
- public String toString() {
- return "BidiFilter.Null";
- }
- }
-
- final class Disabled<S> implements BidiFilter<S> {
- @SuppressWarnings("unchecked")
- public static final BidiFilter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> BidiFilter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public boolean accept(S next) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public boolean reverseAccept(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiFilter.Disabled";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java
deleted file mode 100644
index fcd8f4a311..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java
+++ /dev/null
@@ -1,127 +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.utility.internal;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * into strings and vice versa.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiStringConverter<T> extends StringConverter<T> {
-
- /**
- * Convert the specified string into an object.
- * The semantics of "convert to object" is determined by the
- * contract between the client and the server.
- * Typically, if the string is null, null is returned.
- */
- T convertToObject(String s);
-
-
- final class Default<S> implements BidiStringConverter<S> {
- @SuppressWarnings("unchecked")
- public static final BidiStringConverter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> BidiStringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply return the object's #toString() result
- public String convertToString(S o) {
- return (o == null) ? null : o.toString();
- }
- // simply return the string
- @SuppressWarnings("unchecked")
- public S convertToObject(String s) {
- return (S) s;
- }
- @Override
- public String toString() {
- return "BidiStringConverter.Default";
- }
- }
-
- final class Disabled<S> implements BidiStringConverter<S> {
- @SuppressWarnings("unchecked")
- public static final BidiStringConverter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> BidiStringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public String convertToString(S o) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public S convertToObject(String s) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiStringConverter.Disabled";
- }
- }
-
- final class BooleanConverter implements BidiStringConverter<Boolean> {
- public static final BidiStringConverter<Boolean> INSTANCE = new BooleanConverter();
- public static BidiStringConverter<Boolean> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private BooleanConverter() {
- super();
- }
- /** Return "true" if the Boolean is true, otherwise return "false". */
- public String convertToString(Boolean b) {
- return (b == null) ? null : b.toString();
- }
- /** Return Boolean.TRUE if the string is "true" (case-insensitive), otherwise return Boolean.FALSE. */
- public Boolean convertToObject(String s) {
- return (s == null) ? null : Boolean.valueOf(s);
- }
- @Override
- public String toString() {
- return "BidiStringConverter.BooleanConverter";
- }
- }
-
- final class IntegerConverter implements BidiStringConverter<Integer> {
- public static final BidiStringConverter<Integer> INSTANCE = new IntegerConverter();
- public static BidiStringConverter<Integer> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private IntegerConverter() {
- super();
- }
- /** Integer's #toString() works well. */
- public String convertToString(Integer integer) {
- return (integer == null) ? null : integer.toString();
- }
- /** Convert the string to an Integer, if possible. */
- public Integer convertToObject(String s) {
- return (s == null) ? null : Integer.valueOf(s);
- }
- @Override
- public String toString() {
- return "BidiStringConverter.IntegerConverter";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java
deleted file mode 100644
index 5f6d3d221b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java
+++ /dev/null
@@ -1,81 +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.utility.internal;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * in both directions.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiTransformer<T1, T2> extends Transformer<T1, T2> {
-
- /**
- * Return the "reverse-transformed" object.
- * The semantics of "reverse-transform" is determined by the
- * contract between the client and the server.
- */
- T1 reverseTransform(T2 o);
-
-
- final class Null<S1, S2> implements BidiTransformer<S1, S2> {
- @SuppressWarnings("unchecked")
- public static final BidiTransformer INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R1, R2> BidiTransformer<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;
- }
- // simply return the object, unchanged
- @SuppressWarnings("unchecked")
- public S1 reverseTransform(S2 o) {
- return (S1) o;
- }
- @Override
- public String toString() {
- return "BidiTransformer.Null";
- }
- }
-
- final class Disabled<S1, S2> implements BidiTransformer<S1, S2> {
- @SuppressWarnings("unchecked")
- public static final BidiTransformer INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R1, R2> BidiTransformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S2 transform(S1 o) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public S1 reverseTransform(S2 o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiTransformer.Disabled";
- }
- }
-
-}
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 544f5bba82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java
+++ /dev/null
@@ -1,214 +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 the specified
- * 'flagToCheck' set.
- */
- public static boolean flagIsSet(int flags, int flagToCheck) {
- return allFlagsAreSet(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has the specified
- * 'flagToCheck' turned off.
- */
- public static boolean flagIsOff(int flags, int flagToCheck) {
- return allFlagsAreOff(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagToCheck' set.
- */
- public static boolean onlyFlagIsSet(int flags, int flagToCheck) {
- return onlyFlagsAreSet(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagToCheck' turned off.
- */
- public static boolean onlyFlagIsOff(int flags, int flagToCheck) {
- return onlyFlagsAreOff(flags, flagToCheck);
- }
-
- /**
- * 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 all the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean allFlagsAreOff(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) == 0;
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' set.
- */
- public static boolean onlyFlagsAreSet(int flags, int flagsToCheck) {
- return allFlagsAreSet(flags, flagsToCheck) && allFlagsAreOff(flags, ~flagsToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean onlyFlagsAreOff(int flags, int flagsToCheck) {
- return allFlagsAreOff(flags, flagsToCheck) && allFlagsAreSet(flags, ~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 any one of the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean anyFlagsAreOff(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) != flagsToCheck;
- }
-
- /**
- * 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 all the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean allFlagsAreOff(int flags, int[] flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if ( ! allFlagsAreOff(flags, flagsToCheck[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' set.
- */
- public static boolean onlyFlagsAreSet(int flags, int[] flagsToCheck) {
- int combinedFlags = orFlags(flagsToCheck);
- return allFlagsAreSet(flags, combinedFlags) && allFlagsAreOff(flags, ~combinedFlags);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean onlyFlagsAreOff(int flags, int[] flagsToCheck) {
- int combinedFlags = orFlags(flagsToCheck);
- return allFlagsAreOff(flags, combinedFlags) && allFlagsAreSet(flags, ~combinedFlags);
- }
-
- /**
- * 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;
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean anyFlagsAreOff(int flags, int[] flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if (anyFlagsAreOff(flags, flagsToCheck[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * OR all the specified 'flags' together and return the result.
- */
- public static int orFlags(int[] flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result |= flags[i];
- }
- return result;
- }
-
- /**
- * AND all the specified 'flags' together and return the result.
- */
- public static int andFlags(int[] flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result &= flags[i];
- }
- return result;
- }
-
- /**
- * XOR all the specified 'flags' together and return the result.
- */
- public static int xorFlags(int[] flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result ^= flags[i];
- }
- return result;
- }
-
-
- // ********** 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 c2b7c55f88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassTools.java
+++ /dev/null
@@ -1,1678 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 TYPE_DECLARATION_ARRAY_OPEN = '[';
- public static final char TYPE_DECLARATION_ARRAY_CLOSE = ']';
-
- public static final char REFERENCE_CLASS_CODE = 'L';
- public static final char REFERENCE_CLASS_NAME_DELIMITER = ';';
-
- private static Primitive[] PRIMITIVES; // 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
- private static int MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = -1; // pseudo-'final' - lazy-initialized
-
- public static final String VOID_CLASS_NAME = void.class.getName();
- public static final String VOID_WRAPPER_CLASS_NAME = java.lang.Void.class.getName();
-
-
- /**
- * 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) {
- StringBuilder sb = new StringBuilder(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) {
- StringBuilder sb = new StringBuilder(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 fieldValue(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 staticFieldValue(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 (without the checked exception).
- */
- public static Class<?> classForName(String className) {
- try {
- return Class.forName(className);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(className, 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 className) throws ClassNotFoundException {
- return newInstance(className, null);
- }
-
- /**
- * 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 className, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader));
- }
-
- /**
- * 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 className, Class<?>[] parameterTypes, Object[] parameters) throws ClassNotFoundException {
- return newInstance(className, parameterTypes, parameters, null);
- }
-
- /**
- * 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 className, Class<?>[] parameterTypes, Object[] parameters, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, true, classLoader), 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 className, Class<?> parameterType, Object parameter) throws ClassNotFoundException {
- return newInstance(className, parameterType, parameter, null);
- }
-
- /**
- * 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 className, Class<?> parameterType, Object parameter, ClassLoader classLoader) throws ClassNotFoundException {
- return newInstance(Class.forName(className, false, classLoader), 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) {
- StringBuilder sb = new StringBuilder(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. neither 'void' nor one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsReference(String className) {
- return ! classNamedIsPrimitive(className);
- }
-
- /**
- * Return whether the specified class is a primitive
- * class (i.e. 'void' or one of the primitive variable classes,
- * ['boolean', 'int', 'float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitive(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].javaClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitive(String className) {
- return classNamedIsPrimitive(className)
- && ( ! className.equals(VOID_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsPrimitiveWrapperClass(String className) {
- if (classNamedIsArray(className) || (className.length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass.getName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classNamedIsVariablePrimitiveWrapperClass(String className) {
- return classNamedIsPrimitiveWrapperClass(className)
- && ( ! className.equals(VOID_WRAPPER_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. 'java.lang.Void' or one of the primitive variable wrapper classes,
- * ['java.lang.Boolean', 'java.lang.Integer', 'java.lang.Float', etc.]).
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsPrimitiveWrapperClass(Class<?> javaClass) {
- if (javaClass.isArray() || (javaClass.getName().length() > maxPrimitiveWrapperClassNameLength())) {
- return false; // performance tweak
- }
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- if (codes[i].wrapperClass == javaClass) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. 'boolean', 'int', 'float', etc., but not 'void').
- * NB: void.class.isPrimitive() == true
- */
- public static boolean classIsVariablePrimitiveWrapperClass(Class<?> javaClass) {
- return classIsPrimitiveWrapperClass(javaClass)
- && (javaClass != java.lang.Void.class);
- }
-
- /**
- * 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) {
- Primitive[] codes = primitives();
- 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())) {
- Primitive[] codes = primitives();
- 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())) {
- Primitive[] codes = primitives();
- 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 the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration) throws ClassNotFoundException {
- return classForTypeDeclaration(typeDeclaration, ClassTools.class.getClassLoader());
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> classForTypeDeclaration(String typeDeclaration, ClassLoader classLoader) throws ClassNotFoundException {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- private static TypeDeclaration typeDeclaration(String typeDeclaration) {
- typeDeclaration = StringTools.removeAllWhitespace(typeDeclaration);
- int arrayDepth = arrayDepthForTypeDeclaration_(typeDeclaration);
- String elementTypeName = typeDeclaration.substring(0, typeDeclaration.length() - (arrayDepth * 2));
- return new TypeDeclaration(elementTypeName, arrayDepth);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> classForTypeDeclaration(String elementTypeName, int arrayDepth) throws ClassNotFoundException {
- return classForTypeDeclaration(elementTypeName, arrayDepth, null);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- // see the "Evaluation" of jdk bug 6446627 for a discussion of loading classes
- 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
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- 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) ? Class.forName(elementTypeName, false, classLoader) : pcc.javaClass;
- }
-
- // array
- StringBuilder sb = new StringBuilder(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 Class.forName(sb.toString(), false, classLoader);
- }
-
- /**
- * Return the class name for the specified "type declaration"; e.g.
- * "int[]" -> "[I"
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String typeDeclaration) {
- TypeDeclaration td = typeDeclaration(typeDeclaration);
- return classNameForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- /**
- * Return the array depth for the specified "type declaration"; e.g.
- * "int[]" -> 1
- */
- public static int arrayDepthForTypeDeclaration(String typeDeclaration) {
- return arrayDepthForTypeDeclaration_(StringTools.removeAllWhitespace(typeDeclaration));
- }
-
- /*
- * Assume no whitespace in the type declaration.
- */
- private static int arrayDepthForTypeDeclaration_(String typeDeclaration) {
- int last = typeDeclaration.length() - 1;
- int depth = 0;
- int close = last;
- while (typeDeclaration.charAt(close) == TYPE_DECLARATION_ARRAY_CLOSE) {
- if (typeDeclaration.charAt(close - 1) == TYPE_DECLARATION_ARRAY_OPEN) {
- depth++;
- } else {
- throw new IllegalArgumentException("invalid type declaration: " + typeDeclaration);
- }
- close = last - (depth * 2);
- }
- return depth;
- }
-
- /**
- * Return the class name for the specified "type declaration".
- * @see java.lang.Class#getName()
- */
- public static String classNameForTypeDeclaration(String elementTypeName, int arrayDepth) {
- // non-array
- if (arrayDepth == 0) {
- return elementTypeName;
- }
-
- if (elementTypeName.equals(VOID_CLASS_NAME)) {
- throw new IllegalArgumentException("'" + VOID_CLASS_NAME + "' must have an array depth of zero: " + arrayDepth + '.');
- }
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append(ARRAY_INDICATOR);
- }
-
- // look for a primitive first
- Primitive pcc = null;
- if (elementTypeName.length() <= maxPrimitiveClassNameLength()) { // performance tweak
- Primitive[] codes = primitives();
- 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;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].javaClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static int maxPrimitiveWrapperClassNameLength() {
- if (MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH == -1) {
- MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = calculateMaxPrimitiveWrapperClassNameLength();
- }
- return MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH;
- }
-
- private static int calculateMaxPrimitiveWrapperClassNameLength() {
- int max = -1;
- Primitive[] codes = primitives();
- for (int i = codes.length; i-- > 0; ) {
- int len = codes[i].wrapperClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static Primitive[] primitives() {
- if (PRIMITIVES == null) {
- PRIMITIVES = buildPrimitives();
- }
- return PRIMITIVES;
- }
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- private static Primitive[] buildPrimitives() {
- Primitive[] result = new Primitive[9];
- result[0] = new Primitive(BYTE_CODE, java.lang.Byte.class);
- result[1] = new Primitive(CHAR_CODE, java.lang.Character.class);
- result[2] = new Primitive(DOUBLE_CODE, java.lang.Double.class);
- result[3] = new Primitive(FLOAT_CODE, java.lang.Float.class);
- result[4] = new Primitive(INT_CODE, java.lang.Integer.class);
- result[5] = new Primitive(LONG_CODE, java.lang.Long.class);
- result[6] = new Primitive(SHORT_CODE, java.lang.Short.class);
- result[7] = new Primitive(BOOLEAN_CODE, java.lang.Boolean.class);
- result[8] = new Primitive(VOID_CODE, java.lang.Void.class);
- return result;
- }
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ClassTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- private static class Primitive {
- final char code;
- final Class<?> javaClass;
- final Class<?> wrapperClass;
- private static final String WRAPPER_CLASS_TYPE_FIELD_NAME = "TYPE";
- // e.g. java.lang.Boolean.TYPE => boolean.class
- Primitive(char code, Class<?> wrapperClass) {
- this.code = code;
- this.wrapperClass = wrapperClass;
- this.javaClass = (Class<?>) staticFieldValue(wrapperClass, WRAPPER_CLASS_TYPE_FIELD_NAME);
- }
- }
-
- private static class TypeDeclaration {
- final String elementTypeName;
- final int arrayDepth;
- TypeDeclaration(String elementTypeName, int arrayDepth) {
- this.elementTypeName = elementTypeName;
- this.arrayDepth = arrayDepth;
- }
- }
-
-}
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 ea8f3d659e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
+++ /dev/null
@@ -1,912 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.Filter;
-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.entries());
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the classpath's entries.
- */
- public Entry[] entries() {
- return this.entries;
- }
-
- /**
- * Return the classpath's path.
- */
- public String path() {
- Entry[] localEntries = this.entries;
- int max = localEntries.length - 1;
- if (max == -1) {
- return "";
- }
- StringBuilder sb = new StringBuilder(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(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) {
- // something is wrong, leave the entry null
- } 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, File>(FileTools.filesInTree(this.canonicalFile)) {
- @Override
- protected boolean accept(File next) {
- return Entry.this.fileNameMightBeForClassFile(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, 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 3b7ed63b3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
+++ /dev/null
@@ -1,3901 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.RandomAccess;
-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.GenericIteratorWrapper;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-public final class CollectionTools {
-
- @SuppressWarnings("unchecked")
- private static <E> E[] newArray(E[] array, int length) {
- return (E[]) Array.newInstance(array.getClass().getComponentType(), length);
- }
-
- /**
- * 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)
- */
- public static <E> E[] add(E[] array, E value) {
- int len = array.length;
- E[] result = newArray(array, len + 1);
- if (len > 0) {
- 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)
- */
- public static <E> E[] add(E[] array, int index, E value) {
- int len = array.length;
- E[] result = newArray(array, 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];
- if (len > 0) {
- 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];
- 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(int[] array, int value)
- */
- public static int[] add(int[] array, int value) {
- int len = array.length;
- int[] result = new int[len + 1];
- if (len > 0) {
- 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];
- 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;
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(java.lang.Iterable iterable)
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterable<? extends E> iterable) {
- return addAll(collection, iterable.iterator());
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#addAll(java.lang.Iterable iterable)
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterable<? extends E> iterable, int size) {
- return addAll(collection, iterable.iterator(), size);
- }
-
- /**
- * 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<? extends E> iterator) {
- return (iterator.hasNext()) ? collection.addAll(list(iterator)) : false;
- }
-
- /**
- * 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<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? collection.addAll(list(iterator, size)) : false;
- }
-
- /**
- * 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) {
- return (array.length == 0) ? false : collection.addAll(Arrays.asList(array));
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * java.util.List#addAll(java.lang.Iterable iterable)
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterable<E> iterable) {
- return addAll(list, index, iterable.iterator());
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * java.util.List#addAll(java.lang.Iterable iterable)
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterable<E> iterable, int size) {
- return addAll(list, index, iterable.iterator(), size);
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * java.util.List#addAll(java.util.Iterator iterator)
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? list.addAll(index, list(iterator)) : false;
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * java.util.List#addAll(java.util.Iterator iterator)
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? list.addAll(index, list(iterator, size)) : false;
- }
-
- /**
- * Add all the elements in the specified array
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * java.util.List#addAll(Object[] array)
- */
- public static <E> boolean addAll(List<? super E> list, int index, E[] array) {
- return (array.length == 0) ? false : list.addAll(index, Arrays.asList(array));
- }
-
- /**
- * 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)
- */
- public static <E> E[] addAll(E[] array, Collection<? extends E> collection) {
- int size = collection.size();
- return (size == 0) ? array : addAll(array, collection, size);
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll_(E[] array, Collection<? extends E> collection) {
- return addAll(array, collection, collection.size());
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll(E[] array, Collection<? extends E> collection, int collectionSize) {
- int len = array.length;
- E[] result = newArray(array, len + collectionSize);
- if (len > 0) {
- 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 iterable.
- * java.util.Arrays#addAll(Object[] array, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable) {
- return addAll(array, iterable.iterator());
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array followed by the elements
- * in the specified iterable.
- * java.util.Arrays#addAll(Object[] array, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable, int size) {
- return addAll(array, iterable.iterator(), size);
- }
-
- /**
- * 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 (iterator.hasNext()) ? addAll_(array, list(iterator)) : array;
- }
-
- /**
- * 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, int size) {
- return (iterator.hasNext()) ? addAll_(array, list(iterator, size)) : array;
- }
-
- /**
- * 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)
- */
- public static <E> E[] addAll(E[] array1, E[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, E[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, E[] array2, int array1Length, int array2Length) {
- E[] result = newArray(array1, array1Length + array2Length);
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- 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)
- */
- public static <E> E[] addAll(E[] array1, int index, E[] array2) {
- int array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, int index, E[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static <E> E[] addAll(E[] array1, int index, E[] array2, int array1Length, int array2Length) {
- E[] result = newArray(array1, array1Length + array2Length);
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified collection inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Collection c)
- */
- public static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection) {
- int size = collection.size();
- return (size == 0) ? array : addAll(array, index, collection, size);
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll_(E[] array, int index, Collection<? extends E> collection) {
- return addAll(array, index, collection, collection.size());
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection, int collectionSize) {
- int arrayLength = array.length;
- E[] result = newArray(array, arrayLength + collectionSize);
- if ((arrayLength == 0) && (index == 0)) {
- return collection.toArray(result);
- }
- System.arraycopy(array, 0, result, 0, index);
- int i = index;
- for (E item : collection) {
- result[i++] = item;
- }
- System.arraycopy(array, index, result, index + collectionSize, arrayLength - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable) {
- return addAll(array, index, iterable.iterator());
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.lang.Iterable iterable)
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable, int size) {
- return addAll(array, index, iterable.iterator(), size);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? addAll_(array, index, list(iterator)) : array;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * java.util.Arrays#addAll(Object[] array, int index, java.util.Iterator iterator)
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? addAll_(array, index, list(iterator, size)) : array;
- }
-
- /**
- * 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 array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static char[] addAll(char[] array1, char[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static char[] addAll(char[] array1, char[] array2, int array1Length, int array2Length) {
- char[] result = new char[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- 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 array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static char[] addAll(char[] array1, int index, char[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static char[] addAll(char[] array1, int index, char[] array2, int array1Length, int array2Length) {
- char[] result = new char[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - 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 array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static int[] addAll(int[] array1, int[] array2, int array2Length) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static int[] addAll(int[] array1, int[] array2, int array1Length, int array2Length) {
- int[] result = new int[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- 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 array2Length = array2.length;
- return (array2Length == 0) ? array1 : addAll(array1, index, array2, array2Length);
- }
-
- /**
- * assume array2Length > 0
- */
- private static int[] addAll(int[] array1, int index, int[] array2, int array2Length) {
- int array1Length = array1.length;
- return (index == array1Length) ? // array2 added to end of array1
- (array1Length == 0) ? array2 : addAll(array1, array2, array1Length, array2Length)
- :
- addAll(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static int[] addAll(int[] array1, int index, int[] array2, int array1Length, int array2Length) {
- int[] result = new int[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - index);
- return result;
- }
-
- /**
- * Return an array corresponding to the specified iterable.
- * @see java.util.Collection#toArray()
- * java.lang.Iterable#toArray()
- */
- public static Object[] array(Iterable<?> iterable) {
- return array(iterable.iterator());
- }
-
- /**
- * Return an array corresponding to the specified iterable.
- * @see java.util.Collection#toArray()
- * java.lang.Iterable#toArray()
- */
- public static Object[] array(Iterable<?> iterable, int size) {
- return array(iterable.iterator(), size);
- }
-
- /**
- * Return an array corresponding to the specified iterable;
- * 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.lang.Iterable#toArray(Object[])
- */
- public static <E> E[] array(Iterable<? extends E> iterable, E[] array) {
- return array(iterable.iterator(), array);
- }
-
- /**
- * Return an array corresponding to the specified iterable;
- * 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.lang.Iterable#toArray(Object[])
- */
- public static <E> E[] array(Iterable<? extends E> iterable, int size, E[] array) {
- return array(iterable.iterator(), size, array);
- }
-
- /**
- * Return an array corresponding to the specified iterator.
- * @see java.util.Collection#toArray()
- * java.util.Iterator#toArray()
- */
- public static Object[] array(Iterator<?> iterator) {
- return (iterator.hasNext()) ? list(iterator).toArray() : EMPTY_OBJECT_ARRAY;
- }
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
- /**
- * Return an array corresponding to the specified iterator.
- * @see java.util.Collection#toArray()
- * java.util.Iterator#toArray()
- */
- public static Object[] array(Iterator<?> iterator, int size) {
- return (iterator.hasNext()) ? list(iterator, size).toArray() : EMPTY_OBJECT_ARRAY;
- }
-
- /**
- * 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 (iterator.hasNext()) ? list(iterator).toArray(array) : newArray(array, 0);
- }
-
- /**
- * 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, int size, E[] array) {
- return (iterator.hasNext()) ? list(iterator, size).toArray(array) : newArray(array, 0);
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * HashBag(java.util.Enumeration enumeration)
- */
- public static <E> Bag<E> bag(Enumeration<? extends E> enumeration) {
- return (enumeration.hasMoreElements()) ?
- bag(enumeration, new HashBag<E>())
- :
- Bag.Empty.<E>instance();
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * HashBag(java.util.Enumeration enumeration)
- */
- public static <E> Bag<E> bag(Enumeration<? extends E> enumeration, int size) {
- return (enumeration.hasMoreElements()) ?
- bag(enumeration, new HashBag<E>(size))
- :
- Bag.Empty.<E>instance();
- }
-
- private static <E> Bag<E> bag(Enumeration<? extends E> enumeration, HashBag<E> bag) {
- while (enumeration.hasMoreElements()) {
- bag.add(enumeration.nextElement());
- }
- return bag;
- }
-
- /**
- * Return a bag corresponding to the specified iterable.
- * HashBag(java.lang.Iterable iterable)
- */
- public static <E> Bag<E> bag(Iterable<? extends E> iterable) {
- return bag(iterable.iterator());
- }
-
- /**
- * Return a bag corresponding to the specified iterable.
- * HashBag(java.lang.Iterable iterable)
- */
- public static <E> Bag<E> bag(Iterable<? extends E> iterable, int size) {
- return bag(iterable.iterator(), size);
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * HashBag(java.util.Iterator iterator)
- */
- public static <E> Bag<E> bag(Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ?
- bag(iterator, new HashBag<E>())
- :
- Bag.Empty.<E>instance();
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * HashBag(java.util.Iterator iterator)
- */
- public static <E> Bag<E> bag(Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ?
- bag(iterator, new HashBag<E>(size))
- :
- Bag.Empty.<E>instance();
- }
-
- private static <E> Bag<E> bag(Iterator<? extends E> iterator, HashBag<E> bag) {
- 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) {
- int len = array.length;
- if (len == 0) {
- return Bag.Empty.<E>instance();
- }
- Bag<E> bag = new HashBag<E>(len);
- 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 enumeration.
- */
- public static <E> Collection<E> collection(Enumeration<? extends E> enumeration, int size) {
- return bag(enumeration, size);
- }
-
- /**
- * Return a collection corresponding to the specified iterable.
- */
- public static <E> Collection<E> collection(Iterable<? extends E> iterable) {
- return collection(iterable.iterator());
- }
-
- /**
- * Return a collection corresponding to the specified iterable.
- */
- public static <E> Collection<E> collection(Iterable<? extends E> iterable, int size) {
- return collection(iterable.iterator(), size);
- }
-
- /**
- * 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 iterator.
- */
- public static <E> Collection<E> collection(Iterator<? extends E> iterator, int size) {
- return bag(iterator, size);
- }
-
- /**
- * 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 iterable contains the
- * specified element.
- * java.lang.Iterable#contains(Object o)
- */
- public static boolean contains(Iterable<?> iterable, Object value) {
- return contains(iterable.iterator(), value);
- }
-
- /**
- * 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 iterable.
- * java.util.Collection#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Collection<?> collection, Iterable<?> iterable) {
- return containsAll(collection, iterable.iterator());
- }
-
- /**
- * 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 iterable contains all of the
- * elements in the specified collection.
- * java.lang.Iterable#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterable<?> iterable, Collection<?> collection) {
- return containsAll(iterable.iterator(), collection);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified collection.
- * java.lang.Iterable#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Collection<?> collection) {
- return containsAll(iterable.iterator(), size, collection);
- }
-
- /**
- * Return whether the specified iterable 1 contains all of the
- * elements in the specified iterable 2.
- * java.lang.Iterable#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterable<?> iterable1, Iterable<?> iterable2) {
- return containsAll(iterable1.iterator(), iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterable 1 contains all of the
- * elements in the specified iterable 2.
- * java.lang.Iterable#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterable<?> iterable1, int size, Iterable<?> iterable2) {
- return containsAll(iterable1.iterator(), size, iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified iterator.
- * java.lang.Iterable#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterable<?> iterable, Iterator<?> iterator) {
- return containsAll(iterable.iterator(), iterator);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified iterator.
- * java.lang.Iterable#containsAll(java.util.Iterator iterator)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Iterator<?> iterator) {
- return containsAll(iterable.iterator(), size, iterator);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified array.
- * java.lang.Iterable#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterable<?> iterable, Object[] array) {
- return containsAll(iterable.iterator(), array);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified array.
- * java.lang.Iterable#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterable<?> iterable, int size, Object[] array) {
- return containsAll(iterable.iterator(), size, array);
- }
-
- /**
- * 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 contains all of the
- * elements in the specified collection.
- * java.util.Iterator#containsAll(java.util.Collection collection)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Collection<?> collection) {
- return collection(iterator, size).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * java.util.Iterator#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterator<?> iterator, Iterable<?> iterable) {
- return containsAll(collection(iterator), iterable);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * java.util.Iterator#containsAll(java.lang.Iterable iterable)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Iterable<?> iterable) {
- return containsAll(collection(iterator, size), iterable);
- }
-
- /**
- * 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 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, int size, Iterator<?> iterator2) {
- return containsAll(collection(iterator1, size), 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 iterator contains all of the
- * elements in the specified array.
- * java.util.Iterator#containsAll(Object[] array)
- */
- public static boolean containsAll(Iterator<?> iterator, int size, Object[] array) {
- return containsAll(collection(iterator, size), 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 iterable.
- * java.util.Arrays#containsAll(Object[] array, java.lang.Iterable iterable)
- */
- public static boolean containsAll(Object[] array, Iterable<?> iterable) {
- return containsAll(array, iterable.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.Iterator#equals(java.util.Iterator iterator)
- */
- public static boolean equals(Iterator<?> iterator1, Iterator<?> 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<? extends 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.Iterator#identical(java.util.Iterator iterator)
- */
- public static boolean identical(Iterator<?> iterator1, Iterator<?> 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.Iterator#indexOf(Object o)
- */
- public static int indexOf(Iterator<?> 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 a one-use Iterable for the Iterator given.
- * Throws an IllegalStateException if iterable() is called more than once.
- * As such, this utility should only be used in one-use situations, such as
- * a "for" loop.
- */
- public static <E> Iterable<E> iterable(Iterator<? extends E> iterator) {
- return new SingleUseIterable<E>(iterator);
- }
-
- /**
- * Return an iterable on the elements in the specified array.
- * java.util.Arrays#iterable(Object[] array)
- */
- public static <E> Iterable<E> iterable(E... array) {
- return Arrays.asList(array);
- }
-
- /**
- * 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.Iterator#lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterator<?> iterator, Object value) {
- return (iterator.hasNext()) ? list(iterator).lastIndexOf(value) : -1;
- }
-
- /**
- * 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.Iterator#lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterator<?> iterator, int size, Object value) {
- return (iterator.hasNext()) ? list(iterator, size).lastIndexOf(value) : -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(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 iterable.
- * java.lang.Iterable#toList()
- */
- public static <E> List<E> list(Iterable<? extends E> iterable) {
- return list(iterable.iterator());
- }
-
- /**
- * Return a list corresponding to the specified iterable.
- * java.lang.Iterable#toList()
- */
- public static <E> List<E> list(Iterable<? extends E> iterable, int size) {
- return list(iterable.iterator(), size);
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * java.util.Iterator#toList()
- */
- public static <E> List<E> list(Iterator<? extends E> iterator) {
- return (iterator.hasNext()) ? list(iterator, new ArrayList<E>()) : Collections.<E>emptyList();
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * java.util.Iterator#toList()
- */
- public static <E> List<E> list(Iterator<? extends E> iterator, int size) {
- return (iterator.hasNext()) ? list(iterator, new ArrayList<E>(size)) : Collections.<E>emptyList();
- }
-
- private static <E> List<E> list(Iterator<? extends E> iterator, ArrayList<E> list) {
- 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;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(Object[] array, int targetIndex, int sourceIndex)
- */
- public static <E> E[] move(E[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static <E> E[] move_(E[] array, int targetIndex, int sourceIndex) {
- E temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(Object[] array, int targetIndex, int sourceIndex, int length)
- */
- public static <E> E[] move(E[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- E[] temp = newArray(array, length);
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(int[] array, int targetIndex, int sourceIndex)
- */
- public static int[] move(int[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static int[] move_(int[] array, int targetIndex, int sourceIndex) {
- int temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(int[] array, int targetIndex, int sourceIndex, int length)
- */
- public static int[] move(int[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- int[] temp = new int[length];
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(char[] array, int targetIndex, int sourceIndex)
- */
- public static char[] move(char[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static char[] move_(char[] array, int targetIndex, int sourceIndex) {
- char temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * java.util.Arrays#move(char[] array, int targetIndex, int sourceIndex, int length)
- */
- public static char[] move(char[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- char[] temp = new char[length];
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered list.
- * java.util.List#move(int targetIndex, int sourceIndex)
- */
- public static <E> List<E> move(List<E> list, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? list : move_(list, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static <E> List<E> move_(List<E> list, int targetIndex, int sourceIndex) {
- if (list instanceof RandomAccess) {
- // move elements, leaving the list in place
- E temp = list.get(sourceIndex);
- if (targetIndex < sourceIndex) {
- for (int i = sourceIndex; i-- > targetIndex; ) {
- list.set(i + 1, list.get(i));
- }
- } else {
- for (int i = sourceIndex; i < targetIndex; i++) {
- list.set(i, list.get(i + 1));
- }
- }
- list.set(targetIndex, temp);
- } else {
- // remove the element and re-add it at the target index
- list.add(targetIndex, list.remove(sourceIndex));
- }
- return list;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered list.
- * java.util.List#move(int targetIndex, int sourceIndex, int length)
- */
- public static <E> List<E> move(List<E> list, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return list;
- }
- if (length == 1) {
- return move_(list, targetIndex, sourceIndex);
- }
- if (list instanceof RandomAccess) {
- // move elements, leaving the list in place
- ArrayList<E> temp = new ArrayList<E>(list.subList(sourceIndex, sourceIndex + length));
- if (targetIndex < sourceIndex) {
- for (int i = sourceIndex; i-- > targetIndex; ) {
- list.set(i + length, list.get(i));
- }
- } else {
- for (int i = sourceIndex; i < targetIndex; i++) {
- list.set(i, list.get(i + length));
- }
- }
- for (int i = 0; i < length; i++) {
- list.set(targetIndex + i, temp.get(i));
- }
- } else {
- // remove the elements and re-add them at the target index
- list.addAll(targetIndex, removeElementsAtIndex(list, sourceIndex, length));
- }
- return list;
- }
-
- /**
- * 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 iterable
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(java.lang.Iterable iterable)
- */
- public static boolean removeAll(Collection<?> collection, Iterable<?> iterable) {
- return removeAll(collection, iterable.iterator());
- }
-
- /**
- * Remove all the elements returned by the specified iterable
- * from the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#removeAll(java.lang.Iterable iterable)
- */
- public static boolean removeAll(Collection<?> collection, Iterable<?> iterable, int size) {
- return removeAll(collection, iterable.iterator(), size);
- }
-
- /**
- * 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) {
- return (iterator.hasNext()) ? collection.removeAll(set(iterator)) : false;
- }
-
- /**
- * 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, int size) {
- return (iterator.hasNext()) ? collection.removeAll(set(iterator, size)) : false;
- }
-
- /**
- * 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) {
- return collection.removeAll(set(array));
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] removeAll(E[] array, Iterable<?> iterable) {
- return removeAll(array, iterable.iterator());
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] removeAll(E[] array, Iterable<?> iterable, int size) {
- return removeAll(array, iterable.iterator(), size);
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator) {
- return (iterator.hasNext()) ? removeAll_(array, set(iterator)) : array;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#removeAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator, int size) {
- return (iterator.hasNext()) ? removeAll_(array, set(iterator, size)) : array;
- }
-
- /**
- * 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) {
- return (collection.isEmpty()) ? array : removeAll_(array, collection);
- }
-
- /**
- * assume the collection is non-empty
- */
- private static <E> E[] removeAll_(E[] array, Collection<?> collection) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : removeAll(array, collection, arrayLength);
- }
-
- /**
- * assume the collection is non-empty and arrayLength > 0
- */
- private static <E> E[] removeAll(E[] array, Collection<?> collection, int arrayLength) {
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = 0; i < arrayLength; i++) {
- if ( ! collection.contains(array[i])) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[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 (array2.length == 0) ? array1 : removeAll_(array1, set(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) {
- if (array2.length == 0) {
- return array1;
- }
- int array1Length = array1.length;
- if (array1Length == 0) {
- return array1;
- }
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if ( ! contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // nothing was removed
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[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(int[] array1, int[] array2)
- */
- public static int[] removeAll(int[] array1, int[] array2) {
- if (array2.length == 0) {
- return array1;
- }
- int array1Length = array1.length;
- if (array1Length == 0) {
- return array1;
- }
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if ( ! contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // nothing was removed
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
- /**
- * 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) {
- int arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- if (value == null) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != null) {
- indices[j++] = i;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if ( ! value.equals(array[i])) {
- indices[j++] = i;
- }
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[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) {
- int arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != value) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[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 arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != value) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[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)
- */
- public static <E> E[] removeElementAtIndex(E[] array, int index) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * 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) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * 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) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * Remove the elements at the specified index.
- * Return the removed elements.
- * java.util.List#remove(int index, int length)
- */
- public static <E> List<E> removeElementsAtIndex(List<E> list, int index, int length) {
- List<E> subList = list.subList(index, index + length);
- ArrayList<E> result = new ArrayList<E>(subList);
- subList.clear();
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementsAtIndex(Object[] array, int index, int length)
- */
- public static <E> E[] removeElementsAtIndex(E[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- E[] result = newArray(array, newLength);
- if ((newLength == 0) && (index == 0)) {
- return result; // performance tweak
- }
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementAtIndex(char[] array, int index, int length)
- */
- public static char[] removeElementsAtIndex(char[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_CHAR_ARRAY; // performance tweak
- }
- char[] result = new char[newLength];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
- private static final char[] EMPTY_CHAR_ARRAY = new char[0];
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * java.util.Arrays#removeElementAtIndex(int[] array, int index, int length)
- */
- public static int[] removeElementsAtIndex(int[] array, int index, int length) {
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_INT_ARRAY; // performance tweak
- }
- int[] result = new int[newLength];
- System.arraycopy(array, 0, result, 0, index);
- System.arraycopy(array, index + length, result, index, newLength - index);
- return result;
- }
- private static final int[] EMPTY_INT_ARRAY = new int[0];
-
- /**
- * Remove any duplicate elements from the specified array,
- * while maintaining the order.
- */
- public static <E> E[] removeDuplicateElements(E... array) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- List<E> list = removeDuplicateElements(Arrays.asList(array), len);
- return list.toArray(newArray(array, list.size()));
- }
-
- /**
- * Remove any duplicate elements from the specified list,
- * while maintaining the order.
- */
- public static <E> List<E> removeDuplicateElements(List<E> list) {
- int size = list.size();
- if ((size == 0) || (size == 1)) {
- return list;
- }
- return removeDuplicateElements(list, size);
- }
-
- /**
- * assume list is non-empty
- */
- private static <E> List<E> removeDuplicateElements(List<E> list, int size) {
- List<E> result = new ArrayList<E>(size);
- Set<E> set = new HashSet<E>(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 iterable
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(java.lang.Iterable iterable)
- */
- public static boolean retainAll(Collection<?> collection, Iterable<?> iterable) {
- return retainAll(collection, iterable.iterator());
- }
-
- /**
- * Retain only the elements in the specified iterable
- * in the specified collection.
- * Return whether the collection changed as a result.
- * java.util.Collection#retainAll(java.lang.Iterable iterable)
- */
- public static boolean retainAll(Collection<?> collection, Iterable<?> iterable, int size) {
- return retainAll(collection, iterable.iterator(), size);
- }
-
- /**
- * 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) {
- if (iterator.hasNext()) {
- return collection.retainAll(set(iterator));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
- /**
- * 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, int size) {
- if (iterator.hasNext()) {
- return collection.retainAll(set(iterator, size));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
- /**
- * 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) {
- if (array.length > 0) {
- return collection.retainAll(set(array));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] retainAll(E[] array, Iterable<?> iterable) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterable.iterator());
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterable and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterable iterable)
- */
- public static <E> E[] retainAll(E[] array, Iterable<?> iterable, int size) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterable.iterator(), size);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] retainAll(E[] array, Iterator<?> iterator) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterator);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterator and return the result.
- * java.util.Arrays#retainAll(Object[] array, Iterator iterator)
- */
- public static <E> E[] retainAll(E[] array, Iterator<?> iterator, int size) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterator, size);
- }
-
- /**
- * assume arrayLength > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator) {
- return (iterator.hasNext()) ?
- retainAll_(array, set(iterator), arrayLength)
- :
- newArray(array, 0);
- }
-
- /**
- * assume arrayLength > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator, int iteratorSize) {
- return (iterator.hasNext()) ?
- retainAll_(array, set(iterator, iteratorSize), arrayLength)
- :
- newArray(array, 0);
- }
-
- /**
- * 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) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, collection, arrayLength);
- }
-
- /**
- * assume arrayLength > 0
- */
- private static <E> E[] retainAll(E[] array, Collection<?> collection, int arrayLength) {
- return (collection.isEmpty()) ?
- newArray(array, 0)
- :
- retainAll_(array, collection, arrayLength);
- }
-
- /**
- * assume collection is non-empty and arrayLength > 0
- */
- private static <E> E[] retainAll_(E[] array, Collection<?> collection, int arrayLength) {
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = 0; i < arrayLength; i++) {
- if (collection.contains(array[i])) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // everything was retained
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[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) {
- int array1Length = array1.length;
- return (array2.length == 0) ?
- (array1Length == 0) ? array1 : newArray(array1, 0)
- :
- retainAll(array1, set(array2), array1Length);
- }
-
- /**
- * 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) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array1Length > 0
- */
- private static char[] retainAll(char[] array1, char[] array2, int array1Length) {
- int array2Length = array2.length;
- return (array2Length == 0) ? EMPTY_CHAR_ARRAY : retainAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static char[] retainAll(char[] array1, char[] array2, int array1Length, int array2Length) {
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if (contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // everything was retained
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[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(int[] array1, int[] array2)
- */
- public static int[] retainAll(int[] array1, int[] array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array1Length > 0
- */
- private static int[] retainAll(int[] array1, int[] array2, int array1Length) {
- int array2Length = array2.length;
- return (array2Length == 0) ? EMPTY_INT_ARRAY : retainAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume array1Length > 0 and array2Length > 0
- */
- private static int[] retainAll(int[] array1, int[] array2, int array1Length, int array2Length) {
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if (contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // everything was retained
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
- /**
- * 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 iterable.
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable) {
- return reverse(list(iterable));
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterable.
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable, int size) {
- return reverse(list(iterable, size));
- }
-
- /**
- * 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 a list with entries in reverse order from those
- * returned by the specified iterator.
- */
- public static <E> List<E> reverseList(Iterator<? extends E> iterator, int size) {
- return reverse(list(iterator, size));
- }
-
- /**
- * 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) || (len == 1)) {
- 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) || (len == 1)) {
- 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) || (len == 1)) {
- 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 iterable.
- * java.util.HashSet(java.lang.Iterable iterable)
- */
- public static <E> Set<E> set(Iterable<? extends E> iterable) {
- return set(iterable.iterator());
- }
-
- /**
- * Return a set corresponding to the specified iterable.
- * java.util.HashSet(java.lang.Iterable iterable)
- */
- public static <E> Set<E> set(Iterable<? extends E> iterable, int size) {
- return set(iterable.iterator(), size);
- }
-
- /**
- * 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) {
- return set(iterator, new HashSet<E>());
- }
-
- /**
- * 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, int size) {
- return set(iterator, new HashSet<E>(size));
- }
-
- private static <E> Set<E> set(Iterator<? extends E> iterator, HashSet<E> set) {
- 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>(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;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- 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;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- 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;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- 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 iterable.
- * java.lang.Iterable#size()
- */
- public static int size(Iterable<?> iterable) {
- return size(iterable.iterator());
- }
-
- /**
- * 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 iterable.
- * java.util.TreeSet(java.lang.Iterable iterable)
- */
- public static <E extends Comparable<? super E>> SortedSet<E> sortedSet(Iterable<? extends E> iterable) {
- return sortedSet(iterable, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable.
- * java.util.TreeSet(java.lang.Iterable iterable)
- */
- public static <E extends Comparable<? super E>> SortedSet<E> sortedSet(Iterable<? extends E> iterable, int size) {
- return sortedSet(iterable, size, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable
- * and comparator.
- * java.util.TreeSet(java.lang.Iterable iterable, java.util.Comparator c)
- */
- public static <E> SortedSet<E> sortedSet(Iterable<? extends E> iterable, Comparator<? super E> comparator) {
- return sortedSet(iterable.iterator(), comparator);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable
- * and comparator.
- * java.util.TreeSet(java.lang.Iterable iterable, java.util.Comparator c)
- */
- public static <E> SortedSet<E> sortedSet(Iterable<? extends E> iterable, int size, Comparator<? super E> comparator) {
- return sortedSet(iterable.iterator(), size, comparator);
- }
-
- /**
- * 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.
- * java.util.TreeSet(java.util.Iterator iterator)
- */
- public static <E extends Comparable<? super E>> SortedSet<E> sortedSet(Iterator<? extends E> iterator, int size) {
- return sortedSet(iterator, size, 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) {
- return sortedSet(list(iterator), comparator);
- }
-
- /**
- * 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, int size, Comparator<? super E> comparator) {
- return sortedSet(list(iterator, size), comparator);
- }
-
- private static <E> SortedSet<E> sortedSet(List<E> list, Comparator<? super E> comparator) {
- SortedSet<E> sortedSet = new TreeSet<E>(comparator);
- sortedSet.addAll(list);
- 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 a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(E[] array, int start, int length)
- */
- public static <E> E[] subArray(E[] array, int start, int length) {
- E[] result = newArray(array, length);
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * Return a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(int[] array, int start, int length)
- */
- public static int[] subArray(int[] array, int start, int length) {
- int[] result = new int[length];
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * Return a sub-array of the specified array, starting at the specified
- * position with the specified length.
- * java.util.Arrays#subArray(char[] array, int start, int length)
- */
- public static char[] subArray(char[] array, int start, int length) {
- char[] result = new char[length];
- if (length > 0) {
- System.arraycopy(array, start, result, 0, length);
- }
- return result;
- }
-
- /**
- * 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 iterable.
- * This is useful for legacy code that requires a java.util.Vector.
- * java.util.Vector(java.lang.Iterable iterable)
- */
- public static <E> Vector<E> vector(Iterable<? extends E> iterable) {
- return vector(iterable.iterator());
- }
-
- /**
- * Return a vector corresponding to the specified iterable.
- * This is useful for legacy code that requires a java.util.Vector.
- * java.util.Vector(java.lang.Iterable iterable)
- */
- public static <E> Vector<E> vector(Iterable<? extends E> iterable, int size) {
- return vector(iterable.iterator(), size);
- }
-
- /**
- * 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) {
- return vector(iterator, new Vector<E>());
- }
-
- /**
- * 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, int size) {
- return vector(iterator, new Vector<E>(size));
- }
-
- private static <E> Vector<E> vector(Iterator<? extends E> iterator, Vector<E> v) {
- 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) {
- Vector<E> v = new Vector<E>(array.length);
- for (E item : array) {
- v.addElement(item);
- }
- return v;
- }
-
-
- // ********** single-use Iterable **********
-
- /**
- * This is a one-time use iterable that can return a single iterator.
- * Once the iterator is returned the iterable is no longer valid.
- * As such, this utility should only be used in one-time use situations,
- * such as a 'for-each' loop.
- */
- public static class SingleUseIterable<E> implements Iterable<E> {
- private Iterator<E> iterator;
-
- public SingleUseIterable(Iterator<? extends E> iterator) {
- super();
- if (iterator == null) {
- throw new NullPointerException();
- }
- this.iterator = new GenericIteratorWrapper<E>(iterator);
- }
-
- public Iterator<E> iterator() {
- if (this.iterator == null) {
- throw new IllegalStateException("This method has already been called.");
- }
- Iterator<E> result = this.iterator;
- this.iterator = null;
- return result;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
- }
-
-
- // ********** 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 iterable after it has been "sorted".
- */
- public static <E extends Comparable<? super E>> Iterable<E> sort(Iterable<E> iterable) {
- return sort(iterable, null);
- }
-
- /**
- * Return the iterable after it has been "sorted".
- */
- public static <E> Iterable<E> sort(Iterable<E> iterable, Comparator<? super E> comparator) {
- return sort(list(iterable), comparator);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- */
- public static <E extends Comparable<? super E>> Iterator<E> sort(Iterator<? extends E> iterator) {
- return sort(iterator, null);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- */
- public static <E> Iterator<E> sort(Iterator<? extends 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/Counter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.java
deleted file mode 100644
index fbe3cde738..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Counter.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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * This class can be used wherever a mutable integer object is needed.
- * It is a cross between an int and an Integer. It can be stored in a standard
- * container (e.g. Collection) but can be modified.
- */
-public final class Counter
- implements Cloneable, Serializable
-{
- private int count = 0;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a counter with the specified initial value.
- */
- public Counter(int count) {
- super();
- this.count = count;
- }
-
- /**
- * Construct a counter with an initial value of zero.
- */
- public Counter() {
- this(0);
- }
-
- /**
- * Return the current count of the counter.
- */
- public synchronized int count() {
- return this.count;
- }
-
- /**
- * Increment and return the current count of the counter.
- */
- public synchronized int increment() {
- return ++this.count;
- }
-
- /**
- * Increment and return the current count of the counter.
- */
- public synchronized int increment(int increment) {
- return this.count += increment;
- }
-
- /**
- * Derement and return the current count of the counter.
- */
- public synchronized int decrement() {
- return --this.count;
- }
-
- /**
- * Derement and return the current count of the counter.
- */
- public synchronized int decrement(int decrement) {
- return this.count -= decrement;
- }
-
- @Override
- public synchronized boolean equals(Object o) {
- if ( ! (o instanceof Counter)) {
- return false;
- }
- return this.count == ((Counter) o).count;
- }
-
- @Override
- public synchronized int hashCode() {
- return this.count;
- }
-
- @Override
- public synchronized Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public synchronized String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(ClassTools.shortClassNameForObject(this));
- sb.append('(');
- sb.append(this.count);
- sb.append(')');
- return sb.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java
deleted file mode 100644
index 36155692e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/EmptyIterable.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * An <code>EmptyIterable</code> is just that.
- */
-public final class EmptyIterable<E>
- implements Iterable<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final EmptyIterable INSTANCE = new EmptyIterable();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Iterable<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyIterable() {
- super();
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
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 44154c4ed5..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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, File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(File next) {
- return 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, File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(File next) {
- return 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();
- StringBuilder sb = new StringBuilder(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;
- }
-
- StringBuilder sb = new StringBuilder();
- 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, File>(files) {
- @Override
- protected boolean accept(File next) {
- return fileFilter.accept(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/HashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
deleted file mode 100644
index 45dba9a781..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
+++ /dev/null
@@ -1,842 +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.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.
- */
- 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 = this.buildTable(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;
- }
-
- 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.
- */
- private void rehash() {
- Entry<E>[] oldMap = this.table;
- int oldCapacity = oldMap.length;
-
- int newCapacity = oldCapacity * 2 + 1;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- this.modCount++;
- this.threshold = (int) (newCapacity * this.loadFactor);
- this.table = newTable;
-
- 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 = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, Entry<T> next) {
- return new Entry(hash, o, next);
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, int cnt, Entry<T> next) {
- return new Entry(hash, o, cnt, next);
- }
-
- /**
- * 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 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 = this.buildEntry(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.
- */
- public boolean add(E o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- 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 += cnt;
- this.count += cnt;
- 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 += cnt;
- this.count += cnt;
- 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 = this.buildEntry(hash, o, cnt, tab[index]);
- tab[index] = e;
- this.count += cnt;
- 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 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.
- */
- public boolean remove(Object o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- 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++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), 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 -= cnt2;
- 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++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), 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 -= cnt2;
- 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
- public HashBag<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- HashBag<E> clone = (HashBag<E>) super.clone();
- clone.table = this.buildTable(this.table.length);
- for (int i = this.table.length; i-- > 0; ) {
- clone.table[i] = (this.table[i] == null)
- ? null : (Entry<E>) 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);
- }
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- /**
- * Cascade the clone to all the entries in the same bucket.
- */
- @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();
- }
-
- @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
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof Bag)) {
- return false;
- }
- @SuppressWarnings("unchecked")
- 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).
- */
- 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 = this.buildTable(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++) {
- @SuppressWarnings("unchecked")
- E element = (E) s.readObject();
- int elementCount = s.readInt();
- this.add(element, elementCount);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
deleted file mode 100644
index 25023fd564..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
+++ /dev/null
@@ -1,814 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the <code>Bag</code> interface with a
- * hash table, using object-identity in place of object-equality when
- * comparing elements. In other words, in an <code>IdentityHashBag</code>,
- * two objects <code>k1</code> and <code>k2</code> are considered
- * equal if and only if <code>(k1 == k2)</code>. (In normal <code>Bag</code>
- * implementations (like <code>HashBag</code>) two objects <code>k1</code>
- * and <code>k2</code> are considered equal if and only if
- * <code>(k1 == null ? k2 == null : k1.equals(k2))</code>.)
- * <p>
- * <b>
- * This class is <i>not</i> a general-purpose <code>Bag</code>
- * implementation! While this class implements the <code>Bag</code> interface, it
- * intentionally violates <code>Bag's</code> general contract, which mandates the
- * use of the <code>equals</code> method when comparing objects. This class is
- * designed for use only in the rare cases wherein object-identity
- * semantics are required.
- * </b>
- * <p>
- * This class 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 system identity hash function
- * ({@link System#identityHashCode(Object)}) disperses 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 IdentityHashBag(...));
- * </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 IdentityHashBag<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 IdentityHashBag() {
- 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 IdentityHashBag(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.
- */
- public IdentityHashBag(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 = this.buildTable(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 IdentityHashBag(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 identity hash code and examining the
- * entries in the corresponding hash table bucket.
- */
- @Override
- public boolean contains(Object o) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- return true;
- }
- }
- return false;
- }
-
- public int count(Object o) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- int index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- 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.
- */
- private void rehash() {
- Entry<E>[] oldMap = this.table;
- int oldCapacity = oldMap.length;
-
- int newCapacity = oldCapacity * 2 + 1;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- this.modCount++;
- this.threshold = (int) (newCapacity * this.loadFactor);
- this.table = newTable;
-
- 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 = newTable[index];
- newTable[index] = e;
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, Entry<T> next) {
- return new Entry(hash, o, next);
- }
-
- @SuppressWarnings("unchecked")
- private <T> Entry<E> buildEntry(int hash, Object o, int cnt, Entry<T> next) {
- return new Entry(hash, o, cnt, next);
- }
-
- /**
- * This implementation searches for the object in the hash table by
- * calculating the object's identity hash code and examining the
- * entries in the corresponding hash table bucket.
- */
- @Override
- 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
- hash = System.identityHashCode(o);
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- 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 = this.buildEntry(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 identity hash code and examining the
- * entries in the corresponding hash table bucket.
- */
- public boolean add(E o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- 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
- hash = System.identityHashCode(o);
- index = (hash & 0x7FFFFFFF) % tab.length;
- for (Entry<E> e = tab[index]; e != null; e = e.next) {
- if ((e.hash == hash) && (e.object == o)) {
- e.count += cnt;
- this.count += cnt;
- 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 = this.buildEntry(hash, o, cnt, tab[index]);
- tab[index] = e;
- this.count += cnt;
- this.uniqueCount++;
- return true;
- }
-
- /**
- * This implementation searches for the object in the hash table by
- * calculating the object's identity hash code and examining the
- * entries in the corresponding hash table bucket.
- */
- @Override
- public boolean remove(Object o) {
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- 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) && (e.object == o)) {
- 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 searches for the object in the hash table by
- * calculating the object's identity hash code and examining the
- * entries in the corresponding hash table bucket.
- */
- public boolean remove(Object o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- Entry<E>[] tab = this.table;
- int hash = System.identityHashCode(o);
- 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) && (e.object == o)) {
- this.modCount++;
- int cnt2 = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt2;
- // if we are removing the last element(s), 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 -= cnt2;
- return true;
- }
- }
- return false;
- }
-
- /**
- * This implementation uses object-identity to determine whether
- * specified collection contains a particular element.
- */
- @Override
- public boolean removeAll(Collection<?> c) {
- return super.removeAll(this.buildIdentityHashBag(c));
- }
-
- /**
- * This implementation uses object-identity to determine whether
- * specified collection contains a particular element.
- */
- @Override
- public boolean retainAll(Collection<?> c) {
- return super.retainAll(this.buildIdentityHashBag(c));
- }
-
- @SuppressWarnings("unchecked")
- private Collection<?> buildIdentityHashBag(Collection<?> c) {
- return new IdentityHashBag(c);
- }
-
- /**
- * 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
- public IdentityHashBag<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- IdentityHashBag<E> clone = (IdentityHashBag<E>) super.clone();
- clone.table = this.buildTable(this.table.length);
- for (int i = this.table.length; i-- > 0; ) {
- clone.table[i] = (this.table[i] == null)
- ? null : (Entry<E>) 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);
- }
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- /**
- * Cascade the clone to all the entries in the same bucket.
- */
- @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 = IdentityHashBag.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 = IdentityHashBag.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 (IdentityHashBag.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 (IdentityHashBag.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) {
- IdentityHashBag.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;
- }
- IdentityHashBag.this.uniqueCount--;
- } else {
- // slide back the count to account for the just-removed element
- this.nextEntryCount--;
- }
- IdentityHashBag.this.count--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
- }
-
- private class UniqueIterator implements Iterator<E> {
- Entry<E>[] localTable = IdentityHashBag.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 = IdentityHashBag.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 (IdentityHashBag.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 (IdentityHashBag.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) {
- IdentityHashBag.this.modCount++;
- this.expectedModCount++;
- // remove the entry from the table
- if (prev == null) {
- tab[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- IdentityHashBag.this.uniqueCount--;
- IdentityHashBag.this.count -= this.lastReturnedEntry.count;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- } else if (o instanceof IdentityHashBag) {
- @SuppressWarnings("unchecked")
- IdentityHashBag<E> b = (IdentityHashBag<E>) o;
- if (b.size() != this.size()) {
- return false;
- }
- IdentityHashBag<E> clone = this.clone();
- for (E e : b) {
- if ( ! clone.remove(e)) {
- return false;
- }
- }
- return clone.isEmpty();
- } else if (o instanceof Bag) {
- // hmmm...
- return this.buildBag().equals(o);
- } else {
- return false;
- }
- }
-
- @SuppressWarnings("unchecked")
- private Bag<E> buildBag() {
- return new HashBag(this);
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (E e : this) {
- h += System.identityHashCode(e);
- }
- 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).
- */
- 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 = this.buildTable(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++) {
- @SuppressWarnings("unchecked")
- 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 f2afb1d4e6..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 indentLevel() {
- 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 e34316fc3b..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.name());
- }
-
- /**
- * 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
-// addJDBCToJavaTypeMappingTo(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.name(), buildJDBCToJavaTypeMapping(jdbcType, javaClass));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate JDBC type: " + jdbcType.name());
- }
- }
-
- 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.code() == jdbcTypeCode;
- }
-
- public boolean maps(String jdbcTypeName) {
- return this.jdbcType.name().equals(jdbcTypeName);
- }
-
- public boolean maps(JDBCType type) {
- return this.jdbcType == type;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuilder 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() {
- StringBuilder sb = new StringBuilder();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuilder 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 82ae294c34..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 name() {
- return this.name;
- }
-
-
- /**
- * Return the type code, as defined in java.sql.Types.
- */
- public int code() {
- return this.code;
- }
-
-
- // ********** printing and displaying **********
-
- public void appendTo(StringBuilder sb) {
- sb.append(this.name);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- 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].code() == 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].name().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 de075524ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JavaType.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 elementTypeName() {
- return this.elementTypeName;
- }
-
- /**
- * Return the type's "array depth".
- */
- public int arrayDepth() {
- return this.arrayDepth;
- }
-
-
- // ********** queries **********
-
- public boolean isArray() {
- return this.arrayDepth > 0;
- }
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- public boolean isPrimitive() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsPrimitive(this.elementTypeName);
- }
-
- /**
- * NB: void.class.isPrimitive() == true
- */
- public boolean isPrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsPrimitiveWrapperClass(this.elementTypeName);
- }
-
- /**
- * NB: variables cannot be declared 'void'
- */
- public boolean isVariablePrimitive() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsVariablePrimitive(this.elementTypeName);
- }
-
- /**
- * NB: variables cannot be declared 'void'
- */
- public boolean isVariablePrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassTools.classNamedIsVariablePrimitiveWrapperClass(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();
- }
- StringBuilder sb = new StringBuilder(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(StringBuilder 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() {
- StringBuilder sb = new StringBuilder();
- 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 5610f00845..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) {
- return null;
- }
- if ((catalog == null) && (schema == null)) {
- return name;
- }
-
- StringBuilder sb = new StringBuilder(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/NullList.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
deleted file mode 100644
index c60d4e5969..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * A "null" list is a bit different from an "empty" list: it allows clients to
- * add/remove elements to/from it but never changes. This is useful
- * for passing to methods that require a "collecting parameter" but the
- * client will ignore the resulting "collection".
- *
- * NB: We return 'null' from the following methods (as opposed to throwing
- * an exception):
- * get(int) : E
- * remove(int) : E
- * set(int, E) : E
- */
-public final class NullList<E> implements List<E> {
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final NullList INSTANCE = new NullList();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <E> List<E> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullList() {
- super();
- }
-
- public boolean add(E o) {
- return false; // the list did not change
- }
-
- public void add(int index, E element) {
- // ignore
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return false; // the list did not change
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return false; // the list did not change
- }
-
- public void clear() {
- // ignore
- }
-
- public boolean contains(Object o) {
- return false;
- }
-
- public boolean containsAll(Collection<?> c) {
- return c.isEmpty();
- }
-
- public E get(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0");
- }
-
- public int indexOf(Object o) {
- return -1;
- }
-
- public boolean isEmpty() {
- return true;
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- public int lastIndexOf(Object o) {
- return -1;
- }
-
- public ListIterator<E> listIterator() {
- return EmptyListIterator.instance();
- }
-
- public ListIterator<E> listIterator(int index) {
- return EmptyListIterator.instance();
- }
-
- public boolean remove(Object o) {
- return false; // the list did not change
- }
-
- public E remove(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0");
- }
-
- public boolean removeAll(Collection<?> c) {
- return false; // the list did not change
- }
-
- public boolean retainAll(Collection<?> c) {
- return false; // the list did not change
- }
-
- public E set(int index, E element) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0");
- }
-
- public int size() {
- return 0;
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- return this;
- }
-
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public Object[] toArray() {
- return EMPTY_OBJECT_ARRAY;
- }
-
- public <T> T[] toArray(T[] a) {
- return a;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-}
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 10c01f80f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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;
- }
-
- 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/SimpleAssociation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java
deleted file mode 100644
index 7c9b0a7401..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Straightforward implementation of Association.
- */
-public class SimpleAssociation<K, V>
- extends AbstractAssociation<K, V>
- implements Cloneable, Serializable
-{
- private final K key;
- private V value;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct an association with the specified key
- * and a null value.
- */
- public SimpleAssociation(K key) {
- super();
- this.key = key;
- }
-
- /**
- * Construct an association with the specified key and value.
- */
- public SimpleAssociation(K key, V value) {
- this(key);
- this.value = value;
- }
-
-
- public K key() {
- return this.key;
- }
-
- public synchronized V value() {
- return this.value;
- }
-
- public synchronized V setValue(V value) {
- V old = this.value;
- this.value = value;
- return old;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized SimpleAssociation<K, V> clone() {
- try {
- return (SimpleAssociation<K, V>) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
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 8cf6bb2650..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Filter;
-
-/**
- * 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/SimpleStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
deleted file mode 100644
index f183943d9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.EmptyStackException;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-/**
- * Straightforward implementation of the Stack interface.
- */
-public class SimpleStack<E>
- implements Stack<E>, Cloneable, Serializable
-{
- private LinkedList<E> elements;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct an empty stack.
- */
- public SimpleStack() {
- super();
- this.elements = new LinkedList<E>();
- }
-
- /**
- * Construct a stack containing the elements of the specified
- * collection. The stack will pop its elements in reverse of the
- * order they are returned by the collection's iterator (i.e. the
- * last element returned by the collection's iterator will be the
- * first element returned by #pop()).
- */
- public SimpleStack(Collection<? extends E> c) {
- super();
- this.elements = new LinkedList<E>(c);
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E o) {
- this.elements.addLast(o);
- }
-
- public E pop() {
- try {
- return this.elements.removeLast();
- } catch (NoSuchElementException ex) {
- throw new EmptyStackException();
- }
- }
-
- public E peek() {
- try {
- return this.elements.getLast();
- } catch (NoSuchElementException ex) {
- throw new EmptyStackException();
- }
- }
-
- public boolean isEmpty() {
- return this.elements.isEmpty();
- }
-
-
- // ********** Cloneable implementation **********
-
- @Override
- public SimpleStack<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- SimpleStack<E> clone = (SimpleStack<E>) super.clone();
- @SuppressWarnings("unchecked")
- LinkedList<E> ll = (LinkedList<E>) this.elements.clone();
- clone.elements = ll;
- return clone;
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java
deleted file mode 100644
index ea5595c4b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-import java.util.regex.Pattern;
-
-import org.eclipse.jpt.utility.Filter;
-
-// TODO the regex code is not very fast - we could probably do better,
-// hand-coding the matching algorithm (eclipse StringMatcher?)
-/**
- * This class implements a simple string-matching algorithm that is a little
- * more user-friendly than standard regular expressions. Instantiate a
- * string matcher with a filter pattern and then you can use the matcher
- * to determine whether another string (or object) matches the pattern.
- * You can also specify whether the matching should be case-sensitive.
- *
- * The pattern can contain two "meta-characters":
- * '*' will match any set of zero or more characters
- * '?' will match any single character
- *
- * Subclasses can override #prefix() and/or #suffix() to change what
- * strings are prepended or appended to the original pattern string.
- * This can offer a slight performance improvement over concatenating
- * strings before calling #setPatternString(String).
- * By default, a '*' is appended to every string.
- *
- * This class also uses the string-matching algorithm to "filter" objects
- * (and, as a result, also implements the Filter interface).
- * A string converter is used to determine what string aspect of the
- * object is compared to the pattern. By default the string returned
- * by the object's #toString() method is passed to the pattern matcher.
- */
-public class SimpleStringMatcher<T>
- implements StringMatcher, Filter<T>, Serializable
-{
-
- /** An adapter that converts the objects into strings to be matched with the pattern. */
- private StringConverter<T> stringConverter;
-
- /** The string used to construct the regular expression pattern. */
- private String patternString;
-
- /** Whether the matcher ignores case - the default is true. */
- private boolean ignoresCase;
-
- /** The regular expression pattern built from the pattern string. */
- private Pattern pattern;
-
- /** A list of the meta-characters we need to escape if found in the pattern string. */
- public static final char[] REG_EX_META_CHARS = { '(', '[', '{', '\\', '^', '$', '|', ')', '?', '*', '+', '.' };
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a string matcher with an pattern that will match
- * any string and ignore case.
- */
- public SimpleStringMatcher() {
- this("*");
- }
-
- /**
- * Construct a string matcher with the specified pattern
- * that will ignore case.
- */
- public SimpleStringMatcher(String patternString) {
- this(patternString, true);
- }
-
- /**
- * Construct a string matcher with the specified pattern that will
- * ignore case as specified.
- */
- public SimpleStringMatcher(String patternString, boolean ignoresCase) {
- super();
- this.patternString = patternString;
- this.ignoresCase = ignoresCase;
- this.initialize();
- }
-
-
- // ********** initialization **********
-
- protected void initialize() {
- this.stringConverter = StringConverter.Default.instance();
- this.rebuildPattern();
- }
-
- /**
- * Given the current pattern string and case-sensitivity setting,
- * re-build the regular expression pattern.
- */
- protected synchronized void rebuildPattern() {
- this.pattern = this.buildPattern();
- }
-
- /**
- * Given the current pattern string and case-sensitivity setting,
- * build and return a regular expression pattern that can be used
- * to match strings.
- */
- protected Pattern buildPattern() {
- int patternFlags = 0x0;
- if (this.ignoresCase) {
- patternFlags = Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE;
- }
- return Pattern.compile(this.convertToRegEx(this.patternString), patternFlags);
- }
-
-
- // ********** StringMatcher implementation **********
-
- public synchronized void setPatternString(String patternString) {
- this.patternString = patternString;
- this.rebuildPattern();
- }
-
- /**
- * Return whether the specified string matches the pattern.
- */
- public synchronized boolean matches(String string) {
- return this.pattern.matcher(string).matches();
- }
-
-
- // ********** Filter implementation **********
-
- public synchronized boolean accept(T o) {
- return this.matches(this.stringConverter.convertToString(o));
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the string converter used to convert the objects
- * passed to the matcher into strings.
- */
- public synchronized StringConverter<T> stringConverter() {
- return this.stringConverter;
- }
-
- /**
- * Set the string converter used to convert the objects
- * passed to the matcher into strings.
- */
- public synchronized void setStringConverter(StringConverter<T> stringConverter) {
- this.stringConverter = stringConverter;
- }
-
- /**
- * Return the original pattern string.
- */
- public synchronized String patternString() {
- return this.patternString;
- }
-
- /**
- * Return whether the matcher ignores case.
- */
- public synchronized boolean ignoresCase() {
- return this.ignoresCase;
- }
-
- /**
- * Set whether the matcher ignores case.
- */
- public synchronized void setIgnoresCase(boolean ignoresCase) {
- this.ignoresCase = ignoresCase;
- this.rebuildPattern();
- }
-
- /**
- * Return the regular expression pattern.
- */
- public synchronized Pattern pattern() {
- return this.pattern;
- }
-
-
- // ********** other public API **********
-
- /**
- * Return the regular expression corresponding to
- * the original pattern string.
- */
- public synchronized String regularExpression() {
- return this.convertToRegEx(this.patternString);
- }
-
-
- // ********** converting **********
-
- /**
- * Convert the specified string to a regular expression.
- */
- protected String convertToRegEx(String string) {
- StringBuffer sb = new StringBuffer(string.length() + 10);
- this.convertToRegExOn(this.prefix(), sb);
- this.convertToRegExOn(string, sb);
- this.convertToRegExOn(this.suffix(), sb);
- return sb.toString();
- }
-
- /**
- * Return any prefix that should be prepended to the original
- * string. By default, there is no prefix.
- */
- protected String prefix() {
- return "";
- }
-
- /**
- * Return any suffix that should be appended to the original
- * string. Since this class is typically used in UI situation where
- * the user is typing in a pattern used to filter a list, the default
- * suffix is a wildcard character.
- */
- protected String suffix() {
- return "*";
- }
-
- /**
- * Convert the specified string to a regular expression.
- */
- protected void convertToRegExOn(String string, StringBuffer sb) {
- char[] charArray = string.toCharArray();
- int length = charArray.length;
- for (int i = 0; i < length; i++) {
- char c = charArray[i];
- // convert user-friendly meta-chars into regex meta-chars
- if (c == '*') {
- sb.append(".*");
- continue;
- }
- if (c == '?') {
- sb.append('.');
- continue;
- }
- // escape regex meta-chars
- if (CollectionTools.contains(REG_EX_META_CHARS, c)) {
- sb.append('\\');
- }
- sb.append(c);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java
deleted file mode 100644
index 93bef64f4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-
-/**
- * Interface defining the classic stack behavior,
- * without the backdoors allowed by java.util.Stack.
- * E is the type of elements contained by the Stack.
- */
-public interface Stack<E> {
-
- /**
- * "Push" the specified item on to the top of the stack.
- */
- void push(E o);
-
- /**
- * "Pop" an item from the top of the stack.
- */
- E pop();
-
- /**
- * Return the item on the top of the stack
- * without removing it from the stack.
- */
- E peek();
-
- /**
- * Return whether the stack is empty.
- */
- boolean isEmpty();
-
-
- final class Empty<E> implements Stack<E>, Serializable {
- @SuppressWarnings("unchecked")
- public static final Stack INSTANCE = new Empty();
- @SuppressWarnings("unchecked")
- public static <T> Stack<T> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- public void push(E o) {
- throw new UnsupportedOperationException();
- }
- public E pop() {
- throw new EmptyStackException();
- }
- public E peek() {
- throw new EmptyStackException();
- }
- public boolean isEmpty() {
- return true;
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
deleted file mode 100644
index 556b530862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
+++ /dev/null
@@ -1,68 +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.utility.internal;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * into strings.
- */
-public interface StringConverter<T> {
-
- /**
- * Convert the specified object into a string.
- * The semantics of "convert" is determined by the
- * contract between the client and the server.
- */
- String convertToString(T o);
-
-
- final class Default<S> implements StringConverter<S> {
- @SuppressWarnings("unchecked")
- public static final StringConverter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> StringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply return the object's #toString() result
- public String convertToString(S o) {
- return (o == null) ? null : o.toString();
- }
- @Override
- public String toString() {
- return "StringConverter.Default";
- }
- }
-
- final class Disabled<S> implements StringConverter<S> {
- @SuppressWarnings("unchecked")
- public static final StringConverter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> StringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public String convertToString(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "StringConverter.Disabled";
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java
deleted file mode 100644
index 5f769d7040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-/**
- * This interface defines a simple API for allowing "pluggable"
- * string matchers that can be configured with a pattern string
- * then used to determine what strings match the pattern.
- */
-public interface StringMatcher {
-
- /**
- * Set the pattern string used to determine future
- * matches. The format and semantics of the pattern
- * string are determined by the contract between the
- * client and the server.
- */
- void setPatternString(String patternString);
-
- /**
- * Return whether the specified string matches the
- * established pattern string. The semantics of a match
- * is determined by the contract between the
- * client and the server.
- */
- boolean matches(String string);
-
-
- final class Null implements StringMatcher {
- public static final StringMatcher INSTANCE = new Null();
- public static StringMatcher instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void setPatternString(String patternString) {
- // ignore the pattern string
- }
- public boolean matches(String string) {
- // everything is a match
- return true;
- }
- @Override
- public String toString() {
- return "StringMatcher.Null";
- }
- }
-
-}
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 a7cc25a96c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
+++ /dev/null
@@ -1,3243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 spaces at the end.
- * String#padOn(int, StringBuilder)
- */
- public static void padOn(String string, int length, StringBuilder 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 pad_(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) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- padOn_(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(String 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 {
- padOn_(string, 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 the
- * specified character at the end.
- * String#padOn(int, char, StringBuilder)
- */
- public static void padOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(string, 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 spaces at the end.
- * String#padOn(int, StringBuilder)
- */
- public static void padOn(char[] string, int length, StringBuilder 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 pad_(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 {
- padOn_(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 {
- padOn_(string, 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 the
- * specified character at the end.
- * String#padOn(int, char, StringBuilder)
- */
- public static void padOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(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 spaces at the end.
- * String#padOrTruncateOn(int, StringBuilder)
- */
- public static void padOrTruncateOn(String string, int length, StringBuilder 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 pad_(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) {
- int stringLength = string.length();
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string.substring(0, length), writer);
- } else {
- padOn_(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(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(0, length));
- } else {
- padOn_(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 the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuilder)
- */
- public static void padOrTruncateOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(0, length));
- } else {
- padOn_(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 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 spaces at the end.
- * String#padOrTruncateOn(int, StringBuilder)
- */
- public static void padOrTruncate(char[] string, int length, StringBuilder 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 pad_(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 {
- padOn_(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 {
- padOn_(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 the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuilder)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, 0, length);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static String pad_(String string, int length, char c) {
- return new String(pad_(string.toCharArray(), length, c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, Writer writer) {
- writeStringOn(string, writer);
- fill_(string, length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, Writer writer) {
- fill_(string.length(), length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, Writer writer) {
- fill_(string.length, length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, Writer writer) {
- writeStringOn(CollectionTools.fill(new char[length - stringLength], c), writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, StringBuffer sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, StringBuffer sb) {
- fill_(string.length(), length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, StringBuffer sb) {
- fill_(string.length, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, StringBuffer sb) {
- sb.append(CollectionTools.fill(new char[length - stringLength], c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, StringBuilder sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, StringBuilder sb) {
- fill_(string.length(), length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, StringBuilder sb) {
- fill_(string.length, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, StringBuilder sb) {
- sb.append(CollectionTools.fill(new char[length - stringLength], c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static char[] pad_(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 padOn_(char[] string, int length, char c, Writer writer) {
- writeStringOn(string, writer);
- fill_(string, length, c, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(char[] string, int length, char c, StringBuffer sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(char[] string, int length, char c, StringBuilder sb) {
- sb.append(string);
- fill_(string, 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 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 zeros at the front.
- * String#zeroPadOn(int, StringBuilder)
- */
- public static void zeroPadOn(String string, int length, StringBuilder 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 frontPad_(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) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- frontPadOn_(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(String 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 {
- frontPadOn_(string, 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 the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuilder)
- */
- public static void frontPadOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(string, 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 zeros at the front.
- * String#zeroPadOn(int, StringBuilder)
- */
- public static void zeroPadOn(char[] string, int length, StringBuilder 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 frontPad_(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 {
- frontPadOn_(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 {
- frontPadOn_(string, 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 the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuilder)
- */
- public static void frontPadOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length);
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(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 zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuilder)
- */
- public static void zeroPadOrTruncateOn(String string, int length, StringBuilder 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 frontPad_(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) {
- int stringLength = string.length();
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string.substring(stringLength - length), writer);
- } else {
- frontPadOn_(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(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(stringLength - length));
- } else {
- frontPadOn_(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 the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuilder)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(stringLength - length));
- } else {
- frontPadOn_(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 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 zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuilder)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, StringBuilder 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 frontPad_(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 {
- frontPadOn_(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 {
- frontPadOn_(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 the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuilder)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, stringLength - length, length);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /*
- * Front-pad the specified string without validating the parms.
- */
- private static String frontPad_(String string, int length, char c) {
- return new String(frontPad_(string.toCharArray(), length, c));
- }
-
- /*
- * Zero-pad the specified string without validating the parms.
- */
- private static char[] frontPad_(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 frontPadOn_(String string, int length, char c, Writer writer) {
- fill_(string, length, c, writer);
- writeStringOn(string, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, Writer writer) {
- fill_(string, length, c, writer);
- writeStringOn(string, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(String string, int length, char c, StringBuffer sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, StringBuffer sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(String string, int length, char c, StringBuilder sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, StringBuilder sb) {
- fill_(string, length, c, sb);
- 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 the specified string with double quotes.
- */
- public static void quoteOn(String string, StringBuilder 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) {
- 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(String string, char wrap, StringBuffer sb) {
- sb.append(wrap);
- sb.append(string);
- sb.append(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, StringBuilder 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<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) {
- 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(String string, String wrap, StringBuffer sb) {
- sb.append(wrap);
- sb.append(string);
- sb.append(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, String wrap, StringBuilder 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<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 the specified string with double quotes.
- */
- public static void quoteOn(char[] string, StringBuilder 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 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, StringBuilder 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 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, StringBuilder 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) {
- int index = string.indexOf(c);
- if (index == -1) {
- writeStringOn(string, writer);
- } else {
- removeFirstOccurrenceOn_(string.toCharArray(), c, writer, index);
- }
- }
-
- /**
- * 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) {
- int index = string.indexOf(c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeFirstOccurrenceOn_(string.toCharArray(), c, sb, index);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuilder)
- */
- public static void removeFirstOccurrenceOn(String string, char c, StringBuilder sb) {
- int index = string.indexOf(c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeFirstOccurrenceOn_(string.toCharArray(), c, sb, index);
- }
- }
-
- /**
- * 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 last = string.length - 1;
- char[] result = new char[last];
- if (index == 0) {
- // character found at the front of string
- System.arraycopy(string, 1, result, 0, last);
- } else if (index == last) {
- // character found at the end of string
- System.arraycopy(string, 0, result, 0, last);
- } else {
- // character found somewhere in the middle of the string
- System.arraycopy(string, 0, result, 0, index);
- System.arraycopy(string, index + 1, result, index, last - 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) {
- writeStringOn(string, writer);
- } else {
- removeFirstOccurrenceOn_(string, c, writer, index);
- }
- }
-
- private static void removeFirstOccurrenceOn_(char[] string, char c, Writer writer, int index) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- writeStringOn(string, 1, last, writer);
- } else if (index == last) {
- // character found at the end of string
- writeStringOn(string, 0, last, writer);
- } else {
- // character found somewhere in the middle of the string
- writeStringOn(string, 0, index, writer);
- writeStringOn(string, index + 1, last - 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) {
- sb.append(string);
- } else {
- removeFirstOccurrenceOn_(string, c, sb, index);
- }
- }
-
- private static void removeFirstOccurrenceOn_(char[] string, char c, StringBuffer sb, int index) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- sb.append(string, 1, last);
- } else if (index == last) {
- // character found at the end of string
- sb.append(string, 0, last);
- } else {
- // character found somewhere in the middle of the string
- sb.append(string, 0, index);
- sb.append(string, index + 1, last - index);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuilder)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, StringBuilder sb) {
- int index = CollectionTools.indexOf(string, c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeFirstOccurrenceOn_(string, c, sb, index);
- }
- }
-
- private static void removeFirstOccurrenceOn_(char[] string, char c, StringBuilder sb, int index) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- sb.append(string, 1, last);
- } else if (index == last) {
- // character found at the end of string
- sb.append(string, 0, last);
- } else {
- // character found somewhere in the middle of the string
- sb.append(string, 0, index);
- sb.append(string, index + 1, last - 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) {
- int first = string.indexOf(c);
- return (first == -1) ? string : new String(removeAllOccurrences_(string.toCharArray(), c, first));
- }
-
- /**
- * 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) {
- int first = string.indexOf(c);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, 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) {
- int first = string.indexOf(c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, sb);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, StringBuilder)
- */
- public static void removeAllOccurrencesOn(String string, char c, StringBuilder sb) {
- int first = string.indexOf(c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, 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) {
- int first = CollectionTools.indexOf(string, c);
- return (first == -1) ? string : removeAllOccurrences_(string, c, first);
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static char[] removeAllOccurrences_(char[] string, char c, int first) {
- StringBuilder sb = new StringBuilder(string.length);
- removeAllOccurrencesOn_(string, c, first, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * 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) {
- int first = CollectionTools.indexOf(string, c);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllOccurrencesOn_(string, c, first, writer);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, Writer writer) {
- writeStringOn(string, 0, first, writer);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- 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) {
- int first = CollectionTools.indexOf(string, c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string, c, first, sb);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, StringBuffer sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- if (d != c) {
- sb.append(d);
- }
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllOccurrencesOn(char, StringBuilder)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, StringBuilder sb) {
- int first = CollectionTools.indexOf(string, c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string, c, first, sb);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, StringBuilder sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- 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, ' ');
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified writer.
- * String#removeAllSpacesOn(Writer)
- */
- public static void removeAllSpacesOn(String string, Writer writer) {
- removeAllOccurrencesOn(string, ' ', writer);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified
- * string buffer.
- * String#removeAllSpacesOn(StringBuffer)
- */
- public static void removeAllSpacesOn(String string, StringBuffer sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified
- * string builder.
- * String#removeAllSpacesOn(StringBuilder)
- */
- public static void removeAllSpacesOn(String string, StringBuilder sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces from the specified string and return the result.
- * String#removeAllSpaces()
- */
- public static char[] removeAllSpaces(char[] string) {
- return removeAllOccurrences(string, ' ');
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the
- * specified writer.
- * String#removeAllSpacesOn(Writer)
- */
- public static void removeAllSpacesOn(char[] string, Writer writer) {
- removeAllOccurrencesOn(string, ' ', writer);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllSpacesOn(StringBuffer)
- */
- public static void removeAllSpacesOn(char[] string, StringBuffer sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllSpacesOn(StringBuilder)
- */
- public static void removeAllSpacesOn(char[] string, StringBuilder sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the whitespace from the specified string and return the result.
- * String#removeAllWhitespace()
- */
- public static String removeAllWhitespace(String string) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- return (first == -1) ? string : new String(removeAllWhitespace_(string2, first));
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified writer.
- * String#removeAllWhitespaceOn(Writer)
- */
- public static void removeAllWhitespaceOn(String string, Writer writer) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllWhitespaceOn_(string2, first, writer);
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllWhitespaceOn(StringBuffer)
- */
- public static void removeAllWhitespaceOn(String string, StringBuffer sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllWhitespaceOn(StringBuilder)
- */
- public static void removeAllWhitespaceOn(String string, StringBuilder sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Remove all the whitespace from the specified string and return the result.
- * String#removeAllWhitespace()
- */
- public static char[] removeAllWhitespace(char[] string) {
- int first = indexOfWhitespace_(string);
- return (first == -1) ? string : removeAllWhitespace_(string, first);
- }
-
- private static int indexOfWhitespace_(char[] string) {
- int len = string.length;
- for (int i = 0; i < len; i++) {
- if (Character.isWhitespace(string[i])) {
- return i;
- }
- }
- return -1;
- }
-
- /*
- * The index of the first non-whitespace character is passed in.
- */
- private static char[] removeAllWhitespace_(char[] string, int first) {
- StringBuilder sb = new StringBuilder(string.length);
- removeAllWhitespaceOn_(string, first, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified writer.
- * String#removeAllWhitespaceOn(Writer)
- */
- public static void removeAllWhitespaceOn(char[] string, Writer writer) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllWhitespaceOn_(string, first, writer);
- }
- }
-
- /*
- * The index of the first non-whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, Writer writer) {
- writeStringOn(string, 0, first, writer);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- writeCharOn(c, writer);
- }
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllWhitespaceOn(StringBuffer)
- */
- public static void removeAllWhitespaceOn(char[] string, StringBuffer sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first non-whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, StringBuffer sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- sb.append(c);
- }
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllWhitespaceOn(StringBuilder)
- */
- public static void removeAllWhitespaceOn(char[] string, StringBuilder sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first non-whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, StringBuilder sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- sb.append(c);
- }
- }
- }
-
-
- // ********** 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 commonPrefixLength_(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 commonPrefixLength_(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 commonPrefixLength_(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[] capitalize_(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 capitalize_(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(capitalize_(string.toCharArray()));
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(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 {
- capitalizeOn_(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 {
- capitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(char[] string, StringBuilder sb) {
- sb.append(Character.toUpperCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, StringBuilder sb) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- sb.append(string);
- } else {
- capitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter capitalized.
- * String#capitalizeOn(StringBuffer)
- */
- public static void capitalizeOn(String string, StringBuilder sb) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- sb.append(string);
- } else {
- capitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(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 {
- capitalizeOn_(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 {
- capitalizeOn_(string.toCharArray(), writer);
- }
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static char[] uncapitalize_(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 uncapitalize_(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(uncapitalize_(string.toCharArray()));
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static void uncapitalizeOn_(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 {
- uncapitalizeOn_(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 {
- uncapitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static void uncapitalizeOn_(char[] string, StringBuilder sb) {
- sb.append(Character.toLowerCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string builder
- * 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, StringBuilder sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string builder
- * 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, StringBuilder sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void uncapitalizeOn_(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 {
- uncapitalizeOn_(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 {
- uncapitalizeOn_(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) {
- StringBuilder sb = new StringBuilder();
- 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) {
- StringBuilder sb = new StringBuilder();
- 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(']');
- }
-
- /**
- * Append a "standard" simple #toString() for the specified object to
- * the specified string builder:
- * ClassName[00F3EE42]
- */
- public static void buildSimpleToStringOn(Object o, StringBuilder 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 stringIsEmpty_(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 stringIsEmpty_(string);
- }
-
- private static boolean stringIsEmpty_(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) {
- int len = camelCaseString.length();
- if (len == 0) {
- return camelCaseString;
- }
- return new String(convertCamelCaseToAllCaps_(camelCaseString.toCharArray(), len));
- }
-
- /**
- * 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;
- }
- return convertCamelCaseToAllCaps_(camelCaseString, len);
- }
-
- private static char[] convertCamelCaseToAllCaps_(char[] camelCaseString, int len) {
- StringBuilder sb = new StringBuilder(len * 2);
- convertCamelCaseToAllCapsOn_(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) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, 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) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(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, StringBuilder sb) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, sb);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, StringBuilder sb) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int len, StringBuilder 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) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, 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) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(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) {
- int len = camelCaseString.length();
- if ((len == 0) || (maxLength == 0)) {
- return camelCaseString;
- }
- return new String(convertCamelCaseToAllCaps_(camelCaseString.toCharArray(), maxLength, len));
- }
-
- /**
- * 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;
- }
- return convertCamelCaseToAllCaps_(camelCaseString, maxLength, len);
- }
-
- private static char[] convertCamelCaseToAllCaps_(char[] camelCaseString, int maxLength, int len) {
- StringBuilder sb = new StringBuilder(maxLength);
- convertCamelCaseToAllCapsOn_(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) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, 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)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(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, StringBuilder sb) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, 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, StringBuilder sb) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int maxLength, int len, StringBuilder 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) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, 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)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(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 convertUnderscoresToCamelCase(underscoreString, true);
- }
-
- /**
- * 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) {
- int len = underscoreString.length();
- if (len == 0) {
- return underscoreString;
- }
- return new String(convertUnderscoresToCamelCase_(underscoreString.toCharArray(), capitalizeFirstLetter, len));
- }
-
- /**
- * 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;
- }
- return convertUnderscoresToCamelCase_(underscoreString, capitalizeFirstLetter, len);
- }
-
- private static char[] convertUnderscoresToCamelCase_(char[] underscoreString, boolean capitalizeFirstLetter, int len) {
- StringBuilder sb = new StringBuilder(len);
- convertUnderscoresToCamelCaseOn_(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) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, 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) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, sb);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(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, StringBuilder sb) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, 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, StringBuilder sb) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, sb);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(char[] underscoreString, boolean capitalizeFirstLetter, int len, StringBuilder 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) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, 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) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, writer);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(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;
- }
-
- public static char[] convertToCharArray(StringBuilder sb) {
- int len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- private static void writeStringOn(char[] string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- 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);
- }
- }
-
- private static void writeStringOn(String string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- 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/SynchronizedBoolean.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
deleted file mode 100644
index 92b6bc1f96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to a boolean value.
- * It also provides protocol for suspending a thread until the
- * boolean value is set to true or false, with optional time-outs.
- */
-public class SynchronizedBoolean
- implements Cloneable, Serializable
-{
- /** Backing boolean. */
- private boolean value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized boolean with the specified initial value
- * and mutex.
- */
- public SynchronizedBoolean(boolean value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized boolean with the specified initial value.
- */
- public SynchronizedBoolean(boolean value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized boolean with an initial value of false
- * and specified mutex.
- */
- public SynchronizedBoolean(Object mutex) {
- this(false, mutex);
- }
-
- /**
- * Create a synchronized boolean with an initial value of false.
- */
- public SynchronizedBoolean() {
- this(false);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current boolean value.
- */
- public boolean value() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current boolean value is true.
- */
- public boolean isTrue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current boolean value is false.
- */
- public boolean isFalse() {
- synchronized (this.mutex) {
- return ! this.value;
- }
- }
-
- /**
- * Set the boolean value. If the value changes, all waiting
- * threads are notified.
- */
- public void setValue(boolean value) {
- synchronized (this.mutex) {
- if (this.value != value) {
- this.value = value;
- this.mutex.notifyAll();
- }
- }
- }
-
- /**
- * Set the boolean value to true. If the value changes, all waiting
- * threads are notified.
- */
- public void setTrue() {
- synchronized (this.mutex) {
- this.setValue(true);
- }
- }
-
- /**
- * Set the boolean value to false. If the value changes, all waiting
- * threads are notified.
- */
- public void setFalse() {
- synchronized (this.mutex) {
- this.setValue(false);
- }
- }
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the boolean value changes
- * to the specified value. If the boolean value is already the
- * specified value, return immediately.
- */
- public void waitUntilValueIs(boolean v) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.value != v) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true.
- * If the boolean value is already true, return immediately.
- */
- public void waitUntilTrue() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(true);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to false.
- * If the boolean value is already false, return immediately.
- */
- public void waitUntilFalse() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(false);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to
- * NOT the specified value, then change it back to the specified
- * value and continue executing. If the boolean value is already
- * NOT the specified value, set the value to the specified value
- * immediately.
- */
- public void waitToSetValue(boolean v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs( ! v);
- this.setValue(v);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to false,
- * then change it back to true and continue executing. If the boolean
- * value is already false, set the value to true immediately.
- */
- public void waitToSetTrue() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitToSetValue(true);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true,
- * then change it back to false and continue executing. If the boolean
- * value is already true, set the value to false immediately.
- */
- public void waitToSetFalse() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitToSetValue(false);
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the boolean value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already the specified value, return true
- * immediately.
- */
- public boolean waitUntilValueIs(boolean v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- if (timeout == 0L) {
- this.waitUntilValueIs(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value != v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value == v);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes
- * to true or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already true, return true immediately.
- */
- public boolean waitUntilTrue(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(true, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes
- * to false or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the boolean value is already true, return true immediately.
- */
- public boolean waitUntilFalse(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(false, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to NOT the
- * specified value, then change it back to the specified value and continue
- * executing. If the boolean value does not change to false before the
- * time-out, simply continue executing without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to the specified value; return false if a time-out occurred.
- * If the boolean value is already NOT the specified value, set the value
- * to the specified value immediately and return true.
- */
- public boolean waitToSetValue(boolean v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilValueIs( ! v, timeout);
- if (success) {
- this.setValue(v);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to false,
- * then change it back to true and continue executing. If the boolean
- * value does not change to false before the time-out, simply continue
- * executing without changing the value. The time-out is specified in
- * milliseconds. Return true if the value was set to true; return false
- * if a time-out occurred. If the boolean value is already false, set the
- * value to true immediately and return true.
- */
- public boolean waitToSetTrue(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitToSetValue(true, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the boolean value changes to true,
- * then change it back to false and continue executing. If the boolean
- * value does not change to true before the time-out, simply continue
- * executing without changing the value. The time-out is specified in
- * milliseconds. Return true if the value was set to false; return false
- * if a time-out occurred. If the boolean value is already true, set the
- * value to false immediately and return true.
- */
- public boolean waitToSetFalse(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitToSetValue(false, timeout);
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If the current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the value in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public Object clone() {
- try {
- synchronized (this.mutex) {
- return super.clone();
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (o instanceof SynchronizedBoolean) {
- return this.value() == ((SynchronizedBoolean) o).value();
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return this.value() ? 1 : 0;
- }
-
- @Override
- public String toString() {
- return String.valueOf(this.value());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
deleted file mode 100644
index bfb09c3c62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to an object of type T.
- * It also provides protocol for suspending a thread until the
- * value is set to null or a non-null value, with optional time-outs.
- */
-public class SynchronizedObject<T>
- implements Cloneable, Serializable
-{
- /** Backing value. */
- private T value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized object with the specified initial value
- * and mutex.
- */
- public SynchronizedObject(T value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized object with the specified initial value.
- */
- public SynchronizedObject(T value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized object with an initial value of null.
- */
- public SynchronizedObject() {
- this(null);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current value.
- */
- public T value() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current value is null.
- */
- public boolean isNull() {
- synchronized (this.mutex) {
- return this.value == null;
- }
- }
-
- /**
- * Return whether the current value is not null.
- */
- public boolean isNotNull() {
- synchronized (this.mutex) {
- return this.value != null;
- }
- }
-
- /**
- * Set the value. If the value changes, all waiting
- * threads are notified.
- */
- public void setValue(T value) {
- synchronized (this.mutex) {
- if (this.value != value) {
- this.value = value;
- this.mutex.notifyAll();
- }
- }
- }
-
- /**
- * Set the value to null. If the value changes, all waiting
- * threads are notified.
- */
- public void setNull() {
- synchronized (this.mutex) {
- this.setValue(null);
- }
- }
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value. If the value is already the
- * specified value, return immediately.
- */
- public void waitUntilValueIs(T v) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.value != v) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than the specified value. If the
- * value is already NOT the specified value, return immediately.
- */
- public void waitUntilValueIsNot(T v) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.value == v) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the value changes to null.
- * If the value is already null, return immediately.
- */
- public void waitUntilNull() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs(null);
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than null.
- * If the value is already NOT null, return immediately.
- */
- public void waitUntilNotNull() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIsNot(null);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value is already NOT the specified value, set
- * the value immediately.
- */
- public void waitToSetValue(T v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIsNot(v);
- this.setValue(v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than null, then change it back to null
- * and continue executing. If the value is already NOT null,
- * set the value to null immediately.
- */
- public void waitToSetNull() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilNotNull();
- this.setValue(null);
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already the specified value, return true immediately.
- */
- public boolean waitUntilValueIs(T v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- if (timeout == 0L) {
- this.waitUntilValueIs(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value != v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value == v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was removed; return false if a time-out occurred.
- * If the value is already NOT the specified value, return true immediately.
- */
- public boolean waitUntilValueIsNot(T v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- if (timeout == 0L) {
- this.waitUntilValueIsNot(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value == v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value != v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to null or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already null, return true immediately.
- */
- public boolean waitUntilNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs(null, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than null or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- * If the value is already NOT null, return true immediately.
- */
- public boolean waitUntilNotNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIsNot(null, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value does not change to something other than the
- * specified before the time-out, simply continue executing
- * without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to true; return false if a time-out occurred.
- * If the value is already something other than the specified value, set
- * the value immediately and return true.
- */
- public boolean waitToSetValue(T v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilValueIsNot(v, timeout);
- if (success) {
- this.setValue(v);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than null, then change it back to null and continue executing.
- * If the value does not change to something other than null before
- * the time-out, simply continue executing without changing the value.
- * The time-out is specified in milliseconds. Return true if the value was
- * set to false; return false if a time-out occurred.
- * If the value is already something other than null, set
- * the value to null immediately and return true.
- */
- public boolean waitToSetNull(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilNotNull(timeout);
- if (success) {
- this.setValue(null);
- }
- return success;
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the value in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public SynchronizedObject<T> clone() {
- try {
- synchronized (this.mutex) {
- @SuppressWarnings("unchecked")
- SynchronizedObject<T> clone = (SynchronizedObject<T>) super.clone();
- return clone;
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- if ( ! (obj instanceof SynchronizedObject)) {
- return false;
- }
- Object v1 = this.value();
- Object v2 = ((SynchronizedObject<?>) obj).value();
- return (v1 == null) ?
- (v2 == null) : v1.equals(v2);
- }
-
- @Override
- public int hashCode() {
- Object v = this.value();
- return (v == null) ? 0 : v.hashCode();
- }
-
- @Override
- public String toString() {
- return String.valueOf(this.value());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
deleted file mode 100644
index c6382bbd4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Thread-safe implementation of the Stack interface.
- * This also provides protocol for suspending a thread until the
- * stack is empty or not empty, with optional time-outs.
- */
-public class SynchronizedStack<E>
- implements Stack<E>, Serializable
-{
- /** Backing stack. */
- private Stack<E> stack;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a synchronized stack that wraps the
- * specified stack and locks on the specified mutex.
- */
- public SynchronizedStack(Stack<E> stack, Object mutex) {
- super();
- this.stack = stack;
- this.mutex = mutex;
- }
-
- /**
- * Construct a synchronized stack that wraps the
- * specified stack and locks on itself.
- */
- public SynchronizedStack(Stack<E> stack) {
- super();
- this.stack = stack;
- this.mutex = this;
- }
-
- /**
- * Construct a synchronized stack that locks on the specified mutex.
- */
- public SynchronizedStack(Object mutex) {
- this(new SimpleStack<E>(), mutex);
- }
-
- /**
- * Construct a synchronized stack that locks on itself.
- */
- public SynchronizedStack() {
- this(new SimpleStack<E>());
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E o) {
- synchronized (this.mutex) {
- this.stack.push(o);
- this.mutex.notifyAll();
- }
- }
-
- public E pop() {
- synchronized (this.mutex) {
- E o = this.stack.pop();
- this.mutex.notifyAll();
- return o;
- }
- }
-
- public E peek() {
- synchronized (this.mutex) {
- return this.stack.peek();
- }
- }
-
- public boolean isEmpty() {
- synchronized (this.mutex) {
- return this.stack.isEmpty();
- }
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the stack's empty status changes
- * to the specified value.
- */
- public void waitUntilEmptyIs(boolean empty) throws InterruptedException {
- synchronized (this.mutex) {
- while (this.isEmpty() != empty) {
- this.mutex.wait();
- }
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty.
- */
- public void waitUntilEmpty() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs(true);
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it.
- */
- public void waitUntilNotEmpty() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs(false);
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty,
- * then "push" the specified item on to the top of the stack
- * and continue executing.
- */
- public void waitToPush(E o) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmpty();
- this.push(o);
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it,
- * then "pop" an item from the top of the stack and return it.
- */
- public Object waitToPop() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilNotEmpty();
- return this.pop();
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the stack's empty status changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if the specified
- * value was achieved; return false if a time-out occurred.
- */
- public boolean waitUntilEmptyIs(boolean empty, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- if (timeout == 0L) {
- this.waitUntilEmptyIs(empty); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.isEmpty() != empty) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.isEmpty() == empty);
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if
- * the stack is empty; return false if a time-out occurred.
- */
- public boolean waitUntilEmpty(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilEmptyIs(true, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it.
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return true if
- * the stack has something on it; return false if a time-out occurred.
- */
- public boolean waitUntilNotEmpty(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilEmptyIs(false, timeout);
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty,
- * then "push" the specified item on to the top of the stack
- * and continue executing. If the stack is not emptied out
- * before the time-out, simply continue executing without
- * "pushing" the item.
- * The time-out is specified in milliseconds. Return true if the
- * item was pushed; return false if a time-out occurred.
- */
- public boolean waitToPush(E o, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmpty(timeout);
- if (success) {
- this.push(o);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it,
- * then "pop" an item from the top of the stack and return it.
- * If the stack is empty and nothing is "pushed" on to it before the
- * time-out, throw an empty stack exception.
- * The time-out is specified in milliseconds.
- */
- public Object waitToPop(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilNotEmpty(timeout);
- if (success) {
- return this.pop();
- }
- throw new EmptyStackException();
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If the current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the stack in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** additional public protocol **********
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object mutex() {
- return this.mutex;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return this.stack.toString();
- }
- }
-
-}
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 75e4cc0839..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java
+++ /dev/null
@@ -1,69 +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";
- }
- }
-
- final class Disabled<S1, S2> implements Transformer<S1, S2> {
- @SuppressWarnings("unchecked")
- public static final Transformer INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R1, R2> Transformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S2 transform(S1 o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Transformer.Disabled";
- }
- }
-
-}
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 fcc359de00..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
- StringBuilder sb = new StringBuilder(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) {
- StringBuilder sb = new StringBuilder(s.length());
- StringBuilder temp = new StringBuilder(); // 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, StringBuilder 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, StringBuilder sb) {
- sb.append("&#x");
- sb.append(Integer.toString(c, 16));
- sb.append(';');
- }
-
- private void decodeTo(Reader reader, StringBuilder sb, StringBuilder temp) {
- try {
- this.decodeTo_(reader, sb, temp);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void decodeTo_(Reader reader, StringBuilder sb, StringBuilder 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, StringBuilder sb, StringBuilder temp) throws IOException {
- int c = reader.read();
- this.checkChar(c, '#');
- c = reader.read();
- this.checkChar(c, 'x');
-
- temp.setLength(0); // re-use temp
- 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 ea5076e854..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
+++ /dev/null
@@ -1,145 +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 disabled linker.
- * 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.Disabled.<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";
- }
- }
-
- final class Disabled<S> implements Linker<S> {
- @SuppressWarnings("unchecked")
- public static final Linker INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Linker<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S nextLink(S currentLink) {
- throw new UnsupportedOperationException(); // ChainIterator.nextLink(Object) was not implemented
- }
- @Override
- public String toString() {
- return "ChainIterator.Linker.Disabled";
- }
- }
-
- }
-
-}
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 cf823a5e2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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<Object> 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<? extends 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.
- */
- public CloneIterator(Collection<? extends E> c, Mutator<E> mutator) {
- super();
- this.nestedIterator = new ArrayIterator<Object>(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.nestedNext();
- this.removeAllowed = true;
- return this.current;
- }
-
- public void remove() {
- if ( ! this.removeAllowed) {
- throw new IllegalStateException();
- }
- this.remove(this.current);
- this.removeAllowed = false;
- }
-
-
- // ********** internal methods **********
-
- /**
- * The collection passed in during construction held Es,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.nestedIterator.next();
- }
-
- /**
- * 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 bbad3409e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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<Object> 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<? extends 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.
- */
- public CloneListIterator(List<? extends 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(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.nestedNext();
- 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.nestedPrevious();
- 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 **********
-
- /**
- * The list passed in during construction held Es,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.nestedListIterator.next();
- }
-
- /**
- * The list passed in during construction held Es,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (Object[]).
- */
- @SuppressWarnings("unchecked")
- protected E nestedPrevious() {
- return (E) this.nestedListIterator.previous();
- }
-
- /**
- * 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);
- }
-
-
- // ********** overrides **********
-
- @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 083f535b4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.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.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;
-
-
- // ********** constructors **********
-
- /**
- * 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));
- }
-
-
- // ********** Iterator implementation **********
-
- 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();
- }
- }
-
-
- // ********** overrides **********
-
- @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 c2037f053d..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 1e7721a892..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 final 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 af8a394119..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;
-
-/**
- * An <code>EmptyIterator</code> is just that.
- */
-public final class EmptyIterator<E>
- implements Iterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final 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 5d6df99a2b..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;
-
-/**
- * An <code>EmptyListIterator</code> is just that.
- */
-public final class EmptyListIterator<E>
- implements ListIterator<E>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- private static final 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 dd8230bf26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.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<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<? extends E1> nestedIterator;
- private final Filter<E1> filter;
- private E2 next;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified nested
- * iterator and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> method instead of building
- * a <code>Filter</code>.
- */
- public FilteringIterator(Iterator<? extends E1> nestedIterator) {
- this(nestedIterator, Filter.Disabled.<E1>instance());
- }
-
- /**
- * Construct an iterator with the specified nested
- * iterator and filter.
- */
- public FilteringIterator(Iterator<? extends E1> nestedIterator, Filter<E1> filter) {
- super();
- this.nestedIterator = nestedIterator;
- this.filter = filter;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E2 next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E2 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>.
- */
- private void loadNext() {
- this.done = true;
- while (this.nestedIterator.hasNext() && (this.done)) {
- E1 temp = this.nestedIterator.next();
- if (this.accept(temp)) {
- // assume that if the object was accepted it is of type E
- this.next = this.cast(temp);
- this.done = false;
- } else {
- this.next = null;
- this.done = true;
- }
- }
- }
-
- /**
- * We have to assume the filter will only "accept" objects that can
- * be cast to E2.
- */
- @SuppressWarnings("unchecked")
- private E2 cast(E1 o) {
- return (E2) o;
- }
-
- /**
- * 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>.
- */
- protected boolean accept(E1 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/GenericIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
deleted file mode 100644
index 246ead8b91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GenericIteratorWrapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterator on elements of any sub-type of E, converting it into an
- * iterator on elements of type E. This shouldn't be a problem since there
- * is no way to add elements to the iterator.
- */
-public class GenericIteratorWrapper<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
-
- public GenericIteratorWrapper(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public E next() {
- return this.iterator.next();
- }
-
- public void remove() {
- this.iterator.remove();
- }
-
- @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/GraphIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
deleted file mode 100644
index c199e6ec4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
+++ /dev/null
@@ -1,242 +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 disabled mister rogers.
- * 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 disabled mister rogers.
- * 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.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a disabled mister rogers.
- * 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.Disabled.<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";
- }
- }
-
- /** The mister rogers used when the #neighbors(Object) method is overridden. */
- final class Disabled<S> implements MisterRogers<S> {
- @SuppressWarnings("unchecked")
- public static final MisterRogers INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> MisterRogers<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public Iterator<S> neighbors(S next) {
- throw new UnsupportedOperationException(); // GraphIterator.neighbors(Object) was not implemented
- }
- @Override
- public String toString() {
- return "GraphIterator.MisterRogers.Disabled";
- }
- }
-
- }
-
-}
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/ReadOnlyCompositeListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java
deleted file mode 100644
index d13d36e25b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyCompositeListIterator</code> wraps a list
- * of <code>ListIterator</code>s and makes them appear to be a single
- * read-only <code>ListIterator</code>. A read-only composite list
- * iterator is more flexible than a normal composite when it comes to the element types of
- * the nested iterators.
- */
-public class ReadOnlyCompositeListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends ListIterator<? extends E>> iterators;
- private ListIterator<? extends E> nextIterator;
- private int nextIndex;
-
-
- /**
- * Construct a read-only list iterator with the specified list of
- * list iterators.
- */
- public ReadOnlyCompositeListIterator(List<? extends ListIterator<? extends E>> iterators) {
- this(iterators.listIterator());
- }
-
- /**
- * Construct a read-only list iterator with the specified list of
- * list iterators.
- */
- public ReadOnlyCompositeListIterator(ListIterator<? extends ListIterator<? extends E>> iterators) {
- super();
- this.iterators = iterators;
- this.nextIndex = 0;
- }
-
- /**
- * Construct a read-only list iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterator(E object, ListIterator<? extends E> iterator) {
- this(new SingleElementListIterator<E>(object), iterator);
- }
-
- /**
- * Construct a read-only list iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterator(ListIterator<? extends E> iterator, E object) {
- this(iterator, new SingleElementListIterator<E>(object));
- }
-
- /**
- * Construct a read-only list iterator with the specified list iterators.
- */
- public ReadOnlyCompositeListIterator(ListIterator<? extends E>... iterators) {
- this(new ArrayListIterator<ListIterator<? extends E>>(iterators));
- }
-
- 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 increment 'nextIndex'
- this.nextIndex++;
-
- 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 decrement 'nextIndex'
- this.nextIndex--;
-
- return result;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public void add(E o) {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- /**
- * 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/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 b970d28841..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 disabled transformer.
- * 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.Disabled.<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 087fc11046..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 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.
- *
- * 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 disabled transformer.
- * 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.Disabled.<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 3d05090b1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.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.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 disabled midwife.
- * 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.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified root
- * and a disabled midwife.
- * 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.Disabled.<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";
- }
- }
-
- /** The midwife used when the #children(Object) method is overridden. */
- final class Disabled<S> implements Midwife<S> {
- @SuppressWarnings("unchecked")
- public static final Midwife INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Midwife<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public Iterator<S> children(S next) {
- throw new UnsupportedOperationException(); // TreeIterator.children(Object) was not implemented
- }
- @Override
- public String toString() {
- return "TreeIterator.Midwife.Disabled";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
deleted file mode 100644
index 9908d6aedf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
+++ /dev/null
@@ -1,1002 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Convenience implementation of Model protocol.
- */
-public abstract class AbstractModel implements Model, Serializable {
- /**
- * Delegate state/property/collection/list/tree change support to this
- * helper object. The change support object is "lazy-initialized".
- */
- private ChangeSupport changeSupport;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Default constructor.
- * This will call #initialize() on the newly-created instance.
- */
- protected AbstractModel() {
- super();
- this.initialize();
- }
-
- protected void initialize() {
- // do nothing by default
- }
-
- /**
- * This accessor will build the change support when required.
- */
- protected synchronized ChangeSupport changeSupport() {
- if (this.changeSupport == null) {
- this.changeSupport = this.buildChangeSupport();
- }
- return this.changeSupport;
- }
-
- /**
- * Allow subclasses to tweak the change support used.
- */
- protected ChangeSupport buildChangeSupport() {
- return new ChangeSupport(this);
- }
-
-
- // ********** state change support **********
-
- public synchronized void addStateChangeListener(StateChangeListener listener) {
- this.changeSupport().addStateChangeListener(listener);
- }
-
- public synchronized void removeStateChangeListener(StateChangeListener listener) {
- this.changeSupport().removeStateChangeListener(listener);
- }
-
- protected final void fireStateChanged() {
- this.changeSupport().fireStateChanged();
- }
-
- protected final void fireStateChanged(StateChangeEvent event) {
- this.changeSupport().fireStateChanged(event);
- }
-
-
- // ********** property change support **********
-
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- this.changeSupport().addPropertyChangeListener(listener);
- }
-
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.changeSupport().addPropertyChangeListener(propertyName, listener);
- }
-
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- this.changeSupport().removePropertyChangeListener(listener);
- }
-
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.changeSupport().removePropertyChangeListener(propertyName, listener);
- }
-
- protected final void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
- this.changeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- protected final void firePropertyChanged(String propertyName, int oldValue, int newValue) {
- this.changeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- protected final void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
- this.changeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- protected final void firePropertyChanged(String propertyName, Object newValue) {
- this.changeSupport().firePropertyChanged(propertyName, null, newValue);
- }
-
- protected final void firePropertyChanged(PropertyChangeEvent event) {
- this.changeSupport().firePropertyChanged(event);
- }
-
-
- // ********** collection change support **********
-
- public synchronized void addCollectionChangeListener(CollectionChangeListener listener) {
- this.changeSupport().addCollectionChangeListener(listener);
- }
-
- public synchronized void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.changeSupport().addCollectionChangeListener(collectionName, listener);
- }
-
- public synchronized void removeCollectionChangeListener(CollectionChangeListener listener) {
- this.changeSupport().removeCollectionChangeListener(listener);
- }
-
- public synchronized void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.changeSupport().removeCollectionChangeListener(collectionName, listener);
- }
-
- protected final void fireItemAdded(String collectionName, Object addedItem) {
- this.changeSupport().fireItemAdded(collectionName, addedItem);
- }
-
- protected final void fireItemsAdded(String collectionName, Collection<?> addedItems) {
- this.changeSupport().fireItemsAdded(collectionName, addedItems);
- }
-
- protected final void fireItemsAdded(CollectionChangeEvent event) {
- this.changeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemRemoved(String collectionName, Object removedItem) {
- this.changeSupport().fireItemRemoved(collectionName, removedItem);
- }
-
- protected final void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
- this.changeSupport().fireItemsRemoved(collectionName, removedItems);
- }
-
- protected final void fireItemsRemoved(CollectionChangeEvent event) {
- this.changeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireCollectionCleared(String collectionName) {
- this.changeSupport().fireCollectionCleared(collectionName);
- }
-
- protected final void fireCollectionCleared(CollectionChangeEvent event) {
- this.changeSupport().fireCollectionCleared(event);
- }
-
- protected final void fireCollectionChanged(String collectionName) {
- this.changeSupport().fireCollectionChanged(collectionName);
- }
-
- protected final void fireCollectionChanged(CollectionChangeEvent event) {
- this.changeSupport().fireCollectionChanged(event);
- }
-
- /**
- * Convenience method.
- * Add the specified item to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#add(Object)
- */
- protected <E> boolean addItemToCollection(E item, Collection<E> collection, String collectionName) {
- if (collection.add(item)) {
- this.fireItemAdded(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToCollection(E[] items, Collection<E> collection, String collectionName) {
- return this.addItemsToCollection(new ArrayIterator<E>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToCollection(Iterable<? extends E> items, Collection<E> collection, String collectionName) {
- return this.addItemsToCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToCollection(Iterator<? extends E> items, Collection<E> collection, String collectionName) {
- Collection<E> addedItems = null;
- while (items.hasNext()) {
- E item = items.next();
- if (collection.add(item)) {
- if (addedItems == null) {
- addedItems = new ArrayList<E>();
- }
- addedItems.add(item);
- }
- }
- if (addedItems != null) {
- this.fireItemsAdded(collectionName, addedItems);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Remove the specified item from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#remove(Object)
- */
- protected boolean removeItemFromCollection(Object item, Collection<?> collection, String collectionName) {
- if (collection.remove(item)) {
- this.fireItemRemoved(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.removeItemsFromCollection(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.removeItemsFromCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- Collection<?> items2 = CollectionTools.collection(items);
- items2.retainAll(collection);
- boolean changed = collection.removeAll(items2);
-
- if ( ! items2.isEmpty()) {
- this.fireItemsRemoved(collectionName, items2);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.retainItemsInCollection(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.retainItemsInCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- Collection<?> items2 = CollectionTools.collection(items);
- Collection<?> removedItems = CollectionTools.collection(collection);
- removedItems.removeAll(items2);
- boolean changed = collection.retainAll(items2);
-
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved(collectionName, removedItems);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * Clear the entire collection
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.Collection#clear()
- */
- protected boolean clearCollection(Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- this.fireCollectionCleared(collectionName);
- return true;
- }
-
- /**
- * Convenience method.
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- protected <E> boolean synchronizeCollection(Collection<E> newCollection, Collection<E> collection, String collectionName) {
- if (newCollection.isEmpty()) {
- return this.clearCollection(collection, collectionName);
- }
-
- if (collection.isEmpty()) {
- return this.addItemsToCollection(newCollection, collection, collectionName);
- }
-
- boolean changed = false;
- Collection<E> removeItems = new HashBag<E>(collection);
- removeItems.removeAll(newCollection);
- changed |= this.removeItemsFromCollection(removeItems, collection, collectionName);
-
- Collection<E> addItems = new HashBag<E>(newCollection);
- addItems.removeAll(collection);
- changed |= this.addItemsToCollection(addItems, collection, collectionName);
-
- return changed;
- }
-
- /**
- * Convenience method.
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- protected <E> boolean synchronizeCollection(Iterator<E> newItems, Collection<E> collection, String collectionName) {
- return this.synchronizeCollection(CollectionTools.collection(newItems), collection, collectionName);
- }
-
-
- // ********** list change support **********
-
- public synchronized void addListChangeListener(ListChangeListener listener) {
- this.changeSupport().addListChangeListener(listener);
- }
-
- public synchronized void addListChangeListener(String listName, ListChangeListener listener) {
- this.changeSupport().addListChangeListener(listName, listener);
- }
-
- public synchronized void removeListChangeListener(ListChangeListener listener) {
- this.changeSupport().removeListChangeListener(listener);
- }
-
- public synchronized void removeListChangeListener(String listName, ListChangeListener listener) {
- this.changeSupport().removeListChangeListener(listName, listener);
- }
-
- protected final void fireItemAdded(String listName, int index, Object addedItem) {
- this.changeSupport().fireItemAdded(listName, index, addedItem);
- }
-
- protected final void fireItemsAdded(String listName, int index, List<?> addedItems) {
- this.changeSupport().fireItemsAdded(listName, index, addedItems);
- }
-
- protected final void fireItemsAdded(ListChangeEvent event) {
- this.changeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemRemoved(String listName, int index, Object removedItem) {
- this.changeSupport().fireItemRemoved(listName, index, removedItem);
- }
-
- protected final void fireItemsRemoved(String listName, int index, List<?> removedItems) {
- this.changeSupport().fireItemsRemoved(listName, index, removedItems);
- }
-
- protected final void fireItemsRemoved(ListChangeEvent event) {
- this.changeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
- this.changeSupport().fireItemReplaced(listName, index, newItem, replacedItem);
- }
-
- protected final <E> void fireItemsReplaced(String listName, int index, List<? extends E> newItems, List<E> replacedItems) {
- this.changeSupport().fireItemsReplaced(listName, index, newItems, replacedItems);
- }
-
- protected final void fireItemsReplaced(ListChangeEvent event) {
- this.changeSupport().fireItemsReplaced(event);
- }
-
- protected final void fireItemMoved(String listName, int targetIndex, int sourceIndex) {
- this.changeSupport().fireItemMoved(listName, targetIndex, sourceIndex);
- }
-
- protected final <E> void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
- this.changeSupport().fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- protected final void fireItemsMoved(ListChangeEvent event) {
- this.changeSupport().fireItemsMoved(event);
- }
-
- protected final void fireListCleared(String listName) {
- this.changeSupport().fireListCleared(listName);
- }
-
- protected final void fireListCleared(ListChangeEvent event) {
- this.changeSupport().fireListCleared(event);
- }
-
- protected final void fireListChanged(String listName) {
- this.changeSupport().fireListChanged(listName);
- }
-
- protected final void fireListChanged(ListChangeEvent event) {
- this.changeSupport().fireListChanged(event);
- }
-
- /**
- * Convenience method.
- * Add the specified item to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#add(int, Object)
- */
- protected <E> void addItemToList(int index, E item, List<E> list, String listName) {
- list.add(index, item);
- this.fireItemAdded(listName, index, item);
- }
-
- /**
- * Convenience method.
- * Add the specified item to the end of the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether list changed.
- * @see java.util.List#add(Object)
- */
- protected <E> boolean addItemToList(E item, List<E> list, String listName) {
- if (list.add(item)) {
- this.fireItemAdded(listName, list.size() - 1, item);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, E[] items, List<E> list, String listName) {
- return this.addItemsToList(index, new ArrayIterator<E>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(index, items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- protected <E> boolean addItemsToList(int index, Iterator<? extends E> items, List<E> list, String listName) {
- List<E> items2 = CollectionTools.list(items);
- if (list.addAll(index, items2)) {
- this.fireItemsAdded(listName, index, items2);
- return true;
- }
- return false;
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(E[] items, List<E> list, String listName) {
- return this.addItemsToList(new ArrayIterator<E>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * @see java.util.List#addAll(java.util.Collection)
- */
- protected <E> boolean addItemsToList(Iterator<? extends E> items, List<E> list, String listName) {
- List<E> items2 = CollectionTools.list(items);
- int index = list.size();
- if (list.addAll(items2)) {
- this.fireItemsAdded(listName, index, items2);
- return true;
- }
- return false; // empty list of items added
- }
-
- /**
- * Convenience method.
- * Remove the specified item from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed item.
- * @see java.util.List#remove(int)
- */
- protected <E> E removeItemFromList(int index, List<E> list, String listName) {
- E item = list.remove(index);
- this.fireItemRemoved(listName, index, item);
- return item;
- }
-
- /**
- * Convenience method.
- * Remove the specified item from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed item.
- * @see java.util.List#remove(Object)
- */
- protected boolean removeItemFromList(Object item, List<?> list, String listName) {
- int index = list.indexOf(item);
- if (index == -1) {
- return false;
- }
- list.remove(index);
- this.fireItemRemoved(listName, index, item);
- return true;
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#remove(int)
- */
- protected <E> List<E> removeItemsFromList(int index, int length, List<E> list, String listName) {
- List<E> subList = list.subList(index, index + length);
- List<E> removedItems = new ArrayList<E>(subList);
- subList.clear();
- this.fireItemsRemoved(listName, index, removedItems);
- return removedItems;
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Object[] items, List<?> list, String listName) {
- return this.removeItemsFromList(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Iterable<?> items, List<?> list, String listName) {
- return this.removeItemsFromList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- protected boolean removeItemsFromList(Iterator<?> items, List<?> list, String listName) {
- boolean changed = false;
- while (items.hasNext()) {
- changed |= this.removeItemFromList(items.next(), list, listName);
- }
- return changed;
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Object[] items, List<?> list, String listName) {
- return this.retainItemsInList(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Iterable<?> items, List<?> list, String listName) {
- return this.retainItemsInList(items.iterator(), list, listName);
- }
-
- /**
- * Convenience method.
- * Retain the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- protected boolean retainItemsInList(Iterator<?> items, List<?> list, String listName) {
- Collection<?> items2 = CollectionTools.collection(items);
- Collection<?> removedItems = CollectionTools.collection(list);
- removedItems.removeAll(items2);
- return this.removeItemsFromList(removedItems, list, listName);
- }
-
- /**
- * Convenience method.
- * Set the specified item in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced item.
- * @see java.util.List#set(int, Object)
- */
- protected <E> E setItemInList(int index, E item, List<E> list, String listName) {
- E replacedItem = list.set(index, item);
- this.fireItemReplaced(listName, index, item, replacedItem);
- return replacedItem;
- }
-
- /**
- * Convenience method.
- * Replace the specified item in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced item.
- * @see java.util.List#set(int, Object)
- */
- protected <E> E replaceItemInList(E oldItem, E newItem, List<E> list, String listName) {
- return this.setItemInList(list.indexOf(oldItem), newItem, list, listName);
- }
-
- /**
- * Convenience method.
- * Set the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced items.
- * @see java.util.List#set(int, Object)
- */
- protected <E> List<E> setItemsInList(int index, E[] items, List<E> list, String listName) {
- return this.setItemsInList(index, Arrays.asList(items), list, listName);
- }
-
- /**
- * Convenience method.
- * Set the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced items.
- * @see java.util.List#set(int, Object)
- */
- protected <E> List<E> setItemsInList(int index, List<? extends E> items, List<E> list, String listName) {
- List<E> subList = list.subList(index, index + items.size());
- List<E> replacedItems = new ArrayList<E>(subList);
- for (int i = 0; i < items.size(); i++) {
- subList.set(i, items.get(i));
- }
- this.fireItemsReplaced(listName, index, items, replacedItems);
- return replacedItems;
- }
-
- /**
- * Convenience method.
- * Move items in the specified list from the specified source index to the
- * specified target index for the specified length.
- */
- protected <E> void moveItemsInList(int targetIndex, int sourceIndex, int length, List<E> list, String listName) {
- CollectionTools.move(list, targetIndex, sourceIndex, length);
- this.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- /**
- * Convenience method.
- * Move an item in the specified list from the specified source index to the
- * specified target index.
- */
- protected <E> void moveItemInList(int targetIndex, int sourceIndex, List<E> list, String listName) {
- CollectionTools.move(list, targetIndex, sourceIndex);
- this.fireItemMoved(listName, targetIndex, sourceIndex);
- }
-
- /**
- * Convenience method.
- * Clear the entire list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#clear()
- */
- protected boolean clearList(List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- list.clear();
- this.fireListCleared(listName);
- return true;
- }
-
-
- // ********** tree change support **********
-
- public synchronized void addTreeChangeListener(TreeChangeListener listener) {
- this.changeSupport().addTreeChangeListener(listener);
- }
-
- public synchronized void addTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.changeSupport().addTreeChangeListener(treeName, listener);
- }
-
- public synchronized void removeTreeChangeListener(TreeChangeListener listener) {
- this.changeSupport().removeTreeChangeListener(listener);
- }
-
- public synchronized void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.changeSupport().removeTreeChangeListener(treeName, listener);
- }
-
- protected final void fireNodeAdded(String treeName, Object[] path) {
- this.changeSupport().fireNodeAdded(treeName, path);
- }
-
- protected final void fireNodeAdded(TreeChangeEvent event) {
- this.changeSupport().fireNodeAdded(event);
- }
-
- protected final void fireNodeRemoved(String treeName, Object[] path) {
- this.changeSupport().fireNodeRemoved(treeName, path);
- }
-
- protected final void fireNodeRemoved(TreeChangeEvent event) {
- this.changeSupport().fireNodeRemoved(event);
- }
-
- protected final void fireTreeCleared(String treeName) {
- this.changeSupport().fireTreeCleared(treeName);
- }
-
- protected final void fireTreeCleared(TreeChangeEvent event) {
- this.changeSupport().fireTreeCleared(event);
- }
-
- protected final void fireTreeChanged(String treeName) {
- this.changeSupport().fireTreeChanged(treeName);
- }
-
- protected final void fireTreeChanged(String treeName, Object[] path) {
- this.changeSupport().fireTreeChanged(treeName, path);
- }
-
- protected final void fireTreeChanged(TreeChangeEvent event) {
- this.changeSupport().fireTreeChanged(event);
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether there are any state change listeners.
- */
- public boolean hasAnyStateChangeListeners() {
- return this.changeSupport().hasAnyStateChangeListeners();
- }
-
- /**
- * Return whether there are no state change listeners.
- */
- public boolean hasNoStateChangeListeners() {
- return ! this.hasAnyStateChangeListeners();
- }
-
- /**
- * Return whether there are any property change listeners for a specific property.
- */
- public boolean hasAnyPropertyChangeListeners(String propertyName) {
- return this.changeSupport().hasAnyPropertyChangeListeners(propertyName);
- }
-
- /**
- * Return whether there are any property change listeners for a specific property.
- */
- public boolean hasNoPropertyChangeListeners(String propertyName) {
- return ! this.hasAnyPropertyChangeListeners(propertyName);
- }
-
- /**
- * Return whether there are any collection change listeners for a specific collection.
- */
- public boolean hasAnyCollectionChangeListeners(String collectionName) {
- return this.changeSupport().hasAnyCollectionChangeListeners(collectionName);
- }
-
- /**
- * Return whether there are any collection change listeners for a specific collection.
- */
- public boolean hasNoCollectionChangeListeners(String collectionName) {
- return ! this.hasAnyCollectionChangeListeners(collectionName);
- }
-
- /**
- * Return whether there are any list change listeners for a specific list.
- */
- public boolean hasAnyListChangeListeners(String listName) {
- return this.changeSupport().hasAnyListChangeListeners(listName);
- }
-
- /**
- * Return whether there are any list change listeners for a specific list.
- */
- public boolean hasNoListChangeListeners(String listName) {
- return ! this.hasAnyListChangeListeners(listName);
- }
-
- /**
- * Return whether there are any tree change listeners for a specific tree.
- */
- public boolean hasAnyTreeChangeListeners(String treeName) {
- return this.changeSupport().hasAnyTreeChangeListeners(treeName);
- }
-
- /**
- * Return whether there are any tree change listeners for a specific tree.
- */
- public boolean hasNoTreeChangeListeners(String treeName) {
- return ! this.hasAnyTreeChangeListeners(treeName);
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the values are equal, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- *
- * DO NOT use this to determine whether to fire a change notification,
- * ChangeSupport already does that.
- */
- protected final boolean valuesAreEqual(Object value1, Object value2) {
- return this.changeSupport().valuesAreEqual(value1, value2);
- }
- protected final boolean attributeValueHasNotChanged(Object oldValue, Object newValue) {
- return this.valuesAreEqual(oldValue, newValue);
- }
-
-
- /**
- * Return whether the values are different, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- *
- * DO NOT use this to determine whether to fire a change notification,
- * ChangeSupport already does that.
- *
- * For example, after firing the change notification, you can use this method
- * to decide if some other, related, piece of state needs to be synchronized
- * with the state that just changed.
- */
- protected final boolean valuesAreDifferent(Object value1, Object value2) {
- return this.changeSupport().valuesAreDifferent(value1, value2);
- }
- protected final boolean attributeValueHasChanged(Object oldValue, Object newValue) {
- return this.valuesAreDifferent(oldValue, newValue);
- }
-
-
- // ********** Object overrides **********
-
- /**
- * Although cloning models is usually not a Good Idea,
- * we should at least support it properly.
- */
- @Override
- protected AbstractModel clone() throws CloneNotSupportedException {
- AbstractModel clone = (AbstractModel) super.clone();
- clone.postClone();
- return clone;
- }
-
- /**
- * Perform any post-clone processing necessary to
- * successfully disconnect the clone from the original.
- * When this method is called on the clone, the clone
- * is a "shallow" copy of the original (i.e. the clone
- * shares all its instance variables with the original).
- */
- protected void postClone() {
- // clear out change support - models do not share listeners
- this.changeSupport = null;
- // when you override this method, don't forget to include:
- // super.postClone();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append(" (");
- this.toString(sb);
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * make this public so one model can call a nested model's
- * #toString(StringBuilder)
- */
- public void toString(StringBuilder sb) {
- // subclasses should override this to do something a bit more helpful
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
deleted file mode 100644
index c98cdae62b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
+++ /dev/null
@@ -1,2360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Support object that can be used by implementors of the Model interface.
- * It provides for state, property, collection, list, and tree change notifications to
- * listeners.
- *
- * NB: There is lots of copy-n-paste code in this class. Nearly all of this duplication
- * is an effort to prevent the unnecessary creation of new objects (typically event
- * objects). Since many events are fired when there are no listeners, we postpone
- * the creation of event objects until we know we have interested listeners.
- * Most methods have the "non-duplicated" version of the method body commented
- * out at the top of the current method body.
- * The hope was that this class would prove to be fairly static and the duplicated
- * code would not prove onerous; but that has not proven to be
- * the case, as we have added support for "state" changes, "dirty" notification,
- * and custom "notifiers", with more to come, I'm sure.... ~bjv
- *
- * NB2: This class will check to see if, during the firing of events, a listener
- * on the original, cloned, list of listeners has been removed from the master
- * list of listeners *before* it is notified. If the listener has been removed
- * "concurrently" it will *not* be notified. (See the code that uses the
- * 'stillListening' local boolean flag.)
- *
- * NB3: This class is serializable, but it will only write out listeners that
- * are also serializable while silently leaving behind listeners that are not.
- *
- * TODO fire a state change event with *every* change?
- * TODO use objects (IDs?) instead of strings to identify aspects?
- */
-public class ChangeSupport
- implements Serializable
-{
-
- /** The object to be provided as the "source" for any generated events. */
- protected final Model source;
-
- /** Associate a listener class to a collection of "generic" listeners for that class. */
- transient private GenericListenerList[] genericListeners = EMPTY_GENERIC_LISTENERS;
- private static final GenericListenerList[] EMPTY_GENERIC_LISTENERS = new GenericListenerList[0];
-
- /** Associate aspect names to child change support objects. */
- private AspectChild[] aspectChildren = EMPTY_ASPECT_CHILDREN;
- private static final AspectChild[] EMPTY_ASPECT_CHILDREN = new AspectChild[0];
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- /**
- * Construct support for the specified source of change events.
- * The source cannot be null.
- */
- public ChangeSupport(Model source) {
- super();
- if (source == null) {
- throw new NullPointerException();
- }
- this.source = source;
- }
-
-
- // ********** internal behavior **********
-
- /**
- * Add a "generic" listener that listens to all events appropriate to that
- * listener, regardless of the aspect name associated with that event.
- * The listener cannot be null.
- */
- protected <T extends ChangeListener> void addListener(Class<T> listenerClass, T listener) {
- if (listener == null) {
- throw new NullPointerException(); // better sooner than later
- }
- synchronized (this) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- if (gll == null) {
- this.addGenericListenerList(listenerClass, listener);
- } else {
- gll.addListener(listener);
- }
- }
- }
-
- /**
- * Return the "generic" listener list for the specified listener class.
- * Return null if the list is not present.
- */
- protected GenericListenerList genericListenerList(Class<? extends ChangeListener> listenerClass) {
- for (GenericListenerList gll : this.genericListeners) {
- if (gll.listenerClass == listenerClass) {
- return gll;
- }
- }
- return null;
- }
-
- /**
- * Add the "generic" listener list for the specified listener class.
- * Return the newly-built generic listener list.
- */
- protected <T extends ChangeListener> GenericListenerList addGenericListenerList(Class<T> listenerClass, T listener) {
- GenericListenerList gll = new GenericListenerList(listenerClass, listener);
- this.genericListeners = CollectionTools.add(this.genericListeners, gll);
- return gll;
- }
-
- /**
- * Adds a listener that listens to all events appropriate to that listener,
- * and only to those events carrying the aspect name specified.
- * The aspect name cannot be null and the listener cannot be null.
- */
- protected <T extends ChangeListener> void addListener(String aspectName, Class<T> listenerClass, T listener) {
- if ((aspectName == null) || (listener == null)) {
- throw new NullPointerException(); // better sooner than later
- }
- synchronized (this) {
- ChangeSupport child = this.child(aspectName);
- if (child == null) {
- child = this.addChild(aspectName);
- }
- child.addListener(listenerClass, listener);
- }
- }
-
- /**
- * Return the child change support for the specified aspect name.
- * Return null if the aspect name is null or the child is not present.
- */
- protected ChangeSupport child(String aspectName) {
- // put in a null check to simplify calling code
- if (aspectName == null) {
- return null;
- }
- for (AspectChild aspectChild : this.aspectChildren) {
- if (aspectChild.aspectName == aspectName) {
- return aspectChild.child;
- }
- }
- return null;
- }
-
- /**
- * Add the child change support for the specified aspect name.
- * Return the newly-built child change support.
- */
- protected ChangeSupport addChild(String aspectName) {
- ChangeSupport child = this.buildChildChangeSupport();
- this.aspectChildren = CollectionTools.add(this.aspectChildren, new AspectChild(aspectName, child));
- return child;
- }
-
- /**
- * Build and return a child change support to hold aspect-specific listeners.
- */
- protected ChangeSupport buildChildChangeSupport() {
- return new ChangeSupport(this.source);
- }
-
- /**
- * Removes a "generic" listener that has been registered for all events
- * appropriate to that listener.
- */
- protected <T extends ChangeListener> void removeListener(Class<T> listenerClass, T listener) {
- synchronized (this) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- if (gll == null) {
- throw new IllegalArgumentException("listener not registered");
- }
- if ( ! gll.removeListener(listener)) { // leave the GLL, even if it is empty?
- throw new IllegalArgumentException("listener not registered");
- }
- }
- }
-
- /**
- * Removes a listener that has been registered for appropriate
- * events carrying the specified aspect name.
- */
- protected <T extends ChangeListener> void removeListener(String aspectName, Class<T> listenerClass, T listener) {
- synchronized (this) {
- ChangeSupport child = this.child(aspectName);
- if (child == null) {
- throw new IllegalArgumentException("listener not registered");
- }
- child.removeListener(listenerClass, listener); // leave the child, even if it is empty?
- }
- }
-
-
- // ********** internal queries **********
-
- /**
- * Return the "generic" listeners for the specified listener class.
- * Return null if there are no listeners.
- */
- protected ChangeListener[] listeners(Class<? extends ChangeListener> listenerClass) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- return (gll == null) ? null : gll.listeners;
- }
-
- /**
- * Return whether there are any "generic" listeners for the specified
- * listener class.
- */
- protected synchronized <T extends ChangeListener> boolean hasAnyListeners(Class<T> listenerClass) {
- GenericListenerList gll = this.genericListenerList(listenerClass);
- return (gll != null) && gll.hasListeners();
- }
-
- /**
- * Return whether there are no "generic" listeners for the specified
- * listener class.
- */
- protected <T extends ChangeListener> boolean hasNoListeners(Class<T> listenerClass) {
- return ! this.hasAnyListeners(listenerClass);
- }
-
- /**
- * Return whether there are any listeners for the specified
- * listener class and aspect name.
- */
- protected synchronized boolean hasAnyListeners(Class<? extends ChangeListener> listenerClass, String aspectName) {
- if (this.hasAnyListeners(listenerClass)) {
- return true; // there's a "generic" listener
- }
- ChangeSupport child = this.child(aspectName);
- return (child != null) &&
- child.hasAnyListeners(listenerClass);
- }
-
- /**
- * Return whether there are no "generic" listeners for the specified
- * listener class and aspect name.
- */
- protected <T extends ChangeListener> boolean hasNoListeners(Class<T> listenerClass, String aspectName) {
- return ! this.hasAnyListeners(listenerClass, aspectName);
- }
-
-
- // ********** behavior **********
-
- /**
- * The specified aspect of the source has changed;
- * override this method to perform things like setting a
- * dirty flag or validating the source's state.
- * The aspect ID will be null if a "state change" occurred.
- */
- protected void sourceChanged(String aspectName) {
- // the default is to do nothing
- }
-
-
- // ********** state change support **********
-
- protected static final Class<StateChangeListener> STATE_CHANGE_LISTENER_CLASS = StateChangeListener.class;
-
- /**
- * Add a state change listener.
- */
- public void addStateChangeListener(StateChangeListener listener) {
- this.addListener(STATE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a state change listener.
- */
- public void removeStateChangeListener(StateChangeListener listener) {
- this.removeListener(STATE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any state change listeners.
- */
- public boolean hasAnyStateChangeListeners() {
- return this.hasAnyListeners(STATE_CHANGE_LISTENER_CLASS);
- }
-
- private StateChangeListener[] stateChangeListeners() {
- return (StateChangeListener[]) this.listeners(STATE_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Fire the specified state change event to any registered listeners.
- */
- public void fireStateChanged(StateChangeEvent event) {
-
- StateChangeListener[] targets = null;
-
- synchronized (this) {
- StateChangeListener[] stateChangeListeners = this.stateChangeListeners();
- if (stateChangeListeners != null) {
- targets = stateChangeListeners.clone();
- }
- }
-
- if (targets != null) {
- for (StateChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.stateChangeListeners(), target);
- }
- if (stillListening) {
- target.stateChanged(event);
- }
- }
- }
-
- this.sourceChanged(null);
- }
-
- /**
- * Report a generic state change event to any registered state change
- * listeners.
- */
- public void fireStateChanged() {
-// this.fireStateChange(new StateChangeEvent(this.source));
-
- StateChangeListener[] targets = null;
-
- synchronized (this) {
- StateChangeListener[] stateChangeListeners = this.stateChangeListeners();
- if (stateChangeListeners != null) {
- targets = stateChangeListeners.clone();
- }
- }
-
- if (targets != null) {
- StateChangeEvent event = null;
- for (StateChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.stateChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new StateChangeEvent(this.source);
- }
- target.stateChanged(event);
- }
- }
- }
-
- this.sourceChanged(null);
- }
-
-
- // ********** property change support **********
-
- protected static final Class<PropertyChangeListener> PROPERTY_CHANGE_LISTENER_CLASS = PropertyChangeListener.class;
-
- /**
- * Return whether the values are equal, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- */
- public boolean valuesAreEqual(Object value1, Object value2) {
- if ((value1 == null) && (value2 == null)) {
- return true; // both are null
- }
- if ((value1 == null) || (value2 == null)) {
- return false; // one is null but the other is not
- }
- return value1.equals(value2);
- }
-
- /**
- * Return whether the values are different, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- */
- public boolean valuesAreDifferent(Object value1, Object value2) {
- return ! this.valuesAreEqual(value1, value2);
- }
-
- /**
- * Add a property change listener that is registered for all properties.
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- this.addListener(PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Add a property change listener for the specified property. The listener
- * will be notified only for changes to the specified property.
- */
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.addListener(propertyName, PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a property change listener that was registered for all properties.
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- this.removeListener(PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a property change listener that was registered for a specific property.
- */
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.removeListener(propertyName, PROPERTY_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any property change listeners that will
- * be notified when the specified property has changed.
- */
- public boolean hasAnyPropertyChangeListeners(String propertyName) {
- return this.hasAnyListeners(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- }
-
- /**
- * Return whether there are any property change listeners that will
- * be notified when any property has changed.
- */
- public boolean hasAnyPropertyChangeListeners() {
- return this.hasAnyListeners(PROPERTY_CHANGE_LISTENER_CLASS);
- }
-
- private PropertyChangeListener[] propertyChangeListeners() {
- return (PropertyChangeListener[]) this.listeners(PROPERTY_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Fire the specified property change event to any registered listeners.
- * No event is fired if the given event's old and new values are the same;
- * this includes when both values are null. Use a state change event
- * for general purpose notification of changes.
- */
- public void firePropertyChanged(PropertyChangeEvent event) {
- if (this.valuesAreEqual(event.oldValue(), event.newValue())) {
- return;
- }
-
- String propertyName = event.propertyName();
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- child.firePropertyChanged(event);
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * Report a bound property update to any registered property change listeners.
- * No event is fired if the given old and new values are the same;
- * this includes when both values are null. Use a state change event
- * for general purpose notification of changes.
- */
- public void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
-// this.firePropertyChanged(new PropertyChangeEvent(this.source, propertyName, oldValue, newValue));
- if (this.valuesAreEqual(oldValue, newValue)) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, oldValue, newValue);
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * Report an int bound property update to any registered listeners.
- * No event is fired if old and new are equal.
- * <p>
- * This is merely a convenience wrapper around the more general
- * firePropertyChange method that takes Object values.
- */
- public void firePropertyChanged(String propertyName, int oldValue, int newValue) {
-// this.firePropertyChanged(propertyName, new Integer(oldValue), new Integer(newValue));
- if (oldValue == newValue) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, new Integer(oldValue), new Integer(newValue));
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
- /**
- * Report a boolean bound property update to any registered listeners.
- * No event is fired if old and new are equal.
- * <p>
- * This is merely a convenience wrapper around the more general
- * firePropertyChange method that takes Object values.
- */
- public void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
-// this.firePropertyChanged(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- if (oldValue == newValue) {
- return;
- }
-
- PropertyChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- PropertyChangeListener[] propertyChangeListeners = this.propertyChangeListeners();
- if (propertyChangeListeners != null) {
- targets = propertyChangeListeners.clone();
- }
- child = this.child(propertyName);
- }
-
- PropertyChangeEvent event = null;
-
- if (targets != null) {
- for (PropertyChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.propertyChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new PropertyChangeEvent(this.source, propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- target.propertyChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.firePropertyChanged(propertyName, oldValue, newValue);
- } else {
- child.firePropertyChanged(event);
- }
- }
-
- this.sourceChanged(propertyName);
- }
-
-
- // ********** collection change support **********
-
- protected static final Class<CollectionChangeListener> COLLECTION_CHANGE_LISTENER_CLASS = CollectionChangeListener.class;
-
- /**
- * Add a collection change listener that is registered for all collections.
- */
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- this.addListener(COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Add a collection change listener for the specified collection. The listener
- * will be notified only for changes to the specified collection.
- */
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.addListener(collectionName, COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a collection change listener that was registered for all collections.
- */
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- this.removeListener(COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a collection change listener that was registered for a specific collection.
- */
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.removeListener(collectionName, COLLECTION_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any collection change listeners that will
- * be notified when the specified collection has changed.
- */
- public boolean hasAnyCollectionChangeListeners(String collectionName) {
- return this.hasAnyListeners(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- }
-
- /**
- * Return whether there are any collection change listeners that will
- * be notified when any collection has changed.
- */
- public boolean hasAnyCollectionChangeListeners() {
- return this.hasAnyListeners(COLLECTION_CHANGE_LISTENER_CLASS);
- }
-
- private CollectionChangeListener[] collectionChangeListeners() {
- return (CollectionChangeListener[]) this.listeners(COLLECTION_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(CollectionChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String collectionName = event.collectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsAdded(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(String collectionName, Collection<?> addedItems) {
-// this.fireItemsAdded(new CollectionChangeEvent(this.source, collectionName, addedItems));
- if (addedItems.size() == 0) {
- return;
- }
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, addedItems);
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsAdded(collectionName, addedItems);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemAdded(String collectionName, Object addedItem) {
-// this.fireItemsAdded(collectionName, Collections.singleton(addedItem));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, Collections.singleton(addedItem));
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemAdded(collectionName, addedItem);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(CollectionChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String collectionName = event.collectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsRemoved(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
-// this.fireItemsRemoved(new CollectionChangeEvent(this.source, collectionName, removedItems));
- if (removedItems.size() == 0) {
- return;
- }
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, removedItems);
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsRemoved(collectionName, removedItems);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemRemoved(String collectionName, Object removedItem) {
-// this.fireItemsRemoved(collectionName, Collections.singleton(removedItem));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName, Collections.singleton(removedItem));
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemRemoved(collectionName, removedItem);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(CollectionChangeEvent event) {
- String collectionName = event.collectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.collectionCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireCollectionCleared(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(String collectionName) {
-// this.fireCollectionCleared(new CollectionChangeEvent(this.source, collectionName));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName);
- }
- target.collectionCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireCollectionCleared(collectionName);
- } else {
- child.fireCollectionCleared(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(CollectionChangeEvent event) {
- String collectionName = event.collectionName();
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- target.collectionChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireCollectionChanged(event);
- }
-
- this.sourceChanged(collectionName);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(String collectionName) {
-// this.fireCollectionChanged(new CollectionChangeEvent(this.source, collectionName));
-
- CollectionChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- CollectionChangeListener[] collectionChangeListeners = this.collectionChangeListeners();
- if (collectionChangeListeners != null) {
- targets = collectionChangeListeners.clone();
- }
- child = this.child(collectionName);
- }
-
- CollectionChangeEvent event = null;
-
- if (targets != null) {
- for (CollectionChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.collectionChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new CollectionChangeEvent(this.source, collectionName);
- }
- target.collectionChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireCollectionChanged(collectionName);
- } else {
- child.fireCollectionChanged(event);
- }
- }
-
- this.sourceChanged(collectionName);
- }
-
-
- // ********** list change support **********
-
- protected static final Class<ListChangeListener> LIST_CHANGE_LISTENER_CLASS = ListChangeListener.class;
-
- /**
- * Add a list change listener that is registered for all lists.
- */
- public void addListChangeListener(ListChangeListener listener) {
- this.addListener(LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Add a list change listener for the specified list. The listener
- * will be notified only for changes to the specified list.
- */
- public void addListChangeListener(String listName, ListChangeListener listener) {
- this.addListener(listName, LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a list change listener that was registered for all lists.
- */
- public void removeListChangeListener(ListChangeListener listener) {
- this.removeListener(LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a list change listener that was registered for a specific list.
- */
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- this.removeListener(listName, LIST_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any list change listeners that will
- * be notified when the specified list has changed.
- */
- public boolean hasAnyListChangeListeners(String listName) {
- return this.hasAnyListeners(LIST_CHANGE_LISTENER_CLASS, listName);
- }
-
- /**
- * Return whether there are any list change listeners that will
- * be notified when any list has changed.
- */
- public boolean hasAnyListChangeListeners() {
- return this.hasAnyListeners(LIST_CHANGE_LISTENER_CLASS);
- }
-
- private ListChangeListener[] listChangeListeners() {
- return (ListChangeListener[]) this.listeners(LIST_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsAdded(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(String listName, int index, List<?> addedItems) {
-// this.fireItemsAdded(new ListChangeEvent(this.source, listName, index, addedItems));
- if (addedItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, addedItems);
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsAdded(listName, index, addedItems);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemAdded(String listName, int index, Object addedItem) {
-// this.fireItemsAdded(listName, index, Collections.singletonList(addedItem));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(addedItem));
- }
- target.itemsAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemAdded(listName, index, addedItem);
- } else {
- child.fireItemsAdded(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsRemoved(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(String listName, int index, List<?> removedItems) {
-// this.fireItemsRemoved(new ListChangeEvent(this.source, listName, index, removedItems));
- if (removedItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, removedItems);
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsRemoved(listName, index, removedItems);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemRemoved(String listName, int index, Object removedItem) {
-// this.fireItemsRemoved(listName, index, Collections.singletonList(removedItem));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(removedItem));
- }
- target.itemsRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemRemoved(listName, index, removedItem);
- } else {
- child.fireItemsRemoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(ListChangeEvent event) {
- if (event.itemsSize() == 0) {
- return;
- }
-
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsReplaced(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(String listName, int index, List<?> newItems, List<?> replacedItems) {
-// this.fireItemsReplaced(new ListChangeEvent(this.source, listName, index, newItems, replacedItems));
- if (newItems.size() == 0) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, newItems, replacedItems);
- }
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsReplaced(listName, index, newItems, replacedItems);
- } else {
- child.fireItemsReplaced(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
-// this.fireItemsReplaced(listName, index, Collections.singletonList(newItem), Collections.singletonList(replacedItem));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, index, Collections.singletonList(newItem), Collections.singletonList(replacedItem));
- }
- target.itemsReplaced(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemReplaced(listName, index, newItem, replacedItem);
- } else {
- child.fireItemsReplaced(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(ListChangeEvent event) {
- if (event.targetIndex() == event.sourceIndex()) {
- return;
- }
-
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.itemsMoved(event);
- }
- }
- }
- if (child != null) {
- child.fireItemsMoved(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
-// this.fireItemsMoved(new ListChangeEvent(this.source, listName, targetIndex, sourceIndex, length));
- if (targetIndex == sourceIndex) {
- return;
- }
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName, targetIndex, sourceIndex, length);
- }
- target.itemsMoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- } else {
- child.fireItemsMoved(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemMoved(String listName, int targetIndex, int sourceIndex) {
- this.fireItemsMoved(listName, targetIndex, sourceIndex, 1);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListCleared(ListChangeEvent event) {
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.listCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireListCleared(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListCleared(String listName) {
-// this.fireListCleared(new ListChangeEvent(this.source, listName));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName);
- }
- target.listCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireListCleared(listName);
- } else {
- child.fireListCleared(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(ListChangeEvent event) {
- String listName = event.listName();
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- target.listChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireListChanged(event);
- }
-
- this.sourceChanged(listName);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(String listName) {
-// this.fireListChanged(new ListChangeEvent(this.source, listName));
-
- ListChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- ListChangeListener[] listChangeListeners = this.listChangeListeners();
- if (listChangeListeners != null) {
- targets = listChangeListeners.clone();
- }
- child = this.child(listName);
- }
-
- ListChangeEvent event = null;
-
- if (targets != null) {
- for (ListChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.listChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new ListChangeEvent(this.source, listName);
- }
- target.listChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireListChanged(listName);
- } else {
- child.fireListChanged(event);
- }
- }
-
- this.sourceChanged(listName);
- }
-
-
- // ********** tree change support **********
-
- protected static final Class<TreeChangeListener> TREE_CHANGE_LISTENER_CLASS = TreeChangeListener.class;
- private static final Object[] EMPTY_TREE_PATH = new Object[0];
-
- /**
- * Add a tree change listener that is registered for all trees.
- */
- public void addTreeChangeListener(TreeChangeListener listener) {
- this.addListener(TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Add a tree change listener for the specified tree. The listener
- * will be notified only for changes to the specified tree.
- */
- public void addTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.addListener(treeName, TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a tree change listener that was registered for all tree.
- */
- public void removeTreeChangeListener(TreeChangeListener listener) {
- this.removeListener(TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a tree change listener that was registered for a specific tree.
- */
- public void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.removeListener(treeName, TREE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any tree change listeners that will
- * be notified when the specified tree has changed.
- */
- public boolean hasAnyTreeChangeListeners(String treeName) {
- return this.hasAnyListeners(TREE_CHANGE_LISTENER_CLASS, treeName);
- }
-
- /**
- * Return whether there are any tree change listeners that will
- * be notified when any tree has changed.
- */
- public boolean hasAnyTreeChangeListeners() {
- return this.hasAnyListeners(TREE_CHANGE_LISTENER_CLASS);
- }
-
- private TreeChangeListener[] treeChangeListeners() {
- return (TreeChangeListener[]) this.listeners(TREE_CHANGE_LISTENER_CLASS);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(TreeChangeEvent event) {
- String treeName = event.treeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.nodeAdded(event);
- }
- }
- }
- if (child != null) {
- child.fireNodeAdded(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(String treeName, Object[] path) {
-// this.fireNodeAdded(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.nodeAdded(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireNodeAdded(treeName, path);
- } else {
- child.fireNodeAdded(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(TreeChangeEvent event) {
- String treeName = event.treeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.nodeRemoved(event);
- }
- }
- }
- if (child != null) {
- child.fireNodeRemoved(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(String treeName, Object[] path) {
-// this.fireNodeRemoved(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.nodeRemoved(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireNodeRemoved(treeName, path);
- } else {
- child.fireNodeRemoved(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(TreeChangeEvent event) {
- String treeName = event.treeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.treeCleared(event);
- }
- }
- }
- if (child != null) {
- child.fireTreeCleared(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(String treeName, Object[] path) {
-// this.fireTreeCleared(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.treeCleared(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireTreeCleared(treeName, path);
- } else {
- child.fireTreeCleared(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(String treeName) {
- this.fireTreeCleared(treeName, EMPTY_TREE_PATH);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(TreeChangeEvent event) {
- String treeName = event.treeName();
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- target.treeChanged(event);
- }
- }
- }
- if (child != null) {
- child.fireTreeChanged(event);
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(String treeName, Object[] path) {
-// this.fireTreeChanged(new TreeChangeEvent(this.source, treeName, path));
-
- TreeChangeListener[] targets = null;
- ChangeSupport child = null;
-
- synchronized (this) {
- TreeChangeListener[] treeChangeListeners = this.treeChangeListeners();
- if (treeChangeListeners != null) {
- targets = treeChangeListeners.clone();
- }
- child = this.child(treeName);
- }
-
- TreeChangeEvent event = null;
-
- if (targets != null) {
- for (TreeChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.treeChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new TreeChangeEvent(this.source, treeName, path);
- }
- target.treeChanged(event);
- }
- }
- }
- if (child != null) {
- if (event == null) {
- child.fireTreeChanged(treeName, path);
- } else {
- child.fireTreeChanged(event);
- }
- }
-
- this.sourceChanged(treeName);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(String treeName) {
- this.fireTreeChanged(treeName, EMPTY_TREE_PATH);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.source);
- }
-
-
- // ********** serialization **********
-
- private synchronized void writeObject(ObjectOutputStream s) throws IOException {
- // write out the source, children, and any hidden stuff
- s.defaultWriteObject();
-
- // only write out Serializable listeners
- int len1 = this.genericListeners.length;
- for (int i = 0; i < len1; i++) {
- this.writeObject(s, this.genericListeners[i]);
- }
- s.writeObject(null);
- }
-
- private void writeObject(ObjectOutputStream s, GenericListenerList gll) throws IOException {
- boolean first = true;
- int len = gll.listeners.length;
- for (int i = 0; i < len; i++) {
- ChangeListener listener = gll.listeners[i];
- if (listener instanceof Serializable) {
- if (first) {
- first = false;
- s.writeObject(gll.listenerClass);
- }
- s.writeObject(listener);
- }
- }
- if ( ! first) {
- s.writeObject(null);
- }
- }
-
- private synchronized void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- // read in the source, children, and any hidden stuff
- s.defaultReadObject();
-
- // read in generic listener lists
- this.genericListeners = EMPTY_GENERIC_LISTENERS;
- Object o;
- while (null != (o = s.readObject())) {
- @SuppressWarnings("unchecked")
- Class<? extends ChangeListener> listenerClass = (Class<? extends ChangeListener>) o;
- GenericListenerList gll = null;
- while (null != (o = s.readObject())) {
- if (gll == null) {
- gll = this.addGenericListenerListInternal(listenerClass, (ChangeListener) o);
- } else {
- gll.addListener((ChangeListener) o);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private <T extends ChangeListener> GenericListenerList addGenericListenerListInternal(Class<T> listenerClass, ChangeListener listener) {
- return this.addGenericListenerList(listenerClass, (T) listener);
- }
-
-
- // ********** member classes **********
-
- /**
- * Pair a listener class with its "generic" listeners.
- */
- private static class GenericListenerList {
- final Class<? extends ChangeListener> listenerClass;
- ChangeListener[] listeners;
-
- <T extends ChangeListener> GenericListenerList(Class<T> listenerClass, T listener) {
- super();
- this.listenerClass = listenerClass;
- this.listeners = (ChangeListener[]) Array.newInstance(listenerClass, 1);
- this.listeners[0] = listener;
- }
-
- void addListener(ChangeListener listener) {
- this.listeners = CollectionTools.add(this.listeners, listener);
- }
-
- boolean removeListener(ChangeListener listener) {
- int len = this.listeners.length;
- if (len == 0) {
- return false;
- }
- try {
- this.listeners = CollectionTools.remove(this.listeners, listener);
- } catch (ArrayIndexOutOfBoundsException ex) {
- return false; // listener not in the list
- }
- return (this.listeners.length + 1) == len;
- }
-
- boolean hasListeners() {
- return this.listeners.length > 0;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, ClassTools.shortNameFor(this.listenerClass));
- }
-
- }
-
- /**
- * Pair an aspect name with the change support holding its associated
- * listeners.
- */
- private static class AspectChild implements Serializable {
- final String aspectName;
- final ChangeSupport child;
- private static final long serialVersionUID = 1L;
-
- AspectChild(String aspectName, ChangeSupport child) {
- super();
- this.aspectName = aspectName;
- this.child = child;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.aspectName);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java
deleted file mode 100644
index e5f0a74cca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-
-/**
- * This change support class changes the behavior of the standard
- * ChangeSupport in several ways:
- * - All events fired by the source must specify the single aspect.
- * - Listeners are required to be either "generic" listeners or
- * listeners of the single aspect.
- */
-public class SingleAspectChangeSupport
- extends ChangeSupport
-{
- protected final Class<? extends ChangeListener> listenerClass;
- protected final String aspectName;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- public SingleAspectChangeSupport(Model source, Class<? extends ChangeListener> listenerClass, String aspectName) {
- super(source);
- this.listenerClass = listenerClass;
- this.aspectName = aspectName;
- }
-
-
- // ********** internal behavior **********
-
- private UnsupportedOperationException unsupportedOperationException() {
- return new UnsupportedOperationException("This Model supports only changes for the listener type \"" + this.listenerClass.getName()
- + "\" and the aspect \"" + this.aspectName + "\"");
- }
-
- private void check(Class<? extends ChangeListener> lClass, String aName) {
- if (lClass != this.listenerClass) {
- throw new IllegalArgumentException("This Model supports only changes for the listener type \"" + this.listenerClass.getName() + "\" : \"" + lClass.getName() + "\"");
- }
- if (aName != this.aspectName) {
- throw new IllegalArgumentException("This Model supports only changes for the aspect \"" + this.aspectName + "\" : \"" + aName + "\"");
- }
- }
-
- @Override
- protected <T extends ChangeListener> void addListener(String aName, Class<T> lClass, T listener) {
- this.check(lClass, aName);
- super.addListener(aName, lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(String aName, Class<T> lClass, T listener) {
- this.check(lClass, aName);
- super.removeListener(aName, lClass, listener);
- }
-
-
- // ********** internal queries **********
-
- @Override
- protected boolean hasAnyListeners(Class<? extends ChangeListener> lClass, String aName) {
- this.check(lClass, aName);
- return super.hasAnyListeners(lClass, aName);
- }
-
-
- // ********** state change support **********
-
- @Override
- public void fireStateChanged(StateChangeEvent event) {
- throw this.unsupportedOperationException();
- }
-
- @Override
- public void fireStateChanged() {
- throw this.unsupportedOperationException();
- }
-
-
- // ********** property change support **********
-
- @Override
- public void firePropertyChanged(PropertyChangeEvent event) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, event.propertyName());
- super.firePropertyChanged(event);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, int oldValue, int newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
-
- // ********** collection change support **********
-
- @Override
- public void fireItemsAdded(CollectionChangeEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.collectionName());
- super.fireItemsAdded(event);
- }
-
- @Override
- public void fireItemsAdded(String collectionName, Collection<?> addedItems) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemsAdded(collectionName, addedItems);
- }
-
- @Override
- public void fireItemAdded(String collectionName, Object addedItem) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemAdded(collectionName, addedItem);
- }
-
- @Override
- public void fireItemsRemoved(CollectionChangeEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.collectionName());
- super.fireItemsRemoved(event);
- }
-
- @Override
- public void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemsRemoved(collectionName, removedItems);
- }
-
- @Override
- public void fireItemRemoved(String collectionName, Object removedItem) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemRemoved(collectionName, removedItem);
- }
-
- @Override
- public void fireCollectionCleared(CollectionChangeEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.collectionName());
- super.fireCollectionCleared(event);
- }
-
- @Override
- public void fireCollectionCleared(String collectionName) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireCollectionCleared(collectionName);
- }
-
- @Override
- public void fireCollectionChanged(CollectionChangeEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.collectionName());
- super.fireCollectionChanged(event);
- }
-
- @Override
- public void fireCollectionChanged(String collectionName) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireCollectionChanged(collectionName);
- }
-
-
- // ********** list change support **********
-
- @Override
- public void fireItemsAdded(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireItemsAdded(event);
- }
-
- @Override
- public void fireItemsAdded(String listName, int index, List<?> addedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsAdded(listName, index, addedItems);
- }
-
- @Override
- public void fireItemAdded(String listName, int index, Object addedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemAdded(listName, index, addedItem);
- }
-
- @Override
- public void fireItemsRemoved(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireItemsRemoved(event);
- }
-
- @Override
- public void fireItemsRemoved(String listName, int index, List<?> removedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsRemoved(listName, index, removedItems);
- }
-
- @Override
- public void fireItemRemoved(String listName, int index, Object removedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemRemoved(listName, index, removedItem);
- }
-
- @Override
- public void fireItemsReplaced(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireItemsReplaced(event);
- }
-
- @Override
- public void fireItemsReplaced(String listName, int index, List<?> newItems, List<?> replacedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsReplaced(listName, index, newItems, replacedItems);
- }
-
- @Override
- public void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemReplaced(listName, index, newItem, replacedItem);
- }
-
- @Override
- public void fireItemsMoved(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireItemsMoved(event);
- }
-
- @Override
- public void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- @Override
- public void fireListCleared(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireListCleared(event);
- }
-
- @Override
- public void fireListCleared(String listName) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireListCleared(listName);
- }
-
- @Override
- public void fireListChanged(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.listName());
- super.fireListChanged(event);
- }
-
- @Override
- public void fireListChanged(String listName) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireListChanged(listName);
- }
-
-
- // ********** tree change support **********
-
- @Override
- public void fireNodeAdded(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.treeName());
- super.fireNodeAdded(event);
- }
-
- @Override
- public void fireNodeAdded(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeAdded(treeName, path);
- }
-
- @Override
- public void fireNodeRemoved(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.treeName());
- super.fireNodeRemoved(event);
- }
-
- @Override
- public void fireNodeRemoved(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeRemoved(treeName, path);
- }
-
- @Override
- public void fireTreeCleared(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.treeName());
- super.fireTreeCleared(event);
- }
-
- @Override
- public void fireTreeCleared(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeCleared(treeName, path);
- }
-
- @Override
- public void fireTreeChanged(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.treeName());
- super.fireTreeChanged(event);
- }
-
- @Override
- public void fireTreeChanged(String treeName, Object[] path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeChanged(treeName, path);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java
deleted file mode 100644
index 297654ded7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-
-/**
- * Wrap another collection change listener and forward events to it on the AWT
- * event queue.
- */
-public class AWTCollectionChangeListenerWrapper
- implements CollectionChangeListener
-{
- private final CollectionChangeListener listener;
-
- public AWTCollectionChangeListenerWrapper(CollectionChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared";
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #invokeAndWait(Runnable) can sometimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void itemsAdded_(CollectionChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(CollectionChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void collectionCleared_(CollectionChangeEvent event) {
- this.listener.collectionCleared(event);
- }
-
- void collectionChanged_(CollectionChangeEvent event) {
- this.listener.collectionChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java
deleted file mode 100644
index 8c63c63664..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-
-/**
- * Wrap another list change listener and forward events to it on the AWT
- * event queue.
- */
-public class AWTListChangeListenerWrapper
- implements ListChangeListener
-{
- private final ListChangeListener listener;
-
- public AWTListChangeListenerWrapper(ListChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void itemsAdded(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildListClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildListChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added";
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed";
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved";
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced";
- }
- };
- }
-
- private Runnable buildListClearedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared";
- }
- };
- }
-
- private Runnable buildListChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #invokeAndWait(Runnable) can sometimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void itemsAdded_(ListChangeEvent event) {
- this.listener.itemsAdded(event);
- }
-
- void itemsRemoved_(ListChangeEvent event) {
- this.listener.itemsRemoved(event);
- }
-
- void itemsMoved_(ListChangeEvent event) {
- this.listener.itemsMoved(event);
- }
-
- void itemsReplaced_(ListChangeEvent event) {
- this.listener.itemsReplaced(event);
- }
-
- void listCleared_(ListChangeEvent event) {
- this.listener.listCleared(event);
- }
-
- void listChanged_(ListChangeEvent event) {
- this.listener.listChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java
deleted file mode 100644
index 171ac87ad2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * Wrap another property change listener and forward events to it on the AWT
- * event queue.
- */
-public class AWTPropertyChangeListenerWrapper
- implements PropertyChangeListener
-{
- private final PropertyChangeListener listener;
-
-
- public AWTPropertyChangeListenerWrapper(PropertyChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.propertyChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTPropertyChangeListenerWrapper.this.propertyChanged_(event);
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #invokeAndWait(Runnable) can sometimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void propertyChanged_(PropertyChangeEvent event) {
- this.listener.propertyChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java
deleted file mode 100644
index bb042ae023..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-/**
- * Wrap another state change listener and forward events to it on the AWT
- * event queue.
- */
-public class AWTStateChangeListenerWrapper
- implements StateChangeListener
-{
- private final StateChangeListener listener;
-
- public AWTStateChangeListenerWrapper(StateChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void stateChanged(StateChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.stateChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildRunnable(event));
- }
- }
-
- private Runnable buildRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTStateChangeListenerWrapper.this.stateChanged_(event);
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #invokeAndWait(Runnable) can sometimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void stateChanged_(StateChangeEvent event) {
- this.listener.stateChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java
deleted file mode 100644
index 0186d5d065..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Wrap another tree change listener and forward events to it on the AWT
- * event queue.
- */
-public class AWTTreeChangeListenerWrapper
- implements TreeChangeListener
-{
- private final TreeChangeListener listener;
-
- public AWTTreeChangeListenerWrapper(TreeChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void nodeAdded(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.nodeAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (EventQueue.isDispatchThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildNodeAddedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added";
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed";
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared";
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed";
- }
- };
- }
-
- /**
- * EventQueue#invokeLater(Runnable) seems to work OK;
- * but using #invokeAndWait(Runnable) can sometimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void nodeAdded_(TreeChangeEvent event) {
- this.listener.nodeAdded(event);
- }
-
- void nodeRemoved_(TreeChangeEvent event) {
- this.listener.nodeRemoved(event);
- }
-
- void treeCleared_(TreeChangeEvent event) {
- this.listener.treeCleared(event);
- }
-
- void treeChanged_(TreeChangeEvent event) {
- this.listener.treeChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ")";
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java
deleted file mode 100644
index 77d2dad9d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-
-/**
- * Subclasses need only implement the following methods:
- *
- * #value()
- * return the user-determined "value" of the node,
- * i.e. the object "wrapped" by the node
- *
- * #setValue(Object)
- * set the user-determined "value" of the node,
- * i.e. the object "wrapped" by the node;
- * typically only overridden for nodes with "primitive" values
- *
- * #parent()
- * return the parent of the node, which should be another
- * TreeNodeValueModel
- *
- * #childrenModel()
- * return a ListValueModel for the node's children
- *
- * #engageValue() and #disengageValue()
- * override these methods to listen to the node's value if
- * it can change in a way that should be reflected in the tree
- */
-public abstract class AbstractTreeNodeValueModel<T>
- extends AbstractModel
- implements TreeNodeValueModel<T>
-{
-
-
- // ********** constructors **********
-
- /**
- * Default constructor.
- */
- protected AbstractTreeNodeValueModel() {
- super();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- // this model fires *both* "value property change" and "state change" events...
-// return new SingleAspectChangeSupport(this, PropertyChangeListener.class, PropertyValueModel.VALUE);
- return super.buildChangeSupport();
- }
-
-
- // ********** extend AbstractModel implementation **********
-
- /**
- * Clients should be adding both "state change" and "value property change"
- * listeners.
- */
- @Override
- public void addStateChangeListener(StateChangeListener listener) {
- if (this.hasNoStateChangeListeners()) {
- this.engageValue();
- }
- super.addStateChangeListener(listener);
- }
-
- /**
- * Begin listening to the node's value's state. If the state of the node changes
- * in a way that should be reflected in the tree, fire a "state change" event.
- */
- protected abstract void engageValue();
-
- /**
- * @see #addStateChangeListener(StateChangeListener)
- */
- @Override
- public void removeStateChangeListener(StateChangeListener listener) {
- super.removeStateChangeListener(listener);
- if (this.hasNoStateChangeListeners()) {
- this.disengageValue();
- }
- }
-
- /**
- * Stop listening to the node's value.
- * @see #engageValue()
- */
- protected abstract void disengageValue();
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** TreeNodeValueModel implementation **********
-
- @SuppressWarnings("unchecked")
- public TreeNodeValueModel<T>[] path() {
- List<TreeNodeValueModel<T>> path = CollectionTools.reverseList(this.backPath());
- return path.toArray(new TreeNodeValueModel[path.size()]);
- }
-
- /**
- * Return an iterator that climbs up the node's path,
- * starting with, and including, the node
- * and up to, and including, the root node.
- */
- protected Iterator<TreeNodeValueModel<T>> backPath() {
- return new ChainIterator<TreeNodeValueModel<T>>(this) {
- @Override
- protected TreeNodeValueModel<T> nextLink(TreeNodeValueModel<T> currentLink) {
- return currentLink.parent();
- }
- };
- }
-
- public TreeNodeValueModel<T> child(int index) {
- return this.childrenModel().get(index);
- }
-
- public int childrenSize() {
- return this.childrenModel().size();
- }
-
- public int indexOfChild(TreeNodeValueModel<T> child) {
- ListValueModel<TreeNodeValueModel<T>> children = this.childrenModel();
- int size = children.size();
- for (int i = 0; i < size; i++) {
- if (children.get(i) == child) {
- return i;
- }
- }
- return -1;
- }
-
- public boolean isLeaf() {
- return this.childrenModel().size() == 0;
- }
-
-
- // ********** standard methods **********
-
- /**
- * We implement #equals(Object) so that TreePaths containing these nodes
- * will resolve properly when the nodes contain the same values. This is
- * necessary because nodes are dropped and rebuilt willy-nilly when dealing
- * with a sorted list of children; and this allows us to save and restore
- * a tree's expanded paths. The nodes in the expanded paths that are
- * saved before any modification (e.g. renaming a node) will be different
- * from the nodes in the tree's paths after the modification, if the modification
- * results in a possible change in the node sort order. ~bjv
- */
- @Override
- public boolean equals(Object o) {
- if (o == null) {
- return false;
- }
- if (o.getClass() != this.getClass()) {
- return false;
- }
- @SuppressWarnings("unchecked")
- AbstractTreeNodeValueModel<T> other = (AbstractTreeNodeValueModel<T>) o;
- return this.value().equals(other.value());
- }
-
- @Override
- public int hashCode() {
- return this.value().hashCode();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java
deleted file mode 100644
index 4d7c178bab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract extension of AbstractModel provides a base for adding
- * change listeners (PropertyChange, CollectionChange, ListChange, TreeChange)
- * to a subject and converting the subject's change notifications into a single
- * set of change notifications for a common aspect (e.g. VALUE).
- *
- * The adapter will only listen to the subject (and subject holder) when the
- * adapter itself actually has listeners. This will allow the adapter to be
- * garbage collected when appropriate
- */
-public abstract class AspectAdapter<S>
- extends AbstractModel
-{
- /**
- * The subject that holds the aspect and fires
- * change notification when the aspect changes.
- * We need to hold on to this directly so we can
- * disengage it when it changes.
- */
- protected S subject;
-
- /**
- * A value model that holds the subject
- * that holds the aspect and provides change notification.
- * This is useful when there are a number of AspectAdapters
- * that have the same subject and that subject can change.
- * All the AspectAdapters should share the same subject holder.
- * For now, this is can only be set upon construction and is
- * immutable.
- */
- protected final PropertyValueModel<? extends S> subjectHolder;
-
- /** A listener that keeps us in synch with the subjectHolder. */
- protected final PropertyChangeListener subjectChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an AspectAdapter for the specified subject.
- */
- protected AspectAdapter(S subject) {
- this(new StaticPropertyValueModel<S>(subject));
- }
-
- /**
- * Construct an AspectAdapter for the specified subject holder.
- * The subject holder cannot be null.
- */
- protected AspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super();
- if (subjectHolder == null) {
- throw new NullPointerException();
- }
- this.subjectHolder = subjectHolder;
- this.subjectChangeListener = this.buildSubjectChangeListener();
- // the subject is null when we are not listening to it
- // this will typically result in our value being null
- this.subject = null;
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new LocalChangeSupport(this, this.listenerClass(), this.listenerAspectName());
- }
-
- /**
- * The subject holder's value has changed, keep our subject in synch.
- */
- protected PropertyChangeListener buildSubjectChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- AspectAdapter.this.subjectChanged();
- }
- @Override
- public String toString() {
- return "subject change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * The subject has changed. Notify listeners that the value has changed.
- */
- protected synchronized void subjectChanged() {
- Object oldValue = this.value();
- boolean hasListeners = this.hasListeners();
- if (hasListeners) {
- this.disengageSubject();
- }
- this.subject = this.subjectHolder.value();
- if (hasListeners) {
- this.engageSubject();
- this.fireAspectChange(oldValue, this.value());
- }
- }
-
- /**
- * Return the aspect's current value.
- */
- protected abstract Object value();
-
- /**
- * Return the class of listener that is interested in the aspect adapter's
- * changes.
- */
- protected abstract Class<? extends ChangeListener> listenerClass();
-
- /**
- * Return the name of the aspect adapter's aspect (e.g. VALUE).
- * This is the name of the aspect adapter's single aspect, not the
- * name of the subject's aspect the aspect adapter is adapting.
- */
- protected abstract String listenerAspectName();
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected abstract boolean hasListeners();
-
- /**
- * Return whether there are no listeners for the aspect.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * The aspect has changed, notify listeners appropriately.
- */
- protected abstract void fireAspectChange(Object oldValue, Object newValue);
-
- protected void engageSubject() {
- // check for nothing to listen to
- if (this.subject != null) {
- this.engageSubject_();
- }
- }
-
- /**
- * The subject is not null - add our listener.
- */
- protected abstract void engageSubject_();
-
- protected void disengageSubject() {
- // check for nothing to listen to
- if (this.subject != null) {
- this.disengageSubject_();
- }
- }
-
- /**
- * The subject is not null - remove our listener.
- */
- protected abstract void disengageSubject_();
-
- protected void engageSubjectHolder() {
- this.subjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- // synch our subject *after* we start listening to the subject holder,
- // since its value might change when a listener is added
- this.subject = this.subjectHolder.value();
- }
-
- protected void disengageSubjectHolder() {
- this.subjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- // clear out the subject when we are not listening to its holder
- this.subject = null;
- }
-
- protected void engageModels() {
- this.engageSubjectHolder();
- this.engageSubject();
- }
-
- protected void disengageModels() {
- this.disengageSubject();
- this.disengageSubjectHolder();
- }
-
-
- // ********** local change support **********
-
- /**
- * Extend change support to start listening to the aspect adapter's
- * models (the subject holder and the subject itself) when the first
- * relevant listener is added.
- * Conversely, stop listening to the aspect adapter's models when the
- * last relevant listener is removed.
- * A relevant listener is a listener of the relevant type.
- */
- protected class LocalChangeSupport extends SingleAspectChangeSupport {
- private static final long serialVersionUID = 1L;
-
- public LocalChangeSupport(AspectAdapter<S> source, Class<? extends ChangeListener> listenerClass, String aspectName) {
- super(source, listenerClass, aspectName);
- }
-
- protected boolean listenerIsRelevant(Class<? extends ChangeListener> lClass) {
- return lClass == this.listenerClass;
- }
-
- protected boolean hasNoRelevantListeners(Class<? extends ChangeListener> lClass) {
- return this.listenerIsRelevant(lClass)
- && this.hasNoListeners(lClass);
- }
-
- protected boolean listenerIsRelevant(Class<? extends ChangeListener> lClass, String listenerAspectName) {
- return this.listenerIsRelevant(lClass)
- && (listenerAspectName == AspectAdapter.this.listenerAspectName());
- }
-
- protected boolean hasNoRelevantListeners(Class<? extends ChangeListener> lClass, String listenerAspectName) {
- return this.listenerIsRelevant(lClass, listenerAspectName)
- && this.hasNoListeners(lClass, listenerAspectName);
- }
-
-
- // ********** overrides **********
-
- @Override
- protected <T extends ChangeListener> void addListener(Class<T> lClass, T listener) {
- if (this.hasNoRelevantListeners(lClass)) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void addListener(String listenerAspectName, Class<T> lClass, T listener) {
- if (this.hasNoRelevantListeners(lClass, listenerAspectName)) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(listenerAspectName, lClass, listener);
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(Class<T> lClass, T listener) {
- super.removeListener(lClass, listener);
- if (this.hasNoRelevantListeners(lClass)) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- @Override
- protected <T extends ChangeListener> void removeListener(String listenerAspectName, Class<T> lClass, T listener) {
- super.removeListener(listenerAspectName, lClass, listener);
- if (this.hasNoRelevantListeners(lClass, listenerAspectName)) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java
deleted file mode 100644
index 0d8539e197..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current model value
- *
- */
-public abstract class AspectPropertyValueModelAdapter<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- /**
- * Cache the current value so we can pass an "old value" when
- * we fire a property change event.
- * We need this because the value may be calculated and we may
- * not able to derive the "old value" from the collection
- * change event fired by the collection value model.
- */
- protected T value;
-
-
- // ********** constructor/initialization **********
-
- protected AspectPropertyValueModelAdapter() {
- super();
- // our value is null when we are not listening to the collection holder
- this.value = null;
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, VALUE);
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the cached value.
- */
- public T value() {
- return this.value;
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addPropertyChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (propertyName == VALUE && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Extend to stop listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- super.removePropertyChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the wrapped collection if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- super.removePropertyChangeListener(propertyName, listener);
- if (propertyName == VALUE && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model and build the value.
- */
- protected void engageModel() {
- this.engageModel_();
- // synch our value *after* we start listening to the collection,
- // since the collection's value might change when a listener is added
- this.value = this.buildValue();
- }
-
- /**
- * Start listening to the model.
- */
- protected abstract void engageModel_();
-
- /**
- * Build and return the current value, as derived from the
- * current state of the wrapped model.
- */
- protected abstract T buildValue();
-
- /**
- * Stop listening to the model and clear the value.
- */
- protected void disengageModel() {
- this.disengageModel_();
- // clear out our value when we are not listening to the collection
- this.value = null;
- }
-
- /**
- * Stop listening to the model.
- */
- protected abstract void disengageModel_();
-
- /**
- * The wrapped model changed in some fashion.
- * Recalculate the value and notify any listeners.
- */
- protected void propertyChanged() {
- Object old = this.value;
- this.value = this.buildValue();
- this.firePropertyChanged(VALUE, old, this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
deleted file mode 100644
index 4921f843d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A BufferedPropertyValueModel is used to hold a temporary copy of the value
- * in another property value model (the "wrapped" value holder). The application
- * can modify this temporary copy, ad nauseam; but the temporary copy is only
- * passed through to the "wrapped" value holder when the trigger "accepts" the
- * buffered value. Alternatively, the application can "reset" the buffered value
- * to the original, "wrapped" value.
- *
- * The trigger is another value model that holds a Boolean and the application
- * changes the trigger's value to true on "accept", false on "reset". Typically,
- * in a dialog:
- * - pressing the OK button will trigger an "accept" and close the dialog
- * - pressing the Cancel button will simply close the dialog,
- * dropping the "buffered" values into the bit bucket
- * - pressing the Apply button will trigger an "accept" and leave the dialog open
- * - pressing the Restore button will trigger a "reset" and leave the dialog open
- *
- * A number of buffered property value models can wrap another set of
- * property aspect adapters that adapt the various aspects of a single
- * domain model. All the bufferd property value models can be hooked to the
- * same trigger, and that trigger is controlled by the application, typically
- * via the OK button in a dialog.
- *
- * @see PropertyAspectAdapter
- */
-public class BufferedWritablePropertyValueModel<T>
- extends PropertyValueModelWrapper<T>
- implements WritablePropertyValueModel<T>
-{
-
- /**
- * We cache the value here until it is accepted and passed
- * through to the wrapped value holder.
- */
- protected T bufferedValue;
-
- /**
- * This is set to true when we are "accepting" the buffered value
- * and passing it through to the wrapped value holder. This allows
- * us to ignore the property change event fired by the wrapped
- * value holder.
- * (We can't stop listening to the wrapped value holder, because
- * if we are the only listener that could "deactivate" the wrapped
- * value holder.)
- */
- protected boolean accepting;
-
- /**
- * This is the trigger that indicates whether the buffered value
- * should be accepted or reset.
- */
- protected final PropertyValueModel<Boolean> triggerHolder;
-
- /** This listens to the trigger holder. */
- protected final PropertyChangeListener triggerChangeListener;
-
- /**
- * This flag indicates whether our buffered value has been assigned
- * a value and is possibly out of synch with the wrapped value.
- */
- protected boolean buffering;
-
-
- // ********** constructors **********
-
- /**
- * Construct a buffered property value model with the specified wrapped
- * property value model and trigger holder.
- */
- public BufferedWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, PropertyValueModel<Boolean> triggerHolder) {
- super(valueHolder);
- if (triggerHolder == null) {
- throw new NullPointerException();
- }
- this.triggerHolder = triggerHolder;
- this.bufferedValue = null;
- this.buffering = false;
- this.accepting = false;
- this.triggerChangeListener = this.buildTriggerChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildTriggerChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- BufferedWritablePropertyValueModel.this.triggerChanged(event);
- }
- @Override
- public String toString() {
- return "trigger change listener";
- }
- };
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * If we are currently "buffering" a value, return that;
- * otherwise, return the wrapped value.
- */
- public T value() {
- return this.buffering ? this.bufferedValue : this.valueHolder.value();
- }
-
- /**
- * Assign the new value to our "buffered" value.
- * It will be forwarded to the wrapped value holder
- * when the trigger is "accepted".
- */
- public void setValue(T value) {
- Object old = this.value();
- this.bufferedValue = value;
- this.buffering = true;
- this.firePropertyChanged(VALUE, old, this.bufferedValue);
- }
-
-
- // ********** PropertyValueModelWrapper extensions **********
-
- /**
- * extend to engage the trigger holder also
- */
- @Override
- protected void engageValueHolder() {
- super.engageValueHolder();
- this.triggerHolder.addPropertyChangeListener(VALUE, this.triggerChangeListener);
- }
-
- /**
- * extend to disengage the trigger holder also
- */
- @Override
- protected void disengageValueHolder() {
- this.triggerHolder.removePropertyChangeListener(VALUE, this.triggerChangeListener);
- super.disengageValueHolder();
- }
-
-
- // ********** behavior **********
-
- /**
- * If we do not yet have a "buffered" value, simply propagate the
- * change notification with the buffered model as the source.
- * If we do have a "buffered" value, do nothing.
- */
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- if (this.accepting) {
- // if we are currently "accepting" the value, ignore change notifications,
- // since we caused them and our own listeners are already aware of the change
- return;
- }
- if (this.buffering) {
- this.handleChangeConflict(event);
- } else {
- this.firePropertyChanged(event.cloneWithSource(this));
- }
- }
-
- /**
- * By default, if we have a "buffered" value and the "wrapped" value changes,
- * we simply ignore the new "wrapped" value and simply overlay it with the
- * "buffered" value if it is "accepted". ("Last One In Wins" concurrency model)
- * Subclasses can override this method to change that behavior with a
- * different concurrency model. For example, you could drop the "buffered" value
- * and replace it with the new "wrapped" value, or you could throw an
- * exception.
- */
- protected void handleChangeConflict(PropertyChangeEvent event) {
- // the default is to do nothing
- }
-
- /**
- * The trigger changed:
- * If it is now true, "accept" the buffered value and forward
- * it to the wrapped value holder.
- * If it is now false, "reset" the buffered value to its original value.
- */
- protected void triggerChanged(PropertyChangeEvent event) {
- if ( ! this.buffering) {
- // if nothing has been "buffered", we don't need to do anything:
- // nothing needs to be passed through; nothing needs to be reset;
- return;
- }
- if (((Boolean) event.newValue()).booleanValue()) {
- // set the accepting flag so we ignore any events
- // fired by the wrapped value holder
- this.accepting = true;
- this.valueHolder().setValue(this.bufferedValue);
- this.bufferedValue = null;
- this.buffering = false;
- // clear the flag once the "accept" is complete
- this.accepting = false;
- } else {
- // notify our listeners that our value has been reset
- Object old = this.bufferedValue;
- this.bufferedValue = null;
- this.buffering = false;
- this.firePropertyChanged(VALUE, old, this.valueHolder.value());
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value());
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the buffered model is currently "buffering"
- * a value.
- */
- public boolean isBuffering() {
- return this.buffering;
- }
-
- /**
- * Our constructor accepts only a WritablePropertyValueModel<T>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
-
- // ********** inner class **********
-
- /**
- * Trigger is a special property value model that only maintains its
- * value (of true or false) during the change notification caused by
- * the #setValue(Object) method. In other words, a Trigger object
- * only has a valid value
- */
- public static class Trigger extends SimplePropertyValueModel<Boolean> {
-
-
- // ********** constructor **********
-
- /**
- * Construct a trigger with a null value.
- */
- public Trigger() {
- super();
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * Extend so that this method can only be invoked during
- * change notification triggered by #setValue(Object).
- */
- @Override
- public Boolean value() {
- if (this.value == null) {
- throw new IllegalStateException("The method Trigger.value() may only be called during change notification.");
- }
- return this.value;
- }
-
- /**
- * Extend to reset the value to null once all the
- * listeners have been notified.
- */
- @Override
- public void setValue(Boolean value) {
- super.setValue(value);
- this.value = null;
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Set the trigger's value:
- * - true indicates "accept"
- * - false indicates "reset"
- */
- public void setValue(boolean value) {
- this.setValue(Boolean.valueOf(value));
- }
-
- /**
- * Return the trigger's value:
- * - true indicates "accept"
- * - false indicates "reset"
- */
- public boolean booleanValue() {
- return this.value().booleanValue();
- }
-
- /**
- * Accept the trigger (i.e. set its value to true).
- */
- public void accept() {
- this.setValue(true);
- }
-
- /**
- * Return whether the trigger has been accepted
- * (i.e. its value was changed to true).
- */
- public boolean isAccepted() {
- return this.booleanValue();
- }
-
- /**
- * Reset the trigger (i.e. set its value to false).
- */
- public void reset() {
- this.setValue(false);
- }
-
- /**
- * Return whether the trigger has been reset
- * (i.e. its value was changed to false).
- */
- public boolean isReset() {
- return ! this.booleanValue();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
deleted file mode 100644
index 2aeede9576..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of AspectAdapter provides CollectionChange support.
- * This allows us to convert a set of one or more collections into
- * a single collection, VALUES.
- *
- * The typical subclass will override the following methods:
- * #iterator_()
- * at the very minimum, override this method to return an iterator on the
- * subject's collection aspect; it does not need to be overridden if
- * #iterator() is overridden and its behavior changed
- * #size_()
- * override this method to improve performance; it does not need to be overridden if
- * #size() is overridden and its behavior changed
- * #iterator()
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- * #size()
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- */
-public abstract class CollectionAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements CollectionValueModel<E>
-{
- /**
- * The name of the subject's collections that we use for the value.
- */
- protected final String[] collectionNames;
- protected static final String[] EMPTY_COLLECTION_NAMES = new String[0];
-
- /** A listener that listens to the subject's collection aspect. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject
- * and collection.
- */
- protected CollectionAspectAdapter(String collectionName, S subject) {
- this(new String[] {collectionName}, subject);
- }
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject
- * and collections.
- */
- protected CollectionAspectAdapter(String[] collectionNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), collectionNames);
- }
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject holder
- * and collections.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... collectionNames) {
- super(subjectHolder);
- this.collectionNames = collectionNames;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
- /**
- * Construct a CollectionAspectAdapter for the specified subject holder
- * and collections.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> collectionNames) {
- this(subjectHolder, collectionNames.toArray(new String[collectionNames.size()]));
- }
-
- /**
- * Construct a CollectionAspectAdapter for an "unchanging" collection in
- * the specified subject. This is useful for a collection aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new collection.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_COLLECTION_NAMES);
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's collection aspect has changed, notify the listeners.
- */
- protected CollectionChangeListener buildCollectionChangeListener() {
- // transform the subject's collection change events into VALUE collection change events
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener: " + Arrays.asList(CollectionAspectAdapter.this.collectionNames);
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- /**
- * Return the elements of the subject's collection aspect.
- */
- public Iterator<E> iterator() {
- return (this.subject == null) ? EmptyIterator.<E>instance() : this.iterator_();
- }
-
- /**
- * Return the elements of the subject's collection aspect.
- * At this point we can be sure that the subject is not null.
- * @see #iterator()
- */
- protected Iterator<E> iterator_() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the size of the subject's collection aspect.
- */
- public int size() {
- return (this.subject == null) ? 0 : this.size_();
- }
-
- /**
- * Return the size of the subject's collection aspect.
- * At this point we can be sure that the subject is not null.
- * @see #size()
- */
- protected int size_() {
- return CollectionTools.size(this.iterator());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object value() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireCollectionChanged(VALUES);
- }
-
- @Override
- protected void engageSubject_() {
- for (String collectionName : this.collectionNames) {
- ((Model) this.subject).addCollectionChangeListener(collectionName, this.collectionChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String collectionName : this.collectionNames) {
- ((Model) this.subject).removeCollectionChangeListener(collectionName, this.collectionChangeListener);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.collectionNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.collectionNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(CollectionChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, VALUES));
- }
-
- protected void itemsRemoved(CollectionChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, VALUES));
- }
-
- protected void collectionCleared(CollectionChangeEvent event) {
- this.fireCollectionCleared(VALUES); // nothing from original event to forward
- }
-
- protected void collectionChanged(CollectionChangeEvent event) {
- this.fireCollectionChanged(VALUES); // nothing from original event to forward
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java
deleted file mode 100644
index 32ac311a6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a CollectionValueModel behave like
- * a read-only ListValueModel, sorta.
- *
- * To maintain a reasonably consistent appearance to client code, we
- * keep an internal list somewhat in synch with the wrapped collection.
- *
- * NB: Since we only listen to the wrapped collection when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * collection while we are listening to it, results to various methods
- * (e.g. #size(), getItem(int)) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- */
-public class CollectionListValueModelAdapter<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<? extends E> collectionHolder;
-
- /** A listener that forwards any events fired by the collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
- /**
- * Our internal list, which holds the same elements as
- * the wrapped collection, but keeps them in order.
- */
- // we declare this an ArrayList so we can use #clone() and #ensureCapacity(int)
- protected final ArrayList<E> list;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified CollectionValueModel.
- */
- public CollectionListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- super();
- if (collectionHolder == null) {
- throw new NullPointerException();
- }
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- this.list = new ArrayList<E>();
- // postpone building the list and listening to the underlying collection
- // until we have listeners ourselves...
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
- /**
- * The wrapped collection has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.list);
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public int size() {
- return this.list.size();
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the collection holder if necessary.
- */
- @Override
- public void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Override to start listening to the collection holder if necessary.
- */
- @Override
- public void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Override to stop listening to the collection holder if appropriate.
- */
- @Override
- public void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the collection holder if appropriate.
- */
- @Override
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return the index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.list.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.list.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** behavior **********
-
- protected void buildList() {
- Iterator<? extends E> stream = this.collectionHolder.iterator();
- // if the new collection is empty, do nothing
- if (stream.hasNext()) {
- this.list.ensureCapacity(this.collectionHolder.size());
- while (stream.hasNext()) {
- this.list.add(stream.next());
- }
- this.postBuildList();
- }
- }
-
- /**
- * Allow subclasses to manipulate the internal list before
- * sending out change notification.
- */
- protected void postBuildList() {
- // the default is to do nothing...
- }
-
- protected void engageModel() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- // synch our list *after* we start listening to the collection holder,
- // since its value might change when a listener is added
- this.buildList();
- }
-
- protected void disengageModel() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- // clear out the list when we are not listening to the collection holder
- this.list.clear();
- }
-
- protected void itemsAdded(CollectionChangeEvent e) {
- this.addItemsToList(this.indexToAddItems(), CollectionTools.list(this.items(e)), this.list, LIST_VALUES);
- }
-
- protected int indexToAddItems() {
- return this.list.size();
- }
-
- @SuppressWarnings("unchecked")
- protected Iterator<E> items(CollectionChangeEvent e) {
- return (Iterator<E>) e.items();
- }
-
- protected void itemsRemoved(CollectionChangeEvent e) {
- // we have to remove the items individually,
- // since they are probably not in sequence
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.removeItemFromList(this.lastIdentityIndexOf(stream.next()), this.list, LIST_VALUES);
- }
- }
-
- protected void collectionCleared(CollectionChangeEvent e) {
- this.clearList(this.list, LIST_VALUES);
- }
-
- /**
- * synchronize our internal list with the wrapped collection
- * and fire the appropriate events
- */
- protected void collectionChanged(CollectionChangeEvent e) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.list.isEmpty()) {
- @SuppressWarnings("unchecked")
- ArrayList<E> removedItems = (ArrayList<E>) this.list.clone();
- this.list.clear();
- this.fireItemsRemoved(LIST_VALUES, 0, removedItems);
- }
-
- this.buildList();
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.list.isEmpty()) {
- this.fireItemsAdded(LIST_VALUES, 0, this.list);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java
deleted file mode 100644
index a28ff711db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a collection value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current collection value
- *
- * Subclasses might want to override:
- * - #itemsAdded(CollectionChangeEvent event)
- * - #itemsRemoved(CollectionChangeEvent event)
- * - #collectionCleared(CollectionChangeEvent event)
- * - #collectionChanged(CollectionChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class CollectionPropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<T>
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<?> collectionHolder;
-
- /** A listener that allows us to synch with changes to the wrapped collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * collection value model.
- */
- protected CollectionPropertyValueModelAdapter(CollectionValueModel<?> collectionHolder) {
- super();
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the collection holder.
- */
- @Override
- protected void engageModel_() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- /**
- * Stop listening to the collection holder.
- */
- @Override
- protected void disengageModel_() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(CollectionChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were removed from the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected void itemsRemoved(CollectionChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped collection holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void collectionCleared(CollectionChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The value of the wrapped collection holder has changed;
- * propagate the change notification appropriately.
- */
- protected void collectionChanged(CollectionChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java
deleted file mode 100644
index f4bd305c89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another collection value model, "lazily" listen to it, and propagate
- * its change notifications.
- */
-public abstract class CollectionValueModelWrapper<E>
- extends AbstractModel
-{
-
- /** The wrapped collection value model. */
- protected final CollectionValueModel<? extends E> collectionHolder;
-
- /** A listener that allows us to synch with changes to the wrapped collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model.
- */
- protected CollectionValueModelWrapper(CollectionValueModel<? extends E> collectionHolder) {
- super();
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, CollectionValueModel.VALUES);
- }
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener";
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == CollectionValueModel.VALUES && this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == CollectionValueModel.VALUES && this.hasNoCollectionChangeListeners(CollectionValueModel.VALUES)) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the collection holder.
- */
- protected void engageModel() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- /**
- * Stop listening to the collection holder.
- */
- protected void disengageModel() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterator<E> items(CollectionChangeEvent event) {
- return (Iterator<E>) event.items();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collectionHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(CollectionChangeEvent event);
-
- /**
- * Items were removed from the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(CollectionChangeEvent event);
-
- /**
- * The wrapped collection holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void collectionCleared(CollectionChangeEvent event);
-
- /**
- * The value of the wrapped collection holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void collectionChanged(CollectionChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
deleted file mode 100644
index 2fd65eebb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NullList;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>CompositeCollectionValueModel</code> wraps another
- * <code>CollectionValueModel</code> and uses a <code>Transformer</code>
- * to convert each item in the wrapped collection to yet another
- * <code>CollectionValueModel</code>. This composite collection contains
- * the combined items from all these component collections.
- *
- * NB: The wrapped collection must be an "identity set" that does not
- * contain the same item twice or this class will throw an exception.
- *
- * Terminology:
- * - sources - the items in the wrapped collection value model; these
- * are converted into component CVMs by the transformer
- * - component CVMs - the component collection value models that are combined
- * by this composite collection value model
- * - items - the items held by the component CVMs
- */
-public class CompositeCollectionValueModel<E1, E2>
- extends CollectionValueModelWrapper<E1>
- implements CollectionValueModel<E2>
-{
- /**
- * This is the (optional) user-supplied object that transforms
- * the items in the wrapped collection to collection value models.
- */
- private final Transformer<E1, CollectionValueModel<E2>> transformer;
-
- /**
- * Cache of the component collection value models that
- * were generated by the transformer; keyed by the item
- * in the wrapped collection that was passed to the transformer.
- */
- private final IdentityHashMap<E1, CollectionValueModel<E2>> componentCVMs;
-
- /**
- * Cache of the collections corresponding to the component
- * collection value models above; keyed by the component
- * collection value models.
- * Use ArrayLists so we can use ArrayList-specific methods
- * (e.g. #clone() and #ensureCapacity()).
- */
- private final IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>> collections;
-
- /** Listener that listens to all the component collection value models. */
- private final CollectionChangeListener componentCVMListener;
-
- /** Cache the size of the composite collection. */
- private int size;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model. Use this constructor if
- * - the wrapped collection value model already contains other
- * collection value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- public CompositeCollectionValueModel(CollectionValueModel<? extends E1> collectionHolder) {
- this(collectionHolder, Transformer.Null.<E1, CollectionValueModel<E2>>instance());
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and transformer.
- */
- public CompositeCollectionValueModel(CollectionValueModel<? extends E1> collectionHolder, Transformer<E1, CollectionValueModel<E2>> transformer) {
- super(collectionHolder);
- this.transformer = transformer;
- this.componentCVMs = new IdentityHashMap<E1, CollectionValueModel<E2>>();
- this.collections = new IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>>();
- this.componentCVMListener = this.buildComponentListener();
- this.size = 0;
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model. Use this constructor if
- * - the wrapped list value model already contains collection
- * value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- public CompositeCollectionValueModel(ListValueModel<? extends E1> listHolder) {
- this(new ListCollectionValueModelAdapter<E1>(listHolder));
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and transformer.
- */
- public CompositeCollectionValueModel(ListValueModel<? extends E1> listHolder, Transformer<E1, CollectionValueModel<E2>> transformer) {
- this(new ListCollectionValueModelAdapter<E1>(listHolder), transformer);
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection. Use this constructor if
- * - the wrapped collection already contains collection
- * value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- public CompositeCollectionValueModel(Collection<? extends E1> collection) {
- this(new StaticCollectionValueModel<E1>(collection));
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection and transformer.
- */
- public CompositeCollectionValueModel(Collection<? extends E1> collection, Transformer<E1, CollectionValueModel<E2>> transformer) {
- this(new StaticCollectionValueModel<E1>(collection), transformer);
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildComponentListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentItemsRemoved(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentCollectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentCollectionChanged(event);
- }
- @Override
- public String toString() {
- return "component listener";
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E2> iterator() {
- return new CompositeIterator<E2>(this.buildCollectionsIterators());
- }
-
- protected Iterator<Iterator<E2>> buildCollectionsIterators() {
- return new TransformationIterator<ArrayList<E2>, Iterator<E2>>(this.collections.values().iterator()) {
- @Override
- protected Iterator<E2> transform(ArrayList<E2> next) {
- return next.iterator();
- }
- };
- }
-
- public int size() {
- return this.size;
- }
-
-
- // ********** CollectionValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the wrapped collection,
- // since its value might change when a listener is added
- this.addAllComponentSources();
- }
-
- /**
- * Transform all the sources to collection value models
- * and add their items to our cache, with no event notification.
- */
- protected void addAllComponentSources() {
- for (E1 source : this.collectionHolder) {
- this.addComponentSource(source, NullList.<E2>instance());
- }
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // stop listening to the components...
- for (CollectionValueModel<E2> componentCVM : this.componentCVMs.values()) {
- componentCVM.removeCollectionChangeListener(VALUES, this.componentCVMListener);
- }
- // ...and clear the cache
- this.componentCVMs.clear();
- this.collections.clear();
- this.size = 0;
- }
-
- /**
- * Some component sources were added;
- * add their corresponding items to our cache.
- */
- @Override
- protected void itemsAdded(CollectionChangeEvent event) {
- ArrayList<E2> addedItems = new ArrayList<E2>();
- for (Iterator<E1> stream = this.items(event); stream.hasNext(); ) {
- this.addComponentSource(stream.next(), addedItems);
- }
- this.fireItemsAdded(VALUES, addedItems);
- }
-
- /**
- * Transform the specified source to a collection value model
- * and add its items to our cache and the "collecting parameter".
- */
- protected void addComponentSource(E1 source, List<E2> addedItems) {
- CollectionValueModel<E2> componentCVM = this.transform(source);
- if (this.componentCVMs.put(source, componentCVM) != null) {
- throw new IllegalStateException("duplicate component: " + source);
- }
- componentCVM.addCollectionChangeListener(VALUES, this.componentCVMListener);
- ArrayList<E2> componentCollection = new ArrayList<E2>(componentCVM.size());
- if (this.collections.put(componentCVM, componentCollection) != null) {
- throw new IllegalStateException("duplicate collection: " + source);
- }
- this.addComponentItems(componentCVM, componentCollection);
- addedItems.addAll(componentCollection);
- }
-
- /**
- * Add the items in the specified component CVM to the specified component
- * collection.
- */
- protected void addComponentItems(CollectionValueModel<E2> componentCVM, ArrayList<E2> componentCollection) {
- int itemsSize = componentCVM.size();
- this.size += itemsSize;
- componentCollection.ensureCapacity(componentCollection.size() + itemsSize);
- CollectionTools.addAll(componentCollection, componentCVM);
- }
-
- /**
- * Some component sources were removed;
- * remove their corresponding items from our cache.
- */
- @Override
- protected void itemsRemoved(CollectionChangeEvent event) {
- ArrayList<E2> removedItems = new ArrayList<E2>();
- for (Iterator<E1> stream = this.items(event); stream.hasNext(); ) {
- this.removeComponentSource(stream.next(), removedItems);
- }
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- /**
- * Remove the items corresponding to the specified source
- * from our cache.
- */
- protected void removeComponentSource(E1 source, List<E2> removedItems) {
- CollectionValueModel<E2> componentCVM = this.componentCVMs.remove(source);
- if (componentCVM == null) {
- throw new IllegalStateException("missing component: " + source);
- }
- componentCVM.removeCollectionChangeListener(VALUES, this.componentCVMListener);
- ArrayList<E2> componentCollection = this.collections.remove(componentCVM);
- if (componentCollection == null) {
- throw new IllegalStateException("missing collection: " + source);
- }
- removedItems.addAll(componentCollection);
- this.removeComponentItems(componentCollection);
- }
-
- /**
- * Update our size and collection cache.
- */
- protected void removeComponentItems(ArrayList<E2> componentCollection) {
- this.size -= componentCollection.size();
- componentCollection.clear();
- }
-
- /**
- * The component sources cleared;
- * clear our cache.
- */
- @Override
- protected void collectionCleared(CollectionChangeEvent event) {
- this.removeAllComponentSources();
- this.fireCollectionCleared(VALUES);
- }
-
- protected void removeAllComponentSources() {
- // copy the keys so we don't eat our own tail
- ArrayList<E1> copy = new ArrayList<E1>(this.componentCVMs.keySet());
- for (E1 source : copy) {
- this.removeComponentSource(source, NullList.<E2>instance());
- }
- }
-
- /**
- * The component sources changed;
- * rebuild our cache.
- */
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.removeAllComponentSources();
- this.addAllComponentSources();
- this.fireCollectionChanged(VALUES);
- }
-
-
- // ********** internal methods **********
-
- /**
- * Transform the specified object into a collection value model.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Transformer</code>.
- */
- protected CollectionValueModel<E2> transform(E1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * One of the component collections had items added;
- * synchronize our caches.
- */
- protected void componentItemsAdded(CollectionChangeEvent event) {
- int itemsSize = event.itemsSize();
- this.size += itemsSize;
-
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- componentCollection.ensureCapacity(componentCollection.size() + itemsSize);
-
- this.addItemsToCollection(this.componentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections had items removed;
- * synchronize our caches.
- */
- protected void componentItemsRemoved(CollectionChangeEvent event) {
- this.size -= event.itemsSize();
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- this.removeItemsFromCollection(this.componentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections was cleared;
- * synchronize our caches by clearing out the appropriate
- * collection.
- */
- protected void componentCollectionCleared(CollectionChangeEvent event) {
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- ArrayList<E2> removedItems = new ArrayList<E2>(componentCollection);
- this.removeComponentItems(componentCollection);
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- /**
- * One of the component collections changed;
- * synchronize our caches by clearing out the appropriate
- * collection and then rebuilding it.
- */
- protected void componentCollectionChanged(CollectionChangeEvent event) {
- CollectionValueModel<E2> componentCVM = this.componentCVM(event);
- ArrayList<E2> componentCollection = this.collections.get(componentCVM);
- this.removeComponentItems(componentCollection);
- this.addComponentItems(componentCVM, componentCollection);
- this.fireCollectionChanged(VALUES);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterator<E2> componentItems(CollectionChangeEvent event) {
- return (Iterator<E2>) event.items();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<E2> componentCVM(CollectionChangeEvent event) {
- return (CollectionValueModel<E2>) event.getSource();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java
deleted file mode 100644
index 0282b0cedb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>CompositeListValueModel</code> wraps another
- * <code>ListValueModel</code> and uses a <code>Transformer</code>
- * to convert each item in the wrapped list to yet another
- * <code>ListValueModel</code>. This composite list contains
- * the combined items from all these component lists.
- *
- * Terminology:
- * - sources - the items in the wrapped list value model; these
- * are converted into component LVMs by the transformer
- * - componentLVMs - the component list value models that are combined
- * by this composite list value model
- * - items - the items held by the component LVMs
- */
-public class CompositeListValueModel<E1, E2>
- extends ListValueModelWrapper<E1>
- implements ListValueModel<E2>
-{
- /**
- * This is the (optional) user-supplied object that transforms
- * the items in the wrapped list to list value models.
- */
- private final Transformer<E1, ListValueModel<E2>> transformer;
-
- /**
- * Cache of the sources, component LVMs, lists.
- */
- private final ArrayList<Info> infoList;
- protected class Info {
- // the object passed to the transformer
- final E1 source;
- // the list value model generated by the transformer
- final ListValueModel<E2> componentLVM;
- // cache of the items held by the component LVM
- final ArrayList<E2> items;
- // the component LVM's beginning index within the composite LVM
- int begin;
- Info(E1 source, ListValueModel<E2> componentLVM, ArrayList<E2> items, int begin) {
- super();
- this.source = source;
- this.componentLVM = componentLVM;
- this.items = items;
- this.begin = begin;
- }
- }
-
- /** Listener that listens to all the component list value models. */
- private final ListChangeListener componentLVMListener;
-
- /** Cache the size of the composite list. */
- private int size;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model. Use this constructor if
- * - the wrapped list value model already contains other
- * list value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- public CompositeListValueModel(ListValueModel<? extends E1> listHolder) {
- this(listHolder, Transformer.Null.<E1, ListValueModel<E2>>instance());
- }
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model and transformer.
- */
- public CompositeListValueModel(ListValueModel<? extends E1> listHolder, Transformer<E1, ListValueModel<E2>> transformer) {
- super(listHolder);
- this.transformer = transformer;
- this.infoList = new ArrayList<Info>();
- this.componentLVMListener = this.buildComponentLVMListener();
- this.size = 0;
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list. Use this constructor if
- * - the wrapped list already contains list value models or
- * - you want to override the <code>transform(E1)</code> method
- * instead of building a <code>Transformer</code>
- */
- public CompositeListValueModel(List<? extends E1> list) {
- this(new StaticListValueModel<E1>(list));
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list and transformer.
- */
- public CompositeListValueModel(List<? extends E1> list, Transformer<E1, ListValueModel<E2>> transformer) {
- this(new StaticListValueModel<E1>(list), transformer);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildComponentLVMListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- CompositeListValueModel.this.componentItemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- CompositeListValueModel.this.componentListCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- CompositeListValueModel.this.componentListChanged(event);
- }
- @Override
- public String toString() {
- return "component LVM listener";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public E2 get(int index) {
- if ((index < 0) || (index >= this.size)) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size);
- }
- // move backwards through the info list
- for (int i = this.infoList.size(); i-- > 0; ) {
- Info info = this.infoList.get(i);
- if (index >= info.begin) {
- return info.items.get(index - info.begin);
- }
- }
- throw new IllegalStateException(); // something is wack
- }
-
- public Iterator<E2> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E2> listIterator() {
- return new ReadOnlyCompositeListIterator<E2>(this.buildListsIterators());
- }
-
- protected ListIterator<ListIterator<E2>> buildListsIterators() {
- return new TransformationListIterator<Info, ListIterator<E2>>(this.infoList.listIterator()) {
- @Override
- protected ListIterator<E2> transform(Info info) {
- return info.items.listIterator();
- }
- };
- }
-
- public int size() {
- return this.size;
- }
-
- public Object[] toArray() {
- return CollectionTools.array(this.listIterator(), this.size);
- }
-
-
- // ********** ListValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the wrapped list,
- // since its value might change when a listener is added
- this.addComponentSources(0, this.listHolder.listIterator(), this.listHolder.size());
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // stop listening to the component LVMs...
- for (Info info : this.infoList) {
- info.componentLVM.removeListChangeListener(LIST_VALUES, this.componentLVMListener);
- }
- // ...and clear the cache
- this.infoList.clear();
- this.size = 0;
- }
-
- /**
- * Some component sources were added; update our cache.
- */
- @Override
- protected void itemsAdded(ListChangeEvent event) {
- this.addComponentSources(event.index(), this.items(event), event.itemsSize(), true); // true = fire event
- }
-
- /**
- * Do not fire an event.
- */
- protected void addComponentSources(int addedSourcesIndex, ListIterator<? extends E1> addedSources, int addedSourcesSize) {
- this.addComponentSources(addedSourcesIndex, addedSources, addedSourcesSize, false); // false = do not fire event
- }
-
- /**
- * Add infos corresponding to the specified sources to our cache.
- * Fire the appropriate event if requested.
- */
- protected void addComponentSources(int addedSourcesIndex, ListIterator<? extends E1> addedSources, int addedSourcesSize, boolean fireEvent) {
- ArrayList<Info> newInfoList = new ArrayList<Info>(addedSourcesSize);
- // the 'items' are either tacked on to the end or
- // at the 'begin' index of the first 'info' that is being pushed back
- int newItemsIndex = (addedSourcesIndex == this.infoList.size()) ? this.size : this.infoList.get(addedSourcesIndex).begin;
-
- int begin = newItemsIndex;
- while (addedSources.hasNext()) {
- E1 source = addedSources.next();
- ListValueModel<E2> componentLVM = this.transform(source);
- componentLVM.addListChangeListener(LIST_VALUES, this.componentLVMListener);
- ArrayList<E2> items = new ArrayList<E2>(componentLVM.size());
- CollectionTools.addAll(items, componentLVM.listIterator());
- newInfoList.add(new Info(source, componentLVM, items, begin));
- begin += items.size();
- }
- this.infoList.addAll(addedSourcesIndex, newInfoList);
- int newItemsSize = begin - newItemsIndex;
- this.size += newItemsSize;
-
- // bump the 'begin' index for all the infos that were pushed back by the insert
- int movedInfosIndex = addedSourcesIndex + addedSourcesSize;
- for (int i = movedInfosIndex; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
-
- if (fireEvent) {
- ArrayList<E2> newItems = new ArrayList<E2>(newItemsSize);
- for (int i = addedSourcesIndex; i < movedInfosIndex; i++) {
- newItems.addAll(this.infoList.get(i).items);
- }
- this.fireItemsAdded(LIST_VALUES, newItemsIndex, newItems);
- }
- }
-
- /**
- * Some component sources were removed; update our cache.
- */
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.removeComponentSources(event.index(), event.itemsSize(), true); // true = fire event
- }
-
- /**
- * Do not fire an event.
- */
- protected void removeComponentSources(int removedSourcesIndex, int removedSourcesSize) {
- this.removeComponentSources(removedSourcesIndex, removedSourcesSize, false); // false = do not fire event
- }
-
- /**
- * Remove the infos corresponding to the specified sources from our cache.
- */
- protected void removeComponentSources(int removedSourcesIndex, int removedSourcesSize, boolean fireEvent) {
- int removedItemsIndex = this.infoList.get(removedSourcesIndex).begin;
- int movedSourcesIndex = removedSourcesIndex + removedSourcesSize;
- int movedItemsIndex = (movedSourcesIndex == this.infoList.size()) ? this.size : this.infoList.get(movedSourcesIndex).begin;
- int removedItemsSize = movedItemsIndex - removedItemsIndex;
- this.size -= removedItemsSize;
-
- List<Info> subList = this.infoList.subList(removedSourcesIndex, removedSourcesIndex + removedSourcesSize);
- ArrayList<Info> removedInfoList = new ArrayList<Info>(subList); // make a copy
- subList.clear();
-
- // decrement the 'begin' index for all the infos that were moved forward by the deletes
- for (int i = removedSourcesIndex; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
-
- for (Info removedInfo : removedInfoList) {
- removedInfo.componentLVM.removeListChangeListener(LIST_VALUES, this.componentLVMListener);
- }
-
- if (fireEvent) {
- ArrayList<E2> removedItems = new ArrayList<E2>(removedItemsSize);
- for (Info removedInfo : removedInfoList) {
- removedItems.addAll(removedInfo.items);
- }
- this.fireItemsRemoved(LIST_VALUES, removedItemsIndex, removedItems);
- }
- }
-
- /**
- * Some component sources were replaced; update our cache.
- */
- @Override
- protected void itemsReplaced(ListChangeEvent event) {
- this.replaceComponentSources(event.index(), this.items(event), event.itemsSize(), true); // true = fire event
- }
-
- /**
- * Replaced component sources will not (typically) map to a set of replaced
- * items, so we remove and add the corresponding lists of items, resulting in
- * two events.
- */
- protected void replaceComponentSources(int replacedSourcesIndex, ListIterator<? extends E1> newSources, int replacedSourcesSize, boolean fireEvent) {
- this.removeComponentSources(replacedSourcesIndex, replacedSourcesSize, fireEvent);
- this.addComponentSources(replacedSourcesIndex, newSources, replacedSourcesSize, fireEvent);
- }
-
- /**
- * Some component sources were moved; update our cache.
- */
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- this.moveComponentSources(event.targetIndex(), event.sourceIndex(), event.moveLength(), true); // true = fire event
- }
-
- protected void moveComponentSources(int targetSourcesIndex, int sourceSourcesIndex, int movedSourcesLength, boolean fireEvent) {
- int sourceItemsIndex = this.infoList.get(sourceSourcesIndex).begin;
-
- int nextSourceSourceIndex = sourceSourcesIndex + movedSourcesLength;
- int nextSourceItemIndex = (nextSourceSourceIndex == this.infoList.size()) ? this.size : this.infoList.get(nextSourceSourceIndex).begin;
- int moveItemsLength = nextSourceItemIndex - sourceItemsIndex;
-
- int targetItemsIndex = -1;
- if (sourceSourcesIndex > targetSourcesIndex) {
- // move from high to low index
- targetItemsIndex = this.infoList.get(targetSourcesIndex).begin;
- } else {
- // move from low to high index (higher items move down during move)
- int nextTargetSourceIndex = targetSourcesIndex + movedSourcesLength;
- targetItemsIndex = (nextTargetSourceIndex == this.infoList.size()) ? this.size : this.infoList.get(nextTargetSourceIndex).begin;
- targetItemsIndex = targetItemsIndex - moveItemsLength;
- }
-
- CollectionTools.move(this.infoList, targetSourcesIndex, sourceSourcesIndex, movedSourcesLength);
-
- // update the 'begin' indexes of all the affected 'infos'
- int min = Math.min(targetSourcesIndex, sourceSourcesIndex);
- int max = Math.max(targetSourcesIndex, sourceSourcesIndex) + movedSourcesLength;
- int begin = Math.min(targetItemsIndex, sourceItemsIndex);
- for (int i = min; i < max; i++) {
- Info info = this.infoList.get(i);
- info.begin = begin;
- begin += info.componentLVM.size();
- }
-
- if (fireEvent) {
- this.fireItemsMoved(LIST_VALUES, targetItemsIndex, sourceItemsIndex, moveItemsLength);
- }
- }
-
- /**
- * The component sources were cleared; clear our cache.
- */
- @Override
- protected void listCleared(ListChangeEvent event) {
- this.removeComponentSources(0, this.infoList.size());
- this.fireListCleared(LIST_VALUES);
- }
-
- /**
- * The component sources changed; rebuild our cache.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.removeComponentSources(0, this.infoList.size());
- this.addComponentSources(0, this.listHolder.listIterator(), this.listHolder.size());
- this.fireListChanged(LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(CollectionTools.list(this.listIterator(), this.size));
- }
-
-
- // ********** internal methods **********
-
- /**
- * Transform the specified object into a list value model.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Transformer</code>.
- */
- protected ListValueModel<E2> transform(E1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * Return the index of the specified component LVM.
- */
- protected int indexOf(ListValueModel<E2> componentLVM) {
- for (int i = 0; i < this.infoList.size(); i++) {
- if (this.infoList.get(i).componentLVM == componentLVM) {
- return i;
- }
- }
- throw new IllegalArgumentException("invalid component LVM: " + componentLVM);
- }
-
- /**
- * Return the index of the specified event's component LVM.
- */
- protected int indexFor(ListChangeEvent event) {
- return this.indexOf(this.componentLVM(event));
- }
-
- /**
- * Items were added to one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsAdded(ListChangeEvent event) {
- // update the affected 'begin' indices
- int componentLVMIndex = this.indexFor(event);
- int newItemsSize = event.itemsSize();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
- this.size += newItemsSize;
-
- // synchronize the cached list
- Info info = this.infoList.get(componentLVMIndex);
- CollectionTools.addAll(info.items, event.index(), this.componentItems(event), event.itemsSize());
-
- // translate the event
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were removed from one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsRemoved(ListChangeEvent event) {
- // update the affected 'begin' indices
- int componentLVMIndex = this.indexFor(event);
- int removedItemsSize = event.itemsSize();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
- this.size -= removedItemsSize;
-
- // synchronize the cached list
- Info info = this.infoList.get(componentLVMIndex);
- int itemIndex = event.index();
- info.items.subList(itemIndex, itemIndex + event.itemsSize()).clear();
-
- // translate the event
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were replaced in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsReplaced(ListChangeEvent event) {
- // no changes to the 'begin' indices or size
-
- // synchronize the cached list
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- int i = event.index();
- for (Iterator<E2> stream = this.componentItems(event); stream.hasNext(); ) {
- info.items.set(i++, stream.next());
- }
-
- // translate the event
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were moved in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsMoved(ListChangeEvent event) {
- // no changes to the 'begin' indices or size
-
- // synchronize the cached list
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- CollectionTools.move(info.items, event.targetIndex(), event.sourceIndex(), event.moveLength());
-
- // translate the event
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES, info.begin));
- }
-
- /**
- * One of the component lists was cleared;
- * synchronize our cache.
- */
- protected void componentListCleared(ListChangeEvent event) {
- int componentLVMIndex = this.indexFor(event);
- this.clearComponentList(componentLVMIndex, this.infoList.get(componentLVMIndex));
- }
-
- protected void clearComponentList(int componentLVMIndex, Info info) {
- // update the affected 'begin' indices
- int removedItemsSize = info.items.size();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
- this.size -= removedItemsSize;
-
- // synchronize the cached list
- ArrayList<E2> items = new ArrayList<E2>(info.items);
- info.items.clear();
-
- // translate the event
- this.fireItemsRemoved(LIST_VALUES, info.begin, items);
- }
-
- /**
- * One of the component lists changed;
- * synchronize our cache by clearing out the appropriate
- * list and rebuilding it.
- */
- protected void componentListChanged(ListChangeEvent event) {
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- this.clearComponentList(componentLVMIndex, info);
-
- // update the affected 'begin' indices
- int newItemsSize = info.componentLVM.size();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
- this.size += newItemsSize;
-
- // synchronize the cached list
- CollectionTools.addAll(info.items, info.componentLVM.listIterator(), newItemsSize);
-
- // translate the event
- this.fireItemsAdded(LIST_VALUES, info.begin, info.items);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E2> componentItems(ListChangeEvent event) {
- return (ListIterator<E2>) event.items();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListValueModel<E2> componentLVM(ListChangeEvent event) {
- return (ListValueModel<E2>) event.getSource();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java
deleted file mode 100644
index 84bd413e02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This wrapper extends a ListValueModel (or CollectionValueModel)
- * with fixed collections of items on either end.
- * <p>
- * NB: Be careful using or wrapping this list value model, since the
- * "extended" items may be unexpected by the client code or wrapper.
- */
-public class ExtendedListValueModelWrapper<E>
- extends ListValueModelWrapper<E>
- implements ListValueModel<E>
-{
- /** the items "prepended" to the wrapped list */
- protected List<E> prefix;
-
- /** the items "appended" to the wrapped list */
- protected List<E> suffix;
-
-
- // ********** lots o' constructors **********
-
- /**
- * Extend the specified list with a prefix and suffix.
- */
- public ExtendedListValueModelWrapper(List<? extends E> prefix, ListValueModel<? extends E> listHolder, List<? extends E> suffix) {
- super(listHolder);
- this.prefix = new ArrayList<E>(prefix);
- this.suffix = new ArrayList<E>(suffix);
- }
-
- /**
- * Extend the specified list with a prefix and suffix.
- */
- public ExtendedListValueModelWrapper(E prefix, ListValueModel<? extends E> listHolder, E suffix) {
- super(listHolder);
- this.prefix = Collections.singletonList(prefix);
- this.suffix = Collections.singletonList(suffix);
- }
-
- /**
- * Extend the specified list with a prefix.
- */
- public ExtendedListValueModelWrapper(List<? extends E> prefix, ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = new ArrayList<E>(prefix);
- this.suffix = Collections.emptyList();
- }
-
- /**
- * Extend the specified list with a prefix.
- */
- public ExtendedListValueModelWrapper(E prefix, ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = Collections.singletonList(prefix);
- this.suffix = Collections.emptyList();
- }
-
- /**
- * Extend the specified list with a suffix.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder, List<? extends E> suffix) {
- super(listHolder);
- this.prefix = Collections.emptyList();
- this.suffix = new ArrayList<E>(suffix);
- }
-
- /**
- * Extend the specified list with a suffix.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder, E suffix) {
- super(listHolder);
- this.prefix = Collections.emptyList();
- this.suffix = Collections.singletonList(suffix);
- }
-
- /**
- * Extend the specified list with a prefix containing a single null item.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = Collections.singletonList(null);
- this.suffix = Collections.emptyList();
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.listIterator_());
- }
-
- @SuppressWarnings("unchecked")
- protected ListIterator<E> listIterator_() {
- return new ReadOnlyCompositeListIterator<E>(
- this.prefix.listIterator(),
- this.listHolder.listIterator(),
- this.suffix.listIterator()
- );
- }
-
- public E get(int index) {
- int prefixSize = this.prefix.size();
- if (index < prefixSize) {
- return this.prefix.get(index);
- } else if (index >= prefixSize + this.listHolder.size()) {
- return this.suffix.get(index - (prefixSize + this.listHolder.size()));
- } else {
- return this.listHolder.get(index - prefixSize);
- }
- }
-
- public int size() {
- return this.prefix.size() + this.listHolder.size() + this.suffix.size();
- }
-
- public Object[] toArray() {
- ArrayList<E> list = new ArrayList<E>(this.size());
- list.addAll(this.prefix);
- CollectionTools.addAll(list, this.listHolder.iterator());
- list.addAll(this.suffix);
- return list.toArray();
- }
-
-
- // ********** ListValueModelWrapper implementation/overrides **********
-
- @Override
- protected void itemsAdded(ListChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsReplaced(ListChangeEvent event) {
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void listCleared(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES); // not "cleared"
- }
-
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.prefix);
- sb.append(" ");
- super.toString(sb);
- sb.append(" ");
- sb.append(this.suffix);
- }
-
-
- // ********** miscellaneous **********
-
- public void setPrefix(List<E> prefix) {
- this.prefix = prefix;
- this.fireListChanged(LIST_VALUES);
- }
-
- public void setSuffix(List<E> suffix) {
- this.suffix = suffix;
- this.fireListChanged(LIST_VALUES);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java
deleted file mode 100644
index 4cf2e2bc6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>FilteringCollectionValueModel</code> wraps another
- * <code>CollectionValueModel</code> and uses a <code>Filter</code>
- * to determine which items in the collection are returned by calls
- * to <code>#iterator()</code>.
- * <p>
- * The filter can be changed at any time; allowing the same
- * adapter to be used with different filter criteria (e.g. when the user
- * wants to view a list of .java files).
- * <p>
- * NB: If the objects in the "filtered" collection can change in such a way
- * that they should be removed from the "filtered" collection, you will
- * need to wrap the original collection in an ItemAspectListValueModelAdapter.
- * For example, if the filter only "accepts" items whose names begin
- * with "X" and the names of the items can change, you will need to
- * wrap the original list of unfiltered items with an
- * ItemPropertyListValueModelAdapter that listens for changes to each
- * item's name and fires the appropriate event whenever an item's name
- * changes. The event will cause this wrapper to re-filter the changed
- * item and add or remove it from the "filtered" collection as appropriate.
- */
-public class FilteringCollectionValueModel<E>
- extends CollectionValueModelWrapper<E>
- implements CollectionValueModel<E>
-{
- /** This filters the items in the nested collection. */
- private Filter<E> filter;
-
- /** Cache the items that were accepted by the filter */
- private final Collection<E> filteredItems;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and a filter that simply accepts every object.
- */
- public FilteringCollectionValueModel(CollectionValueModel<? extends E> collectionHolder) {
- this(collectionHolder, Filter.Null.<E>instance());
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and filter.
- */
- public FilteringCollectionValueModel(CollectionValueModel<? extends E> collectionHolder, Filter<E> filter) {
- super(collectionHolder);
- this.filter = filter;
- this.filteredItems = new ArrayList<E>();
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and a filter that simply accepts every object.
- */
- public FilteringCollectionValueModel(ListValueModel<E> listHolder) {
- this(new ListCollectionValueModelAdapter<E>(listHolder));
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and filter.
- */
- public FilteringCollectionValueModel(ListValueModel<E> listHolder, Filter<E> filter) {
- this(new ListCollectionValueModelAdapter<E>(listHolder), filter);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.filteredItems);
- }
-
- public int size() {
- return this.filteredItems.size();
- }
-
-
- // ********** CollectionValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the nested collection,
- // since its value might change when a listener is added
- CollectionTools.addAll(this.filteredItems, this.filter(this.collectionHolder.iterator()));
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the cache when we are not listening to the nested collection
- this.filteredItems.clear();
- }
-
- @Override
- protected void itemsAdded(CollectionChangeEvent event) {
- // filter the values before propagating the change event
- this.addItemsToCollection(this.filter(this.items(event)), this.filteredItems, VALUES);
- }
-
- @Override
- protected void itemsRemoved(CollectionChangeEvent event) {
- // do *not* filter the values, because they may no longer be
- // "accepted" and that might be why they were removed in the first place;
- // anyway, any extraneous items are harmless
- this.removeItemsFromCollection(event.items(), this.filteredItems, VALUES);
- }
-
- @Override
- protected void collectionCleared(CollectionChangeEvent event) {
- this.clearCollection(this.filteredItems, VALUES);
- }
-
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.rebuildFilteredItems();
- }
-
-
- // ********** miscellaneous **********
-
- /**
- * Change the filter and rebuild the collection.
- */
- public void setFilter(Filter<E> filter) {
- this.filter = filter;
- this.rebuildFilteredItems();
- }
-
- /**
- * Return an iterator that filters the specified iterator.
- */
- protected Iterator<E> filter(Iterator<? extends E> items) {
- return new FilteringIterator<E, E>(items, this.filter);
- }
-
- /**
- * Synchronize our cache with the wrapped collection.
- */
- protected void rebuildFilteredItems() {
- this.filteredItems.clear();
- CollectionTools.addAll(this.filteredItems, this.filter(this.collectionHolder.iterator()));
- this.fireCollectionChanged(VALUES);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java
deleted file mode 100644
index 0cb1596c03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>FilteringPropertyValueModel</code> wraps another
- * <code>PropertyValueModel</code> and uses a <code>Filter</code>
- * to determine when the wrapped value is to be returned by calls
- * to <code>value()</code>.
- * <p>
- * As an alternative to building a <code>Filter</code>, a subclass
- * of <code>FilteringPropertyValueModel</code> can override the
- * <code>accept(Object)</code> method.
- * <p>
- * One, possibly undesirable, side-effect of using this value model is that
- * it must return *something* as the value. The default behavior is
- * to return <code>null</code> whenever the wrapped value is not "accepted",
- * which can be configured and/or overridden.
- */
-public class FilteringPropertyValueModel<T>
- extends PropertyValueModelWrapper<T>
- implements PropertyValueModel<T>
-{
- protected final Filter<T> filter;
- protected final T defaultValue;
-
-
- // ********** constructors **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code>
- * method instead of building a <code>Filter</code>.
- * The default value will be <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder) {
- this(valueHolder, Filter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a property value model with the specified nested
- * property value model, specified default value, and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code>
- * method instead of building a <code>Filter</code>
- * <em>and</em> you need to specify
- * a default value other than <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, T defaultValue) {
- this(valueHolder, Filter.Disabled.<T>instance(), defaultValue);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and filter.
- * The default value will be <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, Filter<T> filter) {
- this(valueHolder, filter, null);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model, filter, and default value.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, Filter<T> filter, T defaultValue) {
- super(valueHolder);
- this.filter = filter;
- this.defaultValue = defaultValue;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T value() {
- return this.filterValue(this.valueHolder.value());
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- // filter the values before propagating the change event
- @SuppressWarnings("unchecked")
- Object oldValue = this.filterValue((T) event.oldValue());
- @SuppressWarnings("unchecked")
- Object newValue = this.filterValue((T) event.newValue());
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
-
- // ********** queries **********
-
- /**
- * If the specified value is "accepted" simply return it,
- * otherwise return the default value.
- */
- protected T filterValue(T value) {
- return this.accept(value) ? value : this.defaultValue();
- }
-
- /**
- * Return whether the <code>FilteringPropertyValueModel</code> should
- * return the specified value from a call to the
- * <code>value()</code> method; the value came
- * from the nested property value model
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>Filter</code>.
- */
- protected boolean accept(T value) {
- return this.filter.accept(value);
- }
-
- /**
- * Return the object that should be returned if
- * the nested value was rejected by the filter.
- * The default is <code>null</code>.
- */
- protected T defaultValue() {
- return this.defaultValue;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java
deleted file mode 100644
index b789e00463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>FilteringWritablePropertyValueModel</code> wraps another
- * <code>WritabelPropertyValueModel</code> and uses a <code>BidiFilter</code>
- * to determine when the wrapped value is to be returned by calls
- * to <code>value()</code> and modified by calls to
- * <code>setValue(Object)</code>.
- * <p>
- * As an alternative to building a <code>BidiFilter</code>, a subclass
- * of <code>FilteringWritablePropertyValueModel</code> can override the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods.
- * <p>
- * One, possibly undesirable, side-effect of using this value model is that
- * it must return *something* as the value. The default behavior is
- * to return <code>null</code> whenever the wrapped value is not "accepted",
- * which can be configured and/or overridden.
- * <p>
- * Similarly, if an incoming value is not "reverseAccepted", *nothing* will passed
- * through to the wrapped value holder, not even <code>null</code>.
- */
-public class FilteringWritablePropertyValueModel<T>
- extends FilteringPropertyValueModel<T>
- implements WritablePropertyValueModel<T>
-{
-
-
- // ********** constructors **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods instead of building a <code>BidiFilter</code>.
- * The default value will be <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder) {
- this(valueHolder, BidiFilter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a property value model with the specified nested
- * property value model, specified default value, and a disabled filter.
- * Use this constructor if you want to override the
- * <code>accept(Object)</code> and <code>reverseAccept(Object)</code>
- * methods instead of building a <code>BidiFilter</code>
- * <em>and</em> you need to specify
- * a default value other than <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, T defaultValue) {
- this(valueHolder, BidiFilter.Disabled.<T>instance(), defaultValue);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and filter.
- * The default value will be <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, BidiFilter<T> filter) {
- this(valueHolder, filter, null);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model, filter, and default value.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, BidiFilter<T> filter, T defaultValue) {
- super(valueHolder, filter, defaultValue);
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- if (this.reverseAccept(value)) {
- this.valueHolder().setValue(value);
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the <code>FilteringWritablePropertyValueModel</code>
- * should pass through the specified value to the nested
- * writable property value model in a call to the
- * <code>setValue(Object)</code> method
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a <code>BidiFilter</code>.
- */
- protected boolean reverseAccept(T value) {
- return this.filter().reverseAccept(value);
- }
-
- /**
- * Our constructors accept only a WritablePropertyValueModel<T>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
- /**
- * Our constructors accept only a bidirectional filter.
- */
- protected BidiFilter<T> filter() {
- return (BidiFilter<T>) this.filter;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java
deleted file mode 100644
index 3c86dbbc91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventObject;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.Counter;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Abstract list value model that provides behavior for wrapping a list value
- * model (or collection value model) and listening for changes to aspects of the
- * *items* held by the list (or collection). Changes to the actual list
- * (or collection) are also monitored.
- *
- * This is useful if you have a collection of items that can be modified by adding
- * or removing items or the items themselves might change in a fashion that
- * might change the collection's external appearance.
- *
- * Subclasses need to override two methods:
- *
- * #listenToItem(Model)
- * begin listening to the appropriate aspect of the specified item and call
- * #itemAspectChanged(Object) whenever the aspect changes
- *
- * #stopListeningToItem(Model)
- * stop listening to the appropriate aspect of the specified item
- */
-public abstract class ItemAspectListValueModelAdapter<E>
- extends ListValueModelWrapper<E>
- implements ListValueModel<E>
-{
-
- /**
- * Maintain a counter for each of the items in the
- * wrapped list holder we are listening to.
- */
- protected final IdentityHashMap<E, Counter> counters;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder is required.
- */
- protected ItemAspectListValueModelAdapter(ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.counters = new IdentityHashMap<E, Counter>();
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- protected ItemAspectListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.listHolder.listIterator());
- }
-
- public E get(int index) {
- return this.listHolder.get(index);
- }
-
- public int size() {
- return this.listHolder.size();
- }
-
- public Object[] toArray() {
- return this.listHolder.toArray();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder and the items in the list.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.engageAllItems();
- }
-
- protected void engageAllItems() {
- this.engageItems(this.listHolder.iterator());
- }
-
- protected void engageItems(Iterator<? extends E> stream) {
- while (stream.hasNext()) {
- this.engageItem(stream.next());
- }
- }
-
- protected void engageItem(E item) {
- // listen to an item only once
- Counter counter = this.counters.get(item);
- if (counter == null) {
- counter = new Counter();
- this.counters.put(item, counter);
- this.startListeningToItem((Model) item);
- }
- counter.increment();
- }
-
- /**
- * Start listening to the specified item.
- */
- protected abstract void startListeningToItem(Model item);
-
- /**
- * Stop listening to the list holder and the items in the list.
- */
- @Override
- protected void disengageModel() {
- this.disengageAllItems();
- super.disengageModel();
- }
-
- protected void disengageAllItems() {
- this.disengageItems(this.listHolder.iterator());
- }
-
- protected void disengageItems(Iterator<? extends E> stream) {
- while (stream.hasNext()) {
- this.disengageItem(stream.next());
- }
- }
-
- protected void disengageItem(E item) {
- // stop listening to an item only once
- Counter counter = this.counters.get(item);
- if (counter == null) {
- // something is wrong if this happens... ~bjv
- throw new IllegalStateException("missing counter: " + item);
- }
- if (counter.decrement() == 0) {
- this.counters.remove(item);
- this.stopListeningToItem((Model) item);
- }
- }
-
- /**
- * Stop listening to the specified item.
- */
- protected abstract void stopListeningToItem(Model item);
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder.
- * Forward the event and begin listening to the added items.
- */
- @Override
- protected void itemsAdded(ListChangeEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES));
- this.engageItems(this.items(event));
- }
-
- /**
- * Items were removed from the wrapped list holder.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.disengageItems(this.items(event));
- // re-fire event with the wrapper as the source
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- /**
- * Items were replaced in the wrapped list holder.
- * Stop listening to the removed items, forward the event,
- * and begin listening to the added items.
- */
- @Override
- protected void itemsReplaced(ListChangeEvent event) {
- this.disengageItems(this.replacedItems(event));
- // re-fire event with the wrapper as the source
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES));
- this.engageItems(this.items(event));
- }
-
- /**
- * Items were moved in the wrapped list holder.
- * No need to change any listeners; just forward the event.
- */
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- /**
- * The wrapped list holder was cleared.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void listCleared(ListChangeEvent event) {
- // we should only need to disengage each item once...
- // make a copy to prevent a ConcurrentModificationException
- Collection<E> keys = new ArrayList<E>(this.counters.keySet());
- this.disengageItems(keys.iterator());
- this.counters.clear();
- // re-fire event with the wrapper as the source
- this.fireListCleared(LIST_VALUES);
- }
-
- /**
- * The wrapped list holder has changed in some dramatic fashion.
- * Reconfigure our listeners and forward the event.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- // we should only need to disengage each item once...
- // make a copy to prevent a ConcurrentModificationException
- Collection<E> keys = new ArrayList<E>(this.counters.keySet());
- this.disengageItems(keys.iterator());
- this.counters.clear();
- // re-fire event with the wrapper as the source
- this.fireListChanged(LIST_VALUES);
- this.engageAllItems();
- }
-
-
- // ********** item change support **********
-
- /**
- * The specified item has a bound property that has changed.
- * Notify listeners of the change.
- */
- protected void itemAspectChanged(EventObject event) {
- Object item = event.getSource();
- int index = this.lastIdentityIndexOf(item);
- while (index != -1) {
- this.itemAspectChanged(index, item);
- index = this.lastIdentityIndexOf(item, index);
- }
- }
-
- /**
- * The specified item has a bound property that has changed.
- * Notify listeners of the change.
- */
- protected void itemAspectChanged(int index, Object item) {
- this.fireItemReplaced(LIST_VALUES, index, item, item); // hmmm...
- }
-
- /**
- * Return the last index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.listHolder.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.listHolder.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java
deleted file mode 100644
index 6f46a74c32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend ItemAspectListValueModelAdapter to listen to one or more collection
- * aspects of each item in the wrapped list model.
- */
-public class ItemCollectionListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' collections that we listen to. */
- protected final String[] collectionNames;
-
- /** Listener that listens to all the items in the list. */
- protected final CollectionChangeListener itemCollectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item Collections.
- */
- public ItemCollectionListValueModelAdapter(ListValueModel<E> listHolder, String... collectionNames) {
- super(listHolder);
- this.collectionNames = collectionNames;
- this.itemCollectionListener = this.buildItemCollectionListener();
- }
-
- /**
- * Construct an adapter for the specified item Collections.
- */
- public ItemCollectionListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... collectionNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), collectionNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a Collection aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected CollectionChangeListener buildItemCollectionListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void collectionCleared(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item collection listener: " + Arrays.asList(ItemCollectionListValueModelAdapter.this.collectionNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String collectionName : this.collectionNames) {
- item.addCollectionChangeListener(collectionName, this.itemCollectionListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(Model item) {
- for (String collectionName : this.collectionNames) {
- item.removeCollectionChangeListener(collectionName, this.itemCollectionListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java
deleted file mode 100644
index 9c3ac67ac5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend ItemAspectListValueModelAdapter to listen to one or more list
- * aspects of each item in the wrapped list model.
- */
-public class ItemListListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the subject's lists that we listen to. */
- protected final String[] listNames;
-
- /** Listener that listens to all the items in the list. */
- protected final ListChangeListener itemListListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item List aspects.
- */
- public ItemListListValueModelAdapter(ListValueModel<E> listHolder, String... listNames) {
- super(listHolder);
- this.listNames = listNames;
- this.itemListListener = this.buildItemListListener();
- }
-
- /**
- * Construct an adapter for the specified item List aspects.
- */
- public ItemListListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... listNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), listNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that the List aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected ListChangeListener buildItemListListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void listCleared(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void listChanged(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item list listener: " + Arrays.asList(ItemListListValueModelAdapter.this.listNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String listName : this.listNames) {
- item.addListChangeListener(listName, this.itemListListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(Model item) {
- for (String listName : this.listNames) {
- item.removeListChangeListener(listName, this.itemListListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
deleted file mode 100644
index 3a00073252..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend ItemAspectListValueModelAdapter to listen to one or more
- * properties of each item in the wrapped list model.
- */
-public class ItemPropertyListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' properties that we listen to. */
- protected final String[] propertyNames;
-
- /** Listener that listens to all the items in the list. */
- protected final PropertyChangeListener itemPropertyListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item properties.
- */
- public ItemPropertyListValueModelAdapter(ListValueModel<E> listHolder, String... propertyNames) {
- super(listHolder);
- this.propertyNames = propertyNames;
- this.itemPropertyListener = this.buildItemPropertyListener();
- }
-
- /**
- * Construct an adapter for the specified item properties.
- */
- public ItemPropertyListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... propertyNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), propertyNames);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildItemPropertyListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ItemPropertyListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item property listener: " + Arrays.asList(ItemPropertyListValueModelAdapter.this.propertyNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String propertyName : this.propertyNames) {
- item.addPropertyChangeListener(propertyName, this.itemPropertyListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(Model item) {
- for (String propertyName : this.propertyNames) {
- item.removePropertyChangeListener(propertyName, this.itemPropertyListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
deleted file mode 100644
index 46d7d863fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend ItemAspectListValueModelAdapter to listen to the
- * "state" of each item in the wrapped list model.
- */
-public class ItemStateListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
- /** Listener that listens to all the items in the list. */
- protected final StateChangeListener itemStateListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the item state.
- */
- public ItemStateListValueModelAdapter(ListValueModel<E> listHolder) {
- super(listHolder);
- this.itemStateListener = this.buildItemStateListener();
- }
-
- /**
- * Construct an adapter for the item state.
- */
- public ItemStateListValueModelAdapter(CollectionValueModel<E> collectionHolder) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** initialization **********
-
- protected StateChangeListener buildItemStateListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ItemStateListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item state listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- item.addStateChangeListener(this.itemStateListener);
- }
-
- @Override
- protected void stopListeningToItem(Model item) {
- item.removeStateChangeListener(this.itemStateListener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java
deleted file mode 100644
index 5fcc770398..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend ItemAspectListValueModelAdapter to listen to one or more tree
- * aspects of each item in the wrapped list model.
- */
-public class ItemTreeListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' tree that we listen to. */
- protected final String[] treeNames;
-
- /** Listener that listens to all the items in the list. */
- protected final TreeChangeListener itemTreeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item trees.
- */
- public ItemTreeListValueModelAdapter(ListValueModel<E> listHolder, String... treeNames) {
- super(listHolder);
- this.treeNames = treeNames;
- this.itemTreeListener = this.buildItemTreeListener();
- }
-
- /**
- * Construct an adapter for the specified item trees.
- */
- public ItemTreeListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... treeNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), treeNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a tree aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected TreeChangeListener buildItemTreeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void treeCleared(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item tree listener: " + Arrays.asList(ItemTreeListValueModelAdapter.this.treeNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void startListeningToItem(Model item) {
- for (String treeName : this.treeNames) {
- item.addTreeChangeListener(treeName, this.itemTreeListener);
- }
- }
-
- @Override
- protected void stopListeningToItem(Model item) {
- for (String treeName : this.treeNames) {
- item.removeTreeChangeListener(treeName, this.itemTreeListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java
deleted file mode 100644
index 17e7cc555d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of AspectAdapter provides ListChange support.
- * This allows us to convert a set of one or more collections into
- * a single collection, LIST_VALUES.
- *
- * The typical subclass will override the following methods:
- * #listIterator_()
- * at the very minimum, override this method to return a list iterator
- * on the subject's list aspect; it does not need to be overridden if
- * #listIterator() is overridden and its behavior changed
- * #get(int)
- * override this method to improve performance
- * #size_()
- * override this method to improve performance; it does not need to be overridden if
- * #size() is overridden and its behavior changed
- * #listIterator()
- * override this method only if returning an empty list iterator when the
- * subject is null is unacceptable
- * #size()
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- */
-public abstract class ListAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements ListValueModel<E>
-{
- /**
- * The name of the subject's lists that we use for the value.
- */
- protected final String[] listNames;
- protected static final String[] EMPTY_LIST_NAMES = new String[0];
-
- /** A listener that listens to the subject's list aspect. */
- protected final ListChangeListener listChangeListener;
-
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
-
- // ********** constructors **********
-
- /**
- * Construct a ListAspectAdapter for the specified subject
- * and list.
- */
- protected ListAspectAdapter(String listName, S subject) {
- this(new String[] {listName}, subject);
- }
-
- /**
- * Construct a ListAspectAdapter for the specified subject
- * and lists.
- */
- protected ListAspectAdapter(String[] listNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), listNames);
- }
-
- /**
- * Construct a ListAspectAdapter for the specified subject holder
- * and lists.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... listNames) {
- super(subjectHolder);
- this.listNames = listNames;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- /**
- * Construct a ListAspectAdapter for the specified subject holder
- * and lists.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> listNames) {
- this(subjectHolder, listNames.toArray(new String[listNames.size()]));
- }
-
- /**
- * Construct a ListAspectAdapter for an "unchanging" list in
- * the specified subject. This is useful for a list aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new list.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_LIST_NAMES);
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's list aspect has changed, notify the listeners.
- */
- protected ListChangeListener buildListChangeListener() {
- // transform the subject's list change events into VALUE list change events
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListAspectAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListAspectAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListAspectAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListAspectAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListAspectAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener: " + Arrays.asList(ListAspectAdapter.this.listNames);
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- /**
- * Return the elements of the subject's list aspect.
- */
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- /**
- * Return the elements of the subject's list aspect.
- */
- public ListIterator<E> listIterator() {
- return (this.subject == null) ? EmptyListIterator.<E>instance() : this.listIterator_();
- }
-
- /**
- * Return the elements of the subject's list aspect.
- * At this point we can be sure that the subject is not null.
- * @see #listIterator()
- */
- protected ListIterator<E> listIterator_() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the element at the specified index of the subject's list aspect.
- */
- public E get(int index) {
- return CollectionTools.get(this.listIterator(), index);
- }
-
- /**
- * Return the size of the subject's list aspect.
- */
- public int size() {
- return this.subject == null ? 0 : this.size_();
- }
-
- /**
- * Return the size of the subject's list aspect.
- * At this point we can be sure that the subject is not null.
- * @see #size()
- */
- protected int size_() {
- return CollectionTools.size(this.listIterator());
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- */
- public Object[] toArray() {
- return this.subject == null ? EMPTY_ARRAY : this.toArray_();
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- * At this point we can be sure that the subject is not null.
- * @see #toArray()
- */
- protected Object[] toArray_() {
- return CollectionTools.array(this.listIterator(), this.size());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object value() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return ListChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return LIST_VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireListChanged(LIST_VALUES);
- }
-
- @Override
- protected void engageSubject_() {
- for (String listName : this.listNames) {
- ((Model) this.subject).addListChangeListener(listName, this.listChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String listName : this.listNames) {
- ((Model) this.subject).removeListChangeListener(listName, this.listChangeListener);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.listNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.listNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(ListChangeEvent event) {
- this.fireItemsAdded(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsRemoved(ListChangeEvent event) {
- this.fireItemsRemoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsReplaced(ListChangeEvent event) {
- this.fireItemsReplaced(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void itemsMoved(ListChangeEvent event) {
- this.fireItemsMoved(event.cloneWithSource(this, LIST_VALUES));
- }
-
- protected void listCleared(ListChangeEvent event) {
- this.fireListCleared(LIST_VALUES); // nothing from original event to forward
- }
-
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES); // nothing from original event to forward
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
deleted file mode 100644
index 30e73a7bfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a ListValueModel behave like
- * a read-only CollectionValueModel, sorta.
- *
- * We keep an internal collection somewhat in synch with the wrapped list.
- *
- * NB: Since we only listen to the wrapped list when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * list while we are listening to it, results to various methods
- * (e.g. #size(), value()) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- */
-public class ListCollectionValueModelAdapter<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- /** The wrapped list value model. */
- protected final ListValueModel<? extends E> listHolder;
-
- /** A listener that forwards any events fired by the list holder. */
- protected final ListChangeListener listChangeListener;
-
- /**
- * Our internal collection, which holds the same elements as
- * the wrapped list.
- */
- // we declare this an ArrayList so we can use #clone() and #ensureCapacity(int)
- protected final ArrayList<E> collection;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Wrap the specified ListValueModel.
- */
- public ListCollectionValueModelAdapter(ListValueModel<? extends E> listHolder) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- this.collection = new ArrayList<E>();
- // postpone building the collection and listening to the underlying list
- // until we have listeners ourselves...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
- /**
- * The wrapped list has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- // try to prevent backdoor modification of the list
- return new ReadOnlyIterator<E>(this.collection);
- }
-
- public int size() {
- return this.collection.size();
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the list holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Override to start listening to the list holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Override to stop listening to the list holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the list holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return the index of the specified item, using object
- * identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o) {
- return this.lastIdentityIndexOf(o, this.collection.size());
- }
-
- /**
- * Return the last index of the specified item, starting just before the
- * the specified endpoint, and using object identity instead of equality.
- */
- protected int lastIdentityIndexOf(Object o, int end) {
- for (int i = end; i-- > 0; ) {
- if (this.collection.get(i) == o) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** behavior **********
-
- protected void buildCollection() {
- Iterator<? extends E> stream = this.listHolder.iterator();
- // if the new list is empty, do nothing
- if (stream.hasNext()) {
- this.collection.ensureCapacity(this.listHolder.size());
- while (stream.hasNext()) {
- this.collection.add(stream.next());
- }
- }
- }
-
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- // synch our collection *after* we start listening to the list holder,
- // since its value might change when a listener is added
- this.buildCollection();
- }
-
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- // clear out the collection when we are not listening to the list holder
- this.collection.clear();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> items(ListChangeEvent event) {
- return (ListIterator<E>) event.items();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> replacedItems(ListChangeEvent event) {
- return (ListIterator<E>) event.replacedItems();
- }
-
- protected void itemsAdded(ListChangeEvent event) {
- this.addItemsToCollection(this.items(event), this.collection, VALUES);
- }
-
- protected void removeInternalItems(Iterator<E> items) {
- // we have to remove the items individually,
- // since they are probably not in sequence
- while (items.hasNext()) {
- Object removedItem = items.next();
- int index = this.lastIdentityIndexOf(removedItem);
- this.collection.remove(index);
- this.fireItemRemoved(VALUES, removedItem);
- }
- }
-
- protected void itemsRemoved(ListChangeEvent event) {
- this.removeInternalItems(this.items(event));
- }
-
- protected void itemsReplaced(ListChangeEvent event) {
- this.removeInternalItems(this.replacedItems(event));
- this.addItemsToCollection(this.items(event), this.collection, VALUES);
- }
-
- protected void itemsMoved(ListChangeEvent event) {
- // do nothing? moving items in a list has no net effect on a collection...
- }
-
- protected void listCleared(ListChangeEvent event) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- this.collection.clear();
- this.fireCollectionCleared(VALUES);
- }
- }
-
- /**
- * synchronize our internal collection with the wrapped list
- * and fire the appropriate events
- */
- protected void listChanged(ListChangeEvent event) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- @SuppressWarnings("unchecked")
- ArrayList<E> removedItems = (ArrayList<E>) this.collection.clone();
- this.collection.clear();
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- this.buildCollection();
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- this.fireItemsAdded(VALUES, this.collection);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java
deleted file mode 100644
index 69c7b7b24e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of AspectAdapter provides ListChange support
- * by adapting a subject's state change events to a minimum set
- * of list change events.
- */
-public abstract class ListCurator<S extends Model, E>
- extends AspectAdapter<S>
- implements ListValueModel<E>
-{
- /** How the list looked before the last state change */
- private final ArrayList<E> record;
-
- /** A listener that listens for the subject's state to change */
- private final StateChangeListener stateChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a Curator for the specified subject.
- */
- protected ListCurator(S subject) {
- this(new StaticPropertyValueModel<S>(subject));
- }
-
- /**
- * Construct a curator for the specified subject holder.
- * The subject holder cannot be null.
- */
- protected ListCurator(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- this.record = new ArrayList<E>();
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's state has changed, do inventory and report to listeners.
- */
- protected StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ListCurator.this.submitInventoryReport();
- }
- @Override
- public String toString() {
- return "state change listener";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.record);
- }
-
- /**
- * Return the item at the specified index of the subject's list aspect.
- */
- public E get(int index) {
- return this.record.get(index);
- }
-
- /**
- * Return the size of the subject's list aspect.
- */
- public int size() {
- return this.record.size();
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- */
- public Object[] toArray() {
- return this.record.toArray();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object value() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return ListChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return LIST_VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- /**
- * The aspect has changed, notify listeners appropriately.
- */
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireListChanged(LIST_VALUES);
- }
-
- /**
- * The subject is not null - add our listener.
- */
- @Override
- protected void engageSubject_() {
- ((Model) this.subject).addStateChangeListener(this.stateChangeListener);
- // synch our list *after* we start listening to the subject,
- // since its value might change when a listener is added
- CollectionTools.addAll(this.record, this.iteratorForRecord());
- }
-
- /**
- * The subject is not null - remove our listener.
- */
- @Override
- protected void disengageSubject_() {
- ((Model) this.subject).removeStateChangeListener(this.stateChangeListener);
- // clear out the list when we are not listening to the subject
- this.record.clear();
- }
-
-
- // ********** ListCurator protocol **********
-
- /**
- * This is intended to be different from #ListValueModel.iterator().
- * It is intended to be used only when the subject changes or the
- * subject's "state" changes (as signified by a state change event).
- */
- protected abstract Iterator<E> iteratorForRecord();
-
-
- // ********** behavior **********
-
- void submitInventoryReport() {
- List<E> newRecord = CollectionTools.list(this.iteratorForRecord());
- int recordIndex = 0;
-
- // add items from the new record
- for (E newItem : newRecord) {
- this.inventoryNewItem(recordIndex, newItem);
- recordIndex++;
- }
-
- // clean out items that are no longer in the new record
- for (recordIndex = 0; recordIndex < this.record.size(); ) {
- E item = this.record.get(recordIndex);
-
- if (newRecord.contains(item)) {
- recordIndex++;
- } else {
- this.removeItemFromInventory(recordIndex, item);
- }
- }
- }
-
- private void inventoryNewItem(int recordIndex, E newItem) {
- List<E> rec = new ArrayList<E>(this.record);
-
- if ((recordIndex < rec.size()) && rec.get(recordIndex).equals(newItem)) {
- return;
- }
- if (rec.contains(newItem)) {
- this.removeItemFromInventory(recordIndex, rec.get(recordIndex));
- this.inventoryNewItem(recordIndex, newItem);
- } else {
- this.addItemToInventory(recordIndex, newItem);
- }
- }
-
- private void addItemToInventory(int index, E item) {
- this.addItemToList(index, item, this.record, LIST_VALUES);
- }
-
- private void removeItemFromInventory(int index, E item) {
- this.removeItemFromList(index, this.record, LIST_VALUES);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java
deleted file mode 100644
index 6c78b4fd62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a list value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current list value
- *
- * Subclasses might want to override:
- * - #itemsAdded(ListChangeEvent event)
- * - #itemsRemoved(ListChangeEvent event)
- * - #itemsReplaced(ListChangeEvent event)
- * - #itemsMoved(ListChangeEvent event)
- * - #listCleared(ListChangeEvent event)
- * - #listChanged(ListChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class ListPropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<T>
-{
- /** The wrapped list value model. */
- protected final ListValueModel<?> listHolder;
-
- /** A listener that allows us to synch with changes to the wrapped list holder. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * list value model.
- */
- protected ListPropertyValueModelAdapter(ListValueModel<?> listHolder) {
- super();
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder.
- */
- @Override
- protected void engageModel_() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- /**
- * Stop listening to the list holder.
- */
- @Override
- protected void disengageModel_() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were removed from the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsRemoved(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were replaced in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsReplaced(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were moved in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsMoved(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped list holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void listCleared(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The value of the wrapped list holder has changed;
- * propagate the change notification appropriately.
- */
- protected void listChanged(ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java
deleted file mode 100644
index 3eb604dfd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another list value model, "lazily" listen to it, and propagate
- * its change notifications.
- */
-public abstract class ListValueModelWrapper<E>
- extends AbstractModel
-{
-
- /** The wrapped list value model. */
- protected final ListValueModel<? extends E> listHolder;
-
- /** A listener that allows us to synch with changes to the wrapped list holder. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model.
- */
- protected ListValueModelWrapper(ListValueModel<? extends E> listHolder) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, ListValueModel.LIST_VALUES);
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListValueModelWrapper.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListValueModelWrapper.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListValueModelWrapper.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener";
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == ListValueModel.LIST_VALUES && this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == ListValueModel.LIST_VALUES && this.hasNoListChangeListeners(ListValueModel.LIST_VALUES)) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder.
- */
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- /**
- * Stop listening to the list holder.
- */
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.listHolder);
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> items(ListChangeEvent event) {
- return (ListIterator<E>) event.items();
- }
-
- // minimize suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListIterator<E> replacedItems(ListChangeEvent event) {
- return (ListIterator<E>) event.replacedItems();
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(ListChangeEvent event);
-
- /**
- * Items were removed from the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(ListChangeEvent event);
-
- /**
- * Items were replaced in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsReplaced(ListChangeEvent event);
-
- /**
- * Items were moved in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsMoved(ListChangeEvent event);
-
- /**
- * The wrapped list holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void listCleared(ListChangeEvent event);
-
- /**
- * The value of the wrapped list holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void listChanged(ListChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java
deleted file mode 100644
index 910d90b53a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * A read-only collection value model for when you
- * don't need to support a collection. In particular, this
- * is useful for the leaf nodes of a tree that never have
- * children.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullCollectionValueModel() {
- super();
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public int size() {
- return 0;
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
deleted file mode 100644
index 3092ed6895..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An empty list value model for when you don't
- * need to support a list.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- private static final Object[] EMPTY_ARRAY = new Object[0];
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullListValueModel() {
- super();
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- public ListIterator<E> listIterator() {
- return EmptyListIterator.instance();
- }
-
- public int size() {
- return 0;
- }
-
- public E get(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0");
- }
-
- public Object[] toArray() {
- return EMPTY_ARRAY;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java
deleted file mode 100644
index 7c9b4d5399..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A property value model for when you
- * don't need to support a value.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public class NullPropertyValueModel<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullPropertyValueModel() {
- super();
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T value() {
- return null;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java
deleted file mode 100644
index 4103536ebd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * A tree value model for when you
- * don't need to support any nodes.
- *
- * We don't use a singleton because we hold on to listeners.
- */
-public class NullTreeValueModel<E>
- extends AbstractModel
- implements TreeValueModel<E>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullTreeValueModel() {
- super();
- }
-
-
- // ********** TreeValueModel implementation **********
-
- public Iterator<E> nodes() {
- return EmptyIterator.instance();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ClassTools.shortClassNameForObject(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java
deleted file mode 100644
index 5ded8a5eb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This AspectAdapter provides basic PropertyChange support.
- * This allows us to convert a set of one or more properties into
- * a single property, VALUE.
- *
- * The typical subclass will override the following methods:
- * #buildValue_()
- * at the very minimum, override this method to return the value of the
- * subject's property (or "virtual" property); it does not need to be
- * overridden if #buildValue() is overridden and its behavior changed
- * #setValue_(Object)
- * override this method if the client code needs to *set* the value of
- * the subject's property; oftentimes, though, the client code (e.g. UI)
- * will need only to *get* the value; it does not need to be
- * overridden if #setValue(Object) is overridden and its behavior changed
- * #buildValue()
- * override this method only if returning a null value when the subject is null
- * is unacceptable
- * #setValue(Object)
- * override this method only if something must be done when the subject
- * is null (e.g. throw an exception)
- */
-public abstract class PropertyAspectAdapter<S extends Model, T>
- extends AspectAdapter<S>
- implements WritablePropertyValueModel<T>
-{
- /**
- * Cache the current value of the aspect so we
- * can pass an "old value" when we fire a property change event.
- * We need this because the value may be calculated and may
- * not be in the property change event fired by the subject,
- * especially when dealing with multiple aspects.
- */
- protected T value;
-
- /** The name of the subject's properties that we use for the value. */
- protected final String[] propertyNames;
- protected static final String[] EMPTY_PROPERTY_NAMES = new String[0];
-
- /** A listener that listens to the appropriate properties of the subject. */
- protected final PropertyChangeListener propertyChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject
- * and property.
- */
- protected PropertyAspectAdapter(String propertyName, S subject) {
- this(new String[] {propertyName}, subject);
- }
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject
- * and properties.
- */
- protected PropertyAspectAdapter(String[] propertyNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), propertyNames);
- }
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject holder
- * and properties.
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... propertyNames) {
- super(subjectHolder);
- this.propertyNames = propertyNames;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- // our value is null when we are not listening to the subject
- this.value = null;
- }
-
- /**
- * Construct a PropertyAspectAdapter for the specified subject holder
- * and properties.
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> propertyNames) {
- this(subjectHolder, propertyNames.toArray(new String[propertyNames.size()]));
- }
-
- /**
- * Construct a PropertyAspectAdapter for an "unchanging" property in
- * the specified subject. This is useful for a property aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new property. (A TransformationPropertyValueModel could also be
- * used in this situation.)
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_PROPERTY_NAMES);
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's property has changed, notify the listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyAspectAdapter.this.propertyChanged();
- }
- @Override
- public String toString() {
- return "property change listener: " + Arrays.asList(PropertyAspectAdapter.this.propertyNames);
- }
- };
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the value of the subject's property.
- */
- @Override
- public final T value() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- /**
- * Set the value of the subject's property.
- */
- public void setValue(T value) {
- if (this.subject != null) {
- this.setValue_(value);
- }
- }
-
- /**
- * Set the value of the subject's property.
- * At this point we can be sure that the subject is not null.
- * @see #setValue(Object)
- */
- protected void setValue_(T value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
- @Override
- protected void engageSubject() {
- super.engageSubject();
- // synch our value *after* we start listening to the subject,
- // since its value might change when a listener is added
- this.value = this.buildValue();
- }
-
- @Override
- protected void engageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).addPropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject() {
- super.disengageSubject();
- // clear out our value when we are not listening to the subject
- this.value = null;
- }
-
- @Override
- protected void disengageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).removePropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.propertyNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.propertyNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Return the aspect's value.
- * At this point the subject may be null.
- */
- protected T buildValue() {
- return (this.subject == null) ? null : this.buildValue_();
- }
-
- /**
- * Return the value of the subject's property.
- * At this point we can be sure that the subject is not null.
- * @see #buildValue()
- */
- protected T buildValue_() {
- throw new UnsupportedOperationException();
- }
-
- protected void propertyChanged() {
- T old = this.value;
- this.value = this.buildValue();
- this.fireAspectChange(old, this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java
deleted file mode 100644
index 5b93ca1c2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * An adapter that allows us to make a PropertyValueModel behave like
- * a read-only, single-element CollectionValueModel, sorta.
- *
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a collection with a null element).
- */
-public class PropertyCollectionValueModelAdapter<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends E> valueHolder;
-
- /** A listener that forwards any events fired by the value holder. */
- protected final PropertyChangeListener propertyChangeListener;
-
- /** Cache the value. */
- protected E value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Wrap the specified ListValueModel.
- */
- public PropertyCollectionValueModelAdapter(PropertyValueModel<? extends E> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- // postpone building the value and listening to the underlying value
- // until we have listeners ourselves...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyCollectionValueModelAdapter.this.valueChanged((E) event.newValue());
- }
- @Override
- public String toString() {
- return "property change listener";
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return (this.value == null) ?
- EmptyIterator.<E>instance()
- :
- new SingleElementIterator<E>(this.value);
- }
-
- public int size() {
- return (this.value == null) ? 0 : 1;
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(CollectionChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(listener);
- }
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(CollectionChangeListener listener) {
- super.removeCollectionChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName == VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- protected void engageModel() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // synch our value *after* we start listening to the value holder,
- // since its value might change when a listener is added
- this.value = this.valueHolder.value();
- }
-
- protected void disengageModel() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // clear out the value when we are not listening to the value holder
- this.value = null;
- }
-
- /**
- * synchronize our internal value with the wrapped value
- * and fire the appropriate events
- */
- protected void valueChanged(E newValue) {
- // put in "empty" check so we don't fire events unnecessarily
- if (this.value != null) {
- E oldValue = this.value;
- this.value = null;
- this.fireItemRemoved(VALUES, oldValue);
- }
- this.value = newValue;
- // put in "empty" check so we don't fire events unnecessarily
- if (this.value != null) {
- this.fireItemAdded(VALUES, this.value);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java
deleted file mode 100644
index 51eb48e9af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * An adapter that allows us to make a PropertyValueModel behave like
- * a read-only, single-element ListValueModel, sorta.
- *
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a list with a null element).
- */
-public class PropertyListValueModelAdapter<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
-
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends E> valueHolder;
-
- /** A listener that forwards any events fired by the value holder. */
- protected final PropertyChangeListener propertyChangeListener;
-
- /** Cache the value. */
- protected E value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Wrap the specified property value model.
- */
- public PropertyListValueModelAdapter(PropertyValueModel<? extends E> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- // postpone building the value and listening to the underlying value
- // until we have listeners ourselves...
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyListValueModelAdapter.this.valueChanged((E) event.newValue());
- }
- @Override
- public String toString() {
- return "property change listener";
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return (this.value == null) ?
- EmptyListIterator.<E>instance()
- :
- new SingleElementListIterator<E>(this.value);
- }
-
- public int size() {
- return (this.value == null) ? 0 : 1;
- }
-
- public E get(int index) {
- if (this.value == null) {
- throw this.ioobe(index, 0);
- }
- if (index > 0) {
- throw this.ioobe(index, 1);
- }
- return this.value;
- }
-
- protected static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public Object[] toArray() {
- return (this.value == null) ? EMPTY_OBJECT_ARRAY : new Object[] {this.value};
- }
-
-
- // ********** extend change support **********
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addListChangeListener(ListChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listener);
- }
-
- /**
- * Override to start listening to the value holder if necessary.
- */
- @Override
- public void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeListChangeListener(ListChangeListener listener) {
- super.removeListChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Override to stop listening to the value holder if appropriate.
- */
- @Override
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName == LIST_VALUES && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
-
- // ********** behavior **********
-
- protected IndexOutOfBoundsException ioobe(int index, int size) {
- return new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
- }
-
- protected void engageModel() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // synch our value *after* we start listening to the value holder,
- // since its value might change when a listener is added
- this.value = this.valueHolder.value();
- }
-
- protected void disengageModel() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // clear out the value when we are not listening to the value holder
- this.value = null;
- }
-
- /**
- * synchronize our internal value with the wrapped value
- * and fire the appropriate events
- */
- protected void valueChanged(E newValue) {
- E oldValue = this.value;
- this.value = newValue;
- if (oldValue == null) {
- this.fireItemAdded(LIST_VALUES, 0, newValue);
- } else {
- if (newValue == null) {
- this.fireItemRemoved(LIST_VALUES, 0, oldValue);
- } else {
- this.fireItemReplaced(LIST_VALUES, 0, newValue, oldValue);
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java
deleted file mode 100644
index 0a4e550978..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another property value model, "lazily" listen to it, and propagate
- * its change notifications.
- */
-public abstract class PropertyValueModelWrapper<T>
- extends AbstractModel
-{
-
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends T> valueHolder;
-
- /** A listener that allows us to synch with changes to the wrapped value holder. */
- protected final PropertyChangeListener valueChangeListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * property value model. The value holder is required.
- */
- protected PropertyValueModelWrapper(PropertyValueModel<? extends T> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.valueChangeListener = this.buildValueChangeListener();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, PropertyValueModel.VALUE);
- }
-
- protected PropertyChangeListener buildValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyValueModelWrapper.this.valueChanged(event);
- }
- @Override
- public String toString() {
- return "value change listener";
- }
- };
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
- if (this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.engageValueHolder();
- }
- super.addPropertyChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the nested model if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (propertyName == PropertyValueModel.VALUE && this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.engageValueHolder();
- }
- super.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
- super.removePropertyChangeListener(listener);
- if (this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.disengageValueHolder();
- }
- }
-
- /**
- * Extend to stop listening to the nested model if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- super.removePropertyChangeListener(propertyName, listener);
- if (propertyName == PropertyValueModel.VALUE && this.hasNoPropertyChangeListeners(PropertyValueModel.VALUE)) {
- this.disengageValueHolder();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Begin listening to the value holder.
- */
- protected void engageValueHolder() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
- /**
- * Stop listening to the value holder.
- */
- protected void disengageValueHolder() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.valueHolder);
- }
-
-
- // ********** property change support **********
-
- /**
- * The value of the wrapped value holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void valueChanged(PropertyChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
deleted file mode 100644
index aa242621c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * Implementation of CollectionValueModel and Collection that simply holds a
- * collection and notifies listeners of any changes.
- */
-public class SimpleCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>, Collection<E>
-{
- /** The collection. */
- protected Collection<E> collection;
-
-
- // ********** constructors **********
-
- /**
- * Construct a CollectionValueModel for the specified collection.
- */
- public SimpleCollectionValueModel(Collection<E> collection) {
- super();
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- }
-
- /**
- * Construct a CollectionValueModel with an empty initial collection.
- */
- public SimpleCollectionValueModel() {
- this(new HashBag<E>());
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new LocalIterator<E>(this.collection.iterator());
- }
-
- public int size() {
- return this.collection.size();
- }
-
-
- // ********** Collection implementation **********
-
- public boolean isEmpty() {
- return this.collection.isEmpty();
- }
-
- public boolean contains(Object o) {
- return this.collection.contains(o);
- }
-
- public Object[] toArray() {
- return this.collection.toArray();
- }
-
- public <T extends Object> T[] toArray(T[] a) {
- return this.collection.toArray(a);
- }
-
- public boolean add(E o) {
- return this.addItemToCollection(o, this.collection, VALUES);
- }
-
- public boolean remove(Object o) {
- return this.removeItemFromCollection(o, this.collection, VALUES);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.collection.containsAll(c);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.addItemsToCollection(c, this.collection, VALUES);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.removeItemsFromCollection(c, this.collection, VALUES);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.retainItemsInCollection(c, this.collection, VALUES);
- }
-
- public void clear() {
- this.clearCollection(this.collection, VALUES);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ((o instanceof Collection) && (o instanceof CollectionValueModel)) {
- Collection<E> c1 = CollectionTools.collection(this.collection);
- @SuppressWarnings("unchecked")
- Collection<E> c2 = CollectionTools.collection(((Collection<E>) o).iterator());
- return c1.equals(c2);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return CollectionTools.collection(this.collection).hashCode();
- }
-
-
- // ********** additional behavior **********
-
- /**
- * Allow the collection to be replaced.
- */
- public void setCollection(Collection<E> collection) {
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- this.fireCollectionChanged(VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collection);
- }
-
-
- // ********** iterator **********
-
- private class LocalIterator<T> implements Iterator<T> {
- private final Iterator<T> iterator;
- private T next;
-
- LocalIterator(Iterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- return this.next = this.iterator.next();
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleCollectionValueModel.this.fireItemRemoved(VALUES, this.next);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java
deleted file mode 100644
index 7fafe63f2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Implementation of ListValueModel and List that simply holds a
- * collection and notifies listeners of any changes.
- */
-public class SimpleListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>, List<E>
-{
- /** The list. */
- protected List<E> list;
-
-
- // ********** constructors **********
-
- /**
- * Construct a ListValueModel for the specified list.
- */
- public SimpleListValueModel(List<E> list) {
- super();
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- }
-
- /**
- * Construct a ListValueModel with an empty initial list.
- */
- public SimpleListValueModel() {
- this(new ArrayList<E>());
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new LocalIterator<E>(this.list.iterator());
- }
-
- public ListIterator<E> listIterator() {
- return new LocalListIterator<E>(this.list.listIterator());
- }
-
- public int size() {
- return this.list.size();
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
-
- // ********** List implementation **********
-
- public boolean isEmpty() {
- return this.list.isEmpty();
- }
-
- public boolean contains(Object o) {
- return this.list.contains(o);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
- public <T extends Object> T[] toArray(T[] a) {
- return this.list.toArray(a);
- }
-
- public boolean add(E o) {
- return this.addItemToList(o, this.list, LIST_VALUES);
- }
-
- public boolean remove(Object o) {
- return this.removeItemFromList(o, this.list, LIST_VALUES);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.list.containsAll(c);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.addItemsToList(c, this.list, LIST_VALUES);
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return this.addItemsToList(index, c, this.list, LIST_VALUES);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.removeItemsFromList(c, this.list, LIST_VALUES);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.retainItemsInList(c, this.list, LIST_VALUES);
- }
-
- public void clear() {
- this.clearList(this.list, LIST_VALUES);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ((o instanceof List) && (o instanceof ListValueModel)) {
- List<E> l1 = CollectionTools.list(this.list);
- @SuppressWarnings("unchecked")
- List<E> l2 = CollectionTools.list(((List<E>) o).iterator());
- return l1.equals(l2);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return this.list.hashCode();
- }
-
- public E set(int index, E element) {
- return this.setItemInList(index, element, this.list, LIST_VALUES);
- }
-
- public void add(int index, E element) {
- this.addItemToList(index, element, this.list, LIST_VALUES);
- }
-
- public E remove(int index) {
- return this.removeItemFromList(index, this.list, LIST_VALUES);
- }
-
- public int indexOf(Object o) {
- return this.list.indexOf(o);
- }
-
- public int lastIndexOf(Object o) {
- return this.list.lastIndexOf(o);
- }
-
- public ListIterator<E> listIterator(int index) {
- return new LocalListIterator<E>(this.list.listIterator(index));
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- // TODO hmmm ~bjv
- throw new UnsupportedOperationException();
- }
-
-
- // ********** additional behavior **********
-
- /**
- * Allow the list to be replaced.
- */
- public void setList(List<E> list) {
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- this.fireListChanged(LIST_VALUES);
- }
-
- /**
- * Move a single element.
- */
- public void move(int targetIndex, int sourceIndex) {
- this.moveItemInList(targetIndex, sourceIndex, this.list, LIST_VALUES);
- }
-
- /**
- * Move a sub-list of elements.
- */
- public void move(int targetIndex, int sourceIndex, int length) {
- this.moveItemsInList(targetIndex, sourceIndex, length, this.list, LIST_VALUES);
- }
-
- /**
- * Remove a range of elements.
- */
- public void remove(int index, int length) {
- this.removeItemsFromList(index, length, this.list, LIST_VALUES);
- }
-
- /**
- * Set a range of elements.
- */
- public void set(int index, List<E> elements) {
- this.setItemsInList(index, elements, this.list, LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.list);
- }
-
-
- // ********** iterators **********
-
- private class LocalIterator<T> implements Iterator<T> {
- private final Iterator<T> iterator;
- private int index = -1;
- private T next;
-
- LocalIterator(Iterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- this.next = this.iterator.next();
- this.index++;
- return this.next;
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleListValueModel.this.fireItemRemoved(LIST_VALUES, this.index, this.next);
- }
-
- }
-
- private class LocalListIterator<T> implements ListIterator<T> {
- private final ListIterator<T> iterator;
- private int last = -1;
- private int next = 0;
- private T current;
-
- LocalListIterator(ListIterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- this.current = this.iterator.next();
- this.last = this.next++;
- return this.current;
- }
-
- public int nextIndex() {
- return this.iterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- return this.iterator.hasPrevious();
- }
-
- public T previous() {
- this.current = this.iterator.previous();
- this.last = --this.next;
- return this.current;
- }
-
- public int previousIndex() {
- return this.iterator.previousIndex();
- }
-
- @SuppressWarnings("synthetic-access")
- public void set(T o) {
- this.iterator.set(o);
- SimpleListValueModel.this.fireItemReplaced(LIST_VALUES, this.last, o, this.current);
- }
-
- @SuppressWarnings("synthetic-access")
- public void add(T o) {
- this.iterator.add(o);
- SimpleListValueModel.this.fireItemAdded(LIST_VALUES, this.next, o);
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleListValueModel.this.fireItemRemoved(LIST_VALUES, this.last, this.current);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java
deleted file mode 100644
index c2dcbf8381..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Implementation of WritablePropertyValueModel that simply holds on to an
- * object and uses it as the value.
- */
-public class SimplePropertyValueModel<T>
- extends AbstractModel
- implements WritablePropertyValueModel<T>
-{
- /** The value. */
- protected T value;
-
-
- /**
- * Construct a PropertyValueModel for the specified value.
- */
- public SimplePropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
- /**
- * Construct a PropertyValueModel with a starting value of null.
- */
- public SimplePropertyValueModel() {
- this(null);
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, VALUE);
- }
-
-
- public T value() {
- return this.value;
- }
-
- public void setValue(T value) {
- T old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE, old, value);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java
deleted file mode 100644
index b912b9a207..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a <code>CollectionValueModel</code>
- * (or <code>ListValueModel</code>) behave like a <code>ListValueModel</code>
- * that keeps its contents sorted and notifies listeners appropriately.
- * <p>
- * The comparator can be changed at any time; allowing the same
- * adapter to be used with different sort criteria (e.g. when the user
- * wants to sort a list of files first by name, then by date, then by size).
- * <p>
- * NB: Since we only listen to the wrapped collection when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * collection while we are listening to it, results to various methods
- * (e.g. <code>#size()</code>, <code>#getItem(int)</code>) will be
- * unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- */
-public class SortedListValueModelAdapter<E>
- extends CollectionListValueModelAdapter<E>
-{
- /**
- * A comparator used for sorting the elements;
- * if it is null, we use "natural ordering".
- */
- protected Comparator<E> comparator;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified collection value model and sort its contents
- * using the specified comparator.
- */
- public SortedListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder, Comparator<E> comparator) {
- super(collectionHolder);
- this.comparator = comparator;
- }
-
- /**
- * Wrap the specified collection value model and sort its contents
- * based on the elements' "natural ordering".
- */
- public SortedListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- this(collectionHolder, null);
- }
-
- /**
- * Wrap the specified list value model and sort its contents
- * using the specified comparator.
- */
- public SortedListValueModelAdapter(ListValueModel<? extends E> listHolder, Comparator<E> comparator) {
- this(new ListCollectionValueModelAdapter<E>(listHolder), comparator);
- }
-
- /**
- * Wrap the specified list value model and sort its contents
- * based on the elements' "natural ordering".
- */
- public SortedListValueModelAdapter(ListValueModel<? extends E> listHolder) {
- this(listHolder, null);
- }
-
-
- // ********** accessors **********
-
- public void setComparator(Comparator<E> comparator) {
- this.comparator = comparator;
- this.sortList();
- }
-
-
- // ********** behavior **********
-
- /**
- * Sort the internal list before
- * sending out change notification.
- */
- @Override
- protected void postBuildList() {
- super.postBuildList();
- Collections.sort(this.list, this.comparator);
- }
-
- /**
- * the list will need to be sorted after the item is added
- */
- @Override
- protected void itemsAdded(CollectionChangeEvent event) {
- // first add the items and notify our listeners...
- super.itemsAdded(event);
- // ...then sort the list
- this.sortList();
- }
-
- /**
- * sort the list and notify our listeners, if necessary;
- */
- protected void sortList() {
- // save the unsorted state of the sorted list so we can minimize the number of "replaced" items
- @SuppressWarnings("unchecked")
- ArrayList<E> unsortedList = (ArrayList<E>) this.list.clone();
- Collections.sort(this.list, this.comparator);
- Range diffRange = CollectionTools.identityDiffRange(unsortedList, this.list);
- if (diffRange.size > 0) {
- List<E> unsortedItems = unsortedList.subList(diffRange.start, diffRange.end + 1);
- List<E> sortedItems = this.list.subList(diffRange.start, diffRange.end + 1);
- this.fireItemsReplaced(LIST_VALUES, diffRange.start, sortedItems, unsortedItems);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java
deleted file mode 100644
index db6c0c916f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a model, "lazily" listen to it, and convert
- * its state change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current model
- *
- * Subclasses might want to override:
- * - #stateChanged(StateChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class StatePropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<T>
-{
- /** The wrapped model. */
- protected final Model model;
-
- /** A listener that allows us to synch with changes to the wrapped model. */
- protected final StateChangeListener stateChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped model.
- */
- protected StatePropertyValueModelAdapter(Model model) {
- super();
- this.model = model;
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
- protected StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- StatePropertyValueModelAdapter.this.stateChanged(event);
- }
- @Override
- public String toString() {
- return "state change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model.
- */
- @Override
- protected void engageModel_() {
- this.model.addStateChangeListener(this.stateChangeListener);
- }
-
- /**
- * Stop listening to the model.
- */
- @Override
- protected void disengageModel_() {
- this.model.removeStateChangeListener(this.stateChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.model);
- }
-
-
- // ********** state change support **********
-
- /**
- * The model's state changed;
- * propagate the change notification appropriately.
- */
- protected void stateChanged(StateChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java
deleted file mode 100644
index 1dba4c3b74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * Implementation of CollectionValueModel that can be used for
- * returning an iterator on a static collection, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- /** The collection. */
- protected final Collection<? extends E> collection;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static CollectionValueModel for the specified collection.
- */
- public StaticCollectionValueModel(Collection<? extends E> collection) {
- super();
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- }
-
- // ********** CollectionValueModel implementation **********
-
- public int size() {
- return this.collection.size();
- }
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.collection.iterator());
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.collection);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java
deleted file mode 100644
index 584d4acd32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Implementation of ListValueModel that can be used for
- * returning a list iterator on a static list, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- /** The value. */
- protected final List<? extends E> list;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static ListValueModel for the specified list.
- */
- public StaticListValueModel(List<? extends E> list) {
- super();
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.list.iterator());
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.list.listIterator());
- }
-
- public int size() {
- return this.list.size();
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.list);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java
deleted file mode 100644
index 32d3ae51e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * Implementation of PropertyValueModel that can be used for
- * returning a static value, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticPropertyValueModel<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- /** The value. */
- protected final T value;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static PropertyValueModel for the specified value.
- */
- public StaticPropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T value() {
- return this.value;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java
deleted file mode 100644
index 9929535e20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * Implementation of TreeValueModel that can be used for
- * returning an iterator on a static tree, but still allows listeners to be added.
- * Listeners will NEVER be notified of any changes, because there should be none.
- */
-public class StaticTreeValueModel<E>
- extends AbstractModel
- implements TreeValueModel<E>
-{
- /** The tree's nodes. */
- protected final Iterable<? extends E> nodes;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a read-only TreeValueModel for the specified nodes.
- */
- public StaticTreeValueModel(Iterable<? extends E> nodes) {
- super();
- if (nodes == null) {
- throw new NullPointerException();
- }
- this.nodes = nodes;
- }
-
- // ********** TreeValueModel implementation **********
-
- public Iterator<E> nodes() {
- return new ReadOnlyIterator<E>(this.nodes.iterator());
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, CollectionTools.collection(this.nodes()));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java
deleted file mode 100644
index f1ee2b1c76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to transform a ListValueModel
- * (or CollectionValueModel) into a read-only ListValueModel
- * whose items are tranformations of the items in the wrapped
- * ListValueModel. It will keep its contents in synch with
- * the contents of the wrapped ListValueModel and notifies its
- * listeners of any changes.
- * <p>
- * The transformer can be changed at any time; allowing the same
- * adapter to be used with different transformations.
- * <p>
- * NB: Since we only listen to the wrapped list when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * list while we are listening to it, results to various methods
- * (e.g. #size(), #getItem(int)) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- */
-public class TransformationListValueModelAdapter<E1, E2>
- extends ListValueModelWrapper<E1>
- implements ListValueModel<E2>
-{
-
- /** This transforms the items, unless the subclass overrides #transformItem(Object). */
- protected Transformer<E1, E2> transformer;
-
- /** The list of transformed items. */
- protected final List<E2> transformedList;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder is required.
- */
- public TransformationListValueModelAdapter(ListValueModel<? extends E1> listHolder, Transformer<E1, E2> transformer) {
- super(listHolder);
- this.transformer = transformer;
- this.transformedList = new ArrayList<E2>();
- }
-
- /**
- * Constructor - the list holder is required.
- */
- public TransformationListValueModelAdapter(ListValueModel<? extends E1> listHolder) {
- this(listHolder, Transformer.Null.<E1, E2>instance());
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public TransformationListValueModelAdapter(CollectionValueModel<? extends E1> collectionHolder, Transformer<E1, E2> transformer) {
- this(new CollectionListValueModelAdapter<E1>(collectionHolder), transformer);
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public TransformationListValueModelAdapter(CollectionValueModel<? extends E1> collectionHolder) {
- this(new CollectionListValueModelAdapter<E1>(collectionHolder));
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E2> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E2> listIterator() {
- return new ReadOnlyListIterator<E2>(this.transformedList);
- }
-
- public E2 get(int index) {
- return this.transformedList.get(index);
- }
-
- public int size() {
- return this.transformedList.size();
- }
-
- public Object[] toArray() {
- return this.transformedList.toArray();
- }
-
- // ********** behavior **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch the transformed list *after* we start listening to the list holder,
- // since its value might change when a listener is added
- this.transformedList.addAll(this.transformItems(this.listHolder));
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the list when we are not listening to the collection holder
- this.transformedList.clear();
- }
-
- /**
- * Transform the items associated with the specified event.
- */
- protected List<E2> transformItems(ListChangeEvent event) {
- return this.transformItems(this.items(event), event.itemsSize());
- }
-
- /**
- * Transform the items in the specified list value model.
- */
- protected List<E2> transformItems(ListValueModel<? extends E1> lvm) {
- return this.transformItems(lvm.listIterator(), lvm.size());
- }
-
- /**
- * Transform the replaced items associated with the specified event.
- */
- protected List<E2> transformReplacedItems(ListChangeEvent event) {
- return this.transformItems(this.replacedItems(event), event.itemsSize());
- }
-
- /**
- * Transform the specified items.
- */
- protected List<E2> transformItems(ListIterator<? extends E1> items, int size) {
- List<E2> result = new ArrayList<E2>(size);
- while (items.hasNext()) {
- result.add(this.transformItem(items.next()));
- }
- return result;
- }
-
- /**
- * Transform the specified item.
- */
- protected E2 transformItem(E1 item) {
- return this.transformer.transform(item);
- }
-
- /**
- * Change the transformer and rebuild the collection.
- */
- public void setTransformer(Transformer<E1, E2> transformer) {
- this.transformer = transformer;
- this.rebuildTransformedList();
- }
-
- /**
- * Synchronize our cache with the wrapped collection.
- */
- protected void rebuildTransformedList() {
- this.transformedList.clear();
- this.transformedList.addAll(this.transformItems(this.listHolder));
- this.fireListChanged(LIST_VALUES);
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder.
- * Transform them, add them to our transformation list,
- * and notify our listeners.
- */
- @Override
- protected void itemsAdded(ListChangeEvent event) {
- this.addItemsToList(event.index(), this.transformItems(event), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were removed from the wrapped list holder.
- * Remove the corresponding items from our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsRemoved(ListChangeEvent event) {
- this.removeItemsFromList(event.index(), event.itemsSize(), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were replaced in the wrapped list holder.
- * Replace the corresponding items in our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsReplaced(ListChangeEvent event) {
- this.setItemsInList(event.index(), this.transformItems(event), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were moved in the wrapped list holder.
- * Move the corresponding items in our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsMoved(ListChangeEvent event) {
- this.moveItemsInList(event.targetIndex(), event.sourceIndex(), event.moveLength(), this.transformedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list holder was cleared.
- * Clear our transformation list and notify our listeners.
- */
- @Override
- protected void listCleared(ListChangeEvent event) {
- this.clearList(this.transformedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list holder has changed in some dramatic fashion.
- * Rebuild our transformation list and notify our listeners.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.rebuildTransformedList();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
deleted file mode 100644
index 219d474b0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>TransformationPropertyValueModel</code> wraps another
- * <code>PropertyValueModel</code> and uses a <code>Transformer</code>
- * to transform the wrapped value before it is returned by <code>value()</code>.
- * <p>
- * As an alternative to building a <code>Transformer</code>,
- * a subclass of <code>TransformationPropertyValueModel</code> can
- * either override the <code>transform_(Object)</code> method or,
- * if something other than null should be returned when the wrapped value
- * is null, override the <code>transform(Object)</code> method.
- */
-public class TransformationPropertyValueModel<T1, T2>
- extends PropertyValueModelWrapper<T1>
- implements PropertyValueModel<T2>
-{
- protected final Transformer<T1, T2> transformer;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and the default transformer.
- * Use this constructor if you want to override the
- * <code>transform_(Object)</code> or <code>transform(Object)</code>
- * method instead of building a <code>Transformer</code>.
- */
- public TransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder) {
- super(valueHolder);
- this.transformer = this.buildTransformer();
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and transformer.
- */
- public TransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder, Transformer<T1, T2> transformer) {
- super(valueHolder);
- this.transformer = transformer;
- }
-
- protected Transformer<T1, T2> buildTransformer() {
- return new DefaultTransformer();
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T2 value() {
- // transform the object returned by the nested value model before returning it
- return this.transform(this.valueHolder.value());
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- // transform the values before propagating the change event
- @SuppressWarnings("unchecked")
- Object oldValue = this.transform((T1) event.oldValue());
- @SuppressWarnings("unchecked")
- Object newValue = this.transform((T1) event.newValue());
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
-
- // ********** behavior **********
-
- /**
- * Transform the specified value and return the result.
- * This is called by #value() and #valueChanged(PropertyChangeEvent).
- */
- protected T2 transform(T1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * Transform the specified, non-null, value and return the result.
- */
- protected T2 transform_(T1 value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** default transformer **********
-
- /**
- * The default transformer will return null if the wrapped value is null.
- * If the wrapped value is not null, it is transformed by a subclass
- * implementation of #transform_(Object).
- */
- protected class DefaultTransformer implements Transformer<T1, T2> {
- public T2 transform(T1 value) {
- return (value == null) ? null : TransformationPropertyValueModel.this.transform_(value);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
deleted file mode 100644
index aa5cc63c5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>TransformationWritablePropertyValueModel</code> wraps another
- * <code>WritablePropertyValueModel</code> and uses a <code>BidiTransformer</code>
- * to:<ul>
- * <li>transform the wrapped value before it is returned by <code>value()</code>
- * <li>"reverse-transform" the new value that comes in via
- * <code>setValue(Object)</code>
- * </ul>
- * As an alternative to building a <code>BidiTransformer</code>,
- * a subclass of <code>TransformationWritablePropertyValueModel</code> can
- * override the <code>transform_(Object)</code> and
- * <code>reverseTransform_(Object)</code> methods; or,
- * if something other than null should be returned when the wrapped value
- * is null or the new value is null, override the <code>transform(Object)</code>
- * and <code>reverseTransform(Object)</code> methods.
- */
-public class TransformationWritablePropertyValueModel<T1, T2>
- extends TransformationPropertyValueModel<T1, T2>
- implements WritablePropertyValueModel<T2>
-{
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and the default bidi transformer.
- * Use this constructor if you want to override the
- * <code>transform_(Object)</code> and <code>reverseTransform_(Object)</code>
- * (or <code>transform(Object)</code> and <code>reverseTransform(Object)</code>)
- * methods instead of building a <code>BidiTransformer</code>.
- */
- public TransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder) {
- super(valueHolder);
- }
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and bidi transformer.
- */
- public TransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder, BidiTransformer<T1, T2> transformer) {
- super(valueHolder, transformer);
- }
-
- @Override
- protected BidiTransformer<T1, T2> buildTransformer() {
- return new DefaultBidiTransformer();
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T2 value) {
- // "reverse-transform" the object before passing it to the the nested value model
- this.valueHolder().setValue(this.reverseTransform(value));
- }
-
-
- // ********** behavior **********
-
- /**
- * "Reverse-transform" the specified value and return the result.
- * This is called by #setValue(Object).
- */
- protected T1 reverseTransform(T2 value) {
- return this.transformer().reverseTransform(value);
- }
-
- /**
- * "Reverse-transform" the specified, non-null, value and return the result.
- */
- protected T1 reverseTransform_(T2 value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** queries **********
-
- /**
- * Our constructors accept only a WritablePropertyValueModel<T1>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T1> valueHolder() {
- return (WritablePropertyValueModel<T1>) this.valueHolder;
- }
-
- /**
- * Our constructors accept only a bidirectional transformer.
- */
- protected BidiTransformer<T1, T2> transformer() {
- return (BidiTransformer<T1, T2>) this.transformer;
- }
-
-
- // ********** default bidi transformer **********
-
- /**
- * The default bidi transformer will return null if the wrapped value is null.
- * If the wrapped value is not null, it is transformed by a subclass
- * implementation of #transform_(Object).
- * The default bidi transformer will also return null if the new value is null.
- * If the new value is not null, it is reverse-transformed by a subclass
- * implementation of #reverseTransform_(Object).
- */
- protected class DefaultBidiTransformer
- extends DefaultTransformer
- implements BidiTransformer<T1, T2>
- {
- public T1 reverseTransform(T2 value) {
- return (value == null) ? null : TransformationWritablePropertyValueModel.this.reverseTransform_(value);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java
deleted file mode 100644
index a2e6b9e5dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * This extension of PropertyAdapter provides TreeChange support.
- * This allows us to convert a set of one or more trees into
- * a single tree, NODES.
- *
- * The typical subclass will override the following methods:
- * #nodes_()
- * at the very minimum, override this method to return an iterator
- * on the subject's tree aspect; it does not need to be overridden if
- * #nodes() is overridden and its behavior changed
- * #nodes()
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- */
-public abstract class TreeAspectAdapter<S extends Model, E>
- extends AspectAdapter<S>
- implements TreeValueModel<E>
-{
- /**
- * The name of the subject's trees that we use for the value.
- */
- protected final String[] treeNames;
- protected static final String[] EMPTY_TREE_NAMES = new String[0];
-
- /** A listener that listens to the subject's tree aspect. */
- protected final TreeChangeListener treeChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a TreeAspectAdapter for the specified subject
- * and tree.
- */
- protected TreeAspectAdapter(String treeName, S subject) {
- this(new String[] {treeName}, subject);
- }
-
- /**
- * Construct a TreeAspectAdapter for the specified subject
- * and trees.
- */
- protected TreeAspectAdapter(String[] treeNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), treeNames);
- }
-
- /**
- * Construct a TreeAspectAdapter for the specified subject holder
- * and trees.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... treeNames) {
- super(subjectHolder);
- this.treeNames = treeNames;
- this.treeChangeListener = this.buildTreeChangeListener();
- }
-
- /**
- * Construct a TreeAspectAdapter for the specified subject holder
- * and trees.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> treeNames) {
- this(subjectHolder, treeNames.toArray(new String[treeNames.size()]));
- }
-
- /**
- * Construct a TreeAspectAdapter for an "unchanging" tree in
- * the specified subject. This is useful for a tree aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new tree.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_TREE_NAMES);
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's tree aspect has changed, notify the listeners.
- */
- protected TreeChangeListener buildTreeChangeListener() {
- // transform the subject's tree change events into VALUE tree change events
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- TreeAspectAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- TreeAspectAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeChangeEvent event) {
- TreeAspectAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- TreeAspectAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "tree change listener: " + Arrays.asList(TreeAspectAdapter.this.treeNames);
- }
- };
- }
-
-
- // ********** TreeValueModel implementation **********
-
- /**
- * Return the nodes of the subject's tree aspect.
- */
- public Iterator<E> nodes() {
- return (this.subject == null) ? EmptyIterator.<E>instance() : this.nodes_();
- }
-
- /**
- * Return the nodes of the subject's tree aspect.
- * At this point we can be sure that the subject is not null.
- * @see #nodes()
- */
- protected Iterator<E> nodes_() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object value() {
- return this.nodes();
- }
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return TreeChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return NODES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyTreeChangeListeners(NODES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireTreeChanged(NODES);
- }
-
- @Override
- protected void engageSubject_() {
- for (String treeName : this.treeNames) {
- ((Model) this.subject).addTreeChangeListener(treeName, this.treeChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String treeName : this.treeNames) {
- ((Model) this.subject).removeTreeChangeListener(treeName, this.treeChangeListener);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- for (int i = 0; i < this.treeNames.length; i++) {
- if (i != 0) {
- sb.append(", ");
- }
- sb.append(this.treeNames[i]);
- }
- }
-
-
- // ********** behavior **********
-
- protected void nodeAdded(TreeChangeEvent event) {
- this.fireNodeAdded(NODES, event.path());
- }
-
- protected void nodeRemoved(TreeChangeEvent event) {
- this.fireNodeRemoved(NODES, event.path());
- }
-
- protected void treeCleared(TreeChangeEvent event) {
- this.fireTreeCleared(NODES);
- }
-
- protected void treeChanged(TreeChangeEvent event) {
- this.fireTreeChanged(NODES, event.path());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java
deleted file mode 100644
index 11b6f1a2b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a tree value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- *
- * Subclasses must override:
- * - #buildValue()
- * to return the current property value, as derived from the
- * current collection value
- *
- * Subclasses might want to override:
- * - #stateChanged(StateChangeEvent event)
- * to improve performance (by not recalculating the value, if possible)
- */
-public abstract class TreePropertyValueModelAdapter<T>
- extends AspectPropertyValueModelAdapter<T>
-{
- /** The wrapped tree value model. */
- protected final TreeValueModel<?> treeHolder;
-
- /** A listener that allows us to synch with changes to the wrapped tree holder. */
- protected final TreeChangeListener treeChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * tree value model.
- */
- protected TreePropertyValueModelAdapter(TreeValueModel<?> treeHolder) {
- super();
- this.treeHolder = treeHolder;
- this.treeChangeListener = this.buildTreeChangeListener();
- }
-
- protected TreeChangeListener buildTreeChangeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "tree change listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the tree holder.
- */
- @Override
- protected void engageModel_() {
- this.treeHolder.addTreeChangeListener(this.treeChangeListener);
- }
-
- /**
- * Stop listening to the tree holder.
- */
- @Override
- protected void disengageModel_() {
- this.treeHolder.removeTreeChangeListener(this.treeChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.treeHolder);
- }
-
-
- // ********** state change support **********
-
- /**
- * Nodes were added to the wrapped tree holder;
- * propagate the change notification appropriately.
- */
- protected void nodeAdded(TreeChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Nodes were removed from the wrapped tree holder;
- * propagate the change notification appropriately.
- */
- protected void nodeRemoved(TreeChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped tree holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void treeCleared(TreeChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped tree holder changed;
- * propagate the change notification appropriately.
- */
- protected void treeChanged(TreeChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java
deleted file mode 100644
index ffd85f751a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Abstract model that provides behavior for wrapping a property
- * value model and listening for changes to aspects of the *value* contained
- * by the property value model. Changes to the actual value are also monitored.
- *
- * This is useful if you have a value that may change, but whose aspects can also
- * change in a fashion that might be of interest to the client.
- *
- * NB: Clients will need to listen for two different change notifications: a property
- * change event will be be fired when the value changes; a state change event
- * will be fired when an aspect of the value changes.
- *
- * Subclasses need to override two methods:
- *
- * #engageValue_()
- * begin listening to the appropriate aspect of the value and call
- * #valueAspectChanged(Object) whenever the aspect changes
- *
- * #disengageValue_()
- * stop listening to the appropriate aspect of the value
- */
-public abstract class ValueAspectAdapter<T>
- extends PropertyValueModelWrapper<T>
- implements WritablePropertyValueModel<T>
-{
- /** Cache the value so we can disengage. */
- protected T value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Constructor - the value holder is required.
- */
- protected ValueAspectAdapter(WritablePropertyValueModel<T> valueHolder) {
- super(valueHolder);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.value = null;
- }
-
- /**
- * Override to allow both property value model change and state change
- * listeners.
- */
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new ChangeSupport(this);
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T value() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- this.valueHolder().setValue(value);
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- this.disengageValue();
- this.engageValue();
- this.firePropertyChanged(event.cloneWithSource(this));
- }
-
-
- // ********** extend change support **********
-
- @Override
- public synchronized void addStateChangeListener(StateChangeListener listener) {
- if (this.hasNoStateChangeListeners()) {
- this.engageValue();
- }
- super.addStateChangeListener(listener);
- }
-
- @Override
- public synchronized void removeStateChangeListener(StateChangeListener listener) {
- super.removeStateChangeListener(listener);
- if (this.hasNoStateChangeListeners()) {
- this.disengageValue();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the current value.
- */
- protected void engageValue() {
- this.value = this.valueHolder.value();
- if (this.value != null) {
- this.engageValue_();
- }
- }
-
- /**
- * Start listening to the current value.
- * At this point we can be sure that the value is not null.
- */
- protected abstract void engageValue_();
-
- /**
- * Stop listening to the current value.
- */
- protected void disengageValue() {
- if (this.value != null) {
- this.disengageValue_();
- this.value = null;
- }
- }
-
- /**
- * Stop listening to the current value.
- * At this point we can be sure that the value is not null.
- */
- protected abstract void disengageValue_();
-
- /**
- * Subclasses should call this method whenever the value's aspect changes.
- */
- protected void valueAspectChanged() {
- this.fireStateChanged();
- }
-
- /**
- * Our constructors accept only a WritablePropertyValueModel<T1>.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> valueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java
deleted file mode 100644
index 2cdb74ea34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more collection
- * aspects of the value in the wrapped value model.
- */
-public class ValueCollectionAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
-
- /** The names of the value's collections that we listen to. */
- protected final String[] collectionNames;
-
- /** Listener that listens to the value. */
- protected final CollectionChangeListener valueCollectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value collections.
- */
- public ValueCollectionAdapter(WritablePropertyValueModel<T> valueHolder, String... collectionNames) {
- super(valueHolder);
- this.collectionNames = collectionNames;
- this.valueCollectionListener = this.buildValueCollectionListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a Collection aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected CollectionChangeListener buildValueCollectionListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void collectionCleared(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value collection listener: " + Arrays.asList(ValueCollectionAdapter.this.collectionNames);
- }
- };
- }
-
- @Override
- protected void engageValue_() {
- for (String collectionName : this.collectionNames) {
- this.value.addCollectionChangeListener(collectionName, this.valueCollectionListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String collectionName : this.collectionNames) {
- this.value.removeCollectionChangeListener(collectionName, this.valueCollectionListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java
deleted file mode 100644
index 224d100319..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more list
- * aspects of the value in the wrapped value model.
- */
-public class ValueListAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
-
- /** The names of the value's lists that we listen to. */
- protected final String[] listNames;
-
- /** Listener that listens to the value. */
- protected final ListChangeListener valueListListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value lists.
- */
- public ValueListAdapter(WritablePropertyValueModel<T> valueHolder, String... listNames) {
- super(valueHolder);
- this.listNames = listNames;
- this.valueListListener = this.buildValueListListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a List aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected ListChangeListener buildValueListListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsRemoved(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsReplaced(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void itemsMoved(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void listCleared(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- public void listChanged(ListChangeEvent event) {
- ValueListAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value list listener: " + Arrays.asList(ValueListAdapter.this.listNames);
- }
- };
- }
-
- @Override
- protected void engageValue_() {
- for (String listName : this.listNames) {
- this.value.addListChangeListener(listName, this.valueListListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String listName : this.listNames) {
- this.value.removeListChangeListener(listName, this.valueListListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
deleted file mode 100644
index 0c40e891cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more
- * properties of the value in the wrapped value model.
- */
-public class ValuePropertyAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** The names of the value's properties that we listen to. */
- protected final String[] propertyNames;
-
- /** Listener that listens to the value. */
- protected final PropertyChangeListener valuePropertyListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value properties.
- */
- public ValuePropertyAdapter(WritablePropertyValueModel<T> valueHolder, String... propertyNames) {
- super(valueHolder);
- this.propertyNames = propertyNames;
- this.valuePropertyListener = this.buildValuePropertyListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValuePropertyListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ValuePropertyAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value property listener: " + Arrays.asList(ValuePropertyAdapter.this.propertyNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageValue_() {
- for (String propertyName : this.propertyNames) {
- this.value.addPropertyChangeListener(propertyName, this.valuePropertyListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String propertyName : this.propertyNames) {
- this.value.removePropertyChangeListener(propertyName, this.valuePropertyListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
deleted file mode 100644
index d516fdbf1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to the
- * "state" of the value in the wrapped value model.
- */
-public class ValueStateAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** Listener that listens to value. */
- protected final StateChangeListener valueStateListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the value state.
- */
- public ValueStateAdapter(WritablePropertyValueModel<T> valueHolder) {
- super(valueHolder);
- this.valueStateListener = this.buildValueStateListener();
- }
-
-
- // ********** initialization **********
-
- protected StateChangeListener buildValueStateListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ValueStateAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value state listener";
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageValue_() {
- this.value.addStateChangeListener(this.valueStateListener);
- }
-
- @Override
- protected void disengageValue_() {
- this.value.removeStateChangeListener(this.valueStateListener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java
deleted file mode 100644
index b1c9c53f54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend ValueAspectAdapter to listen to one or more
- * tree aspects of the value in the wrapped value model.
- */
-public class ValueTreeAdapter<T extends Model>
- extends ValueAspectAdapter<T>
-{
- /** The names of the value's trees that we listen to. */
- protected final String[] treeNames;
-
- /** Listener that listens to the value. */
- protected final TreeChangeListener valueTreeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value trees.
- */
- public ValueTreeAdapter(WritablePropertyValueModel<T> valueHolder, String... treeNames) {
- super(valueHolder);
- this.treeNames = treeNames;
- this.valueTreeListener = this.buildValueTreeListener();
- }
-
-
- // ********** initialization **********
-
- protected TreeChangeListener buildValueTreeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void nodeRemoved(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void treeCleared(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- public void treeChanged(TreeChangeEvent event) {
- ValueTreeAdapter.this.valueAspectChanged();
- }
- @Override
- public String toString() {
- return "value tree listener: " + Arrays.asList(ValueTreeAdapter.this.treeNames);
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageValue_() {
- for (String treeName : this.treeNames) {
- this.value.addTreeChangeListener(treeName, this.valueTreeListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String treeName : this.treeNames) {
- this.value.removeTreeChangeListener(treeName, this.valueTreeListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
deleted file mode 100644
index 568e2308a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.prefs;
-
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.BidiStringConverter;
-import org.eclipse.jpt.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This adapter wraps a Preference and converts it into a PropertyValueModel.
- * It listens for the appropriate "preference" changes and converts them into
- * VALUE property changes. It also allows the specification of a default value
- * for the Preference, which, by default, is null (and is probably *not* a very
- * good default).
- *
- * You can configure whether the preference's value is returned,
- * unchanged, as a string or as some other object (e.g. an Integer) by
- * setting the adapter's converter. Internally, the preference's value
- * is stored as the converted object; and the conversions take place
- * when reading or writing from the preferences node or retrieving the
- * value from an event fired by the preferences node.
- *
- * This adapter is a bit different from most other adapters because the
- * change events fired off by a Preferences node are asynchronous from
- * the change itself. (AbstractPreferences uses an event dispatch daemon.)
- * As a result, a client can set our value with #setValue(Object) and we
- * will return from that method before we ever receive notification from
- * the Preferences node that *it* has changed. This means we cannot
- * rely on that event to keep our internally cached value in synch.
- */
-public class PreferencePropertyValueModel<P>
- extends AspectAdapter<Preferences>
- implements WritablePropertyValueModel<P>
-{
- /** The key to the preference we use for the value. */
- protected final String key;
-
- /**
- * Cache the current (object) value of the preference so we
- * can pass an "old value" when we fire a property change event.
- */
- protected P value;
-
- /**
- * The default (object) value returned if there is no value
- * associated with the preference.
- */
- protected final P defaultValue;
-
- /**
- * This converter is used to convert the preference's
- * string value to and from an object.
- */
- protected final BidiStringConverter<P> converter;
-
- /** A listener that listens to the appropriate preference. */
- protected final PreferenceChangeListener preferenceChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified preference.
- * The default value of the preference will be null.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key) {
- this(preferences, key, null);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key, P defaultValue) {
- this(preferences, key, defaultValue, BidiStringConverter.Default.<P>instance());
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key, P defaultValue, BidiStringConverter<P> converter) {
- this(new StaticPropertyValueModel<Preferences>(preferences), key, defaultValue, converter);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public static PreferencePropertyValueModel<Boolean> forBoolean(Preferences preferences, String key, boolean defaultValue) {
- return new PreferencePropertyValueModel<Boolean>(
- preferences,
- key,
- defaultValue ? Boolean.TRUE : Boolean.FALSE,
- BidiStringConverter.BooleanConverter.instance()
- );
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public static PreferencePropertyValueModel<Integer> forInteger(Preferences preferences, String key, int defaultValue) {
- return new PreferencePropertyValueModel<Integer>(
- preferences,
- key,
- new Integer(defaultValue),
- BidiStringConverter.IntegerConverter.instance()
- );
- }
-
- /**
- * Construct an adapter for the specified preference.
- * The default value of the preference will be null.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key) {
- this(preferencesHolder, key, null);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key, P defaultValue) {
- this(preferencesHolder, key, defaultValue, BidiStringConverter.Default.<P>instance());
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key, P defaultValue, BidiStringConverter<P> converter) {
- super(preferencesHolder);
- this.key = key;
- this.defaultValue = defaultValue;
- this.converter = converter;
- this.preferenceChangeListener = this.buildPreferenceChangeListener();
- // our value is null when we are not listening to the preference
- this.value = null;
- }
-
-
- // ********** initialization **********
-
- /**
- * A preference has changed, notify the listeners if necessary.
- */
- protected PreferenceChangeListener buildPreferenceChangeListener() {
- // transform the preference change events into VALUE property change events
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent event) {
- PreferencePropertyValueModel.this.preferenceChanged(event.getKey(), event.getNewValue());
- }
- @Override
- public String toString() {
- return "preference change listener";
- }
- };
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * Return the cached (converted) value.
- */
- @Override
- public synchronized P value() {
- return this.value;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Set the cached value, then set the appropriate preference value.
- */
- public synchronized void setValue(P value) {
- if (this.hasNoListeners()) {
- return; // no changes allowed when we have no listeners
- }
-
- Object old = this.value;
- this.value = value;
- this.fireAspectChange(old, value);
-
- if ((this.subject != null) && this.shouldSetPreference(old, value)) {
- this.setValue_(value);
- }
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
- this.value = this.buildValue();
- }
-
- @Override
- protected void disengageSubject_() {
- try {
- this.subject.removePreferenceChangeListener(this.preferenceChangeListener);
- } catch (IllegalStateException ex) {
- // for some odd reason, we are not allowed to remove a listener from a "dead"
- // preferences node; so handle the exception that gets thrown here
- if ( ! ex.getMessage().equals("Node has been removed.")) {
- // if it is not the expected exception, re-throw it
- throw ex;
- }
- }
- this.value = null;
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.key);
- sb.append(" => ");
- sb.append(this.value);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the preference's key.
- */
- public String key() {
- return this.key;
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return the preference's value.
- * At this point the subject may be null.
- */
- protected P buildValue() {
- return (this.subject == null) ? null : this.buildValue_();
- }
-
- /**
- * Return the appropriate preference, converted to the appropriate object.
- * At this point we can be sure that the subject is not null.
- */
- protected P buildValue_() {
- return this.convertToObject(this.subject.get(this.key, this.convertToString(this.defaultValue)));
- }
-
- /**
- * Set the appropriate preference after converting the value to a string.
- * At this point we can be sure that the subject is not null.
- */
- protected void setValue_(P value) {
- this.subject.put(this.key, this.convertToString(value));
- }
-
- /**
- * Return whether the specified new value should be passed
- * through to the preference. By default, only if the value has changed,
- * will it be passed through to the preference. This also has the
- * effect of not creating new preferences in the "backing store"
- * if the new value is the same as the default value.
- *
- * Subclasses can override this method to return true if they
- * would like to ALWAYS pass through the new value to the preference.
- */
- protected boolean shouldSetPreference(Object oldValue, Object newValue) {
- return this.attributeValueHasChanged(oldValue, newValue);
- }
-
- /**
- * Convert the specified object to a string that can be stored as
- * the value of the preference.
- */
- protected String convertToString(P o) {
- return this.converter.convertToString(o);
- }
-
- /**
- * Convert the specified preference value string to an
- * appropriately-typed object to be returned to the client.
- */
- protected P convertToObject(String s) {
- return this.converter.convertToObject(s);
- }
-
- protected void preferenceChanged(String prefKey, String newValue) {
- if (prefKey.equals(this.key)) {
- this.preferenceChanged();
- }
- }
-
- /**
- * The underlying preference changed; either because we changed it
- * in #setValue_(Object) or a third-party changed it.
- * If this is called because of our own change, the event will be
- * swallowed because the old and new values are the same.
- */
- protected synchronized void preferenceChanged() {
- Object old = this.value;
- this.value = this.buildValue();
- this.fireAspectChange(old, this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java
deleted file mode 100644
index 3dcf45bc63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.prefs;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This adapter wraps a Preferences node and converts its preferences into a
- * CollectionValueModel of PreferencePropertyValueModels. It listens for
- * "preference" changes and converts them into VALUE collection changes.
- */
-public class PreferencesCollectionValueModel<P>
- extends AspectAdapter<Preferences>
- implements CollectionValueModel<PreferencePropertyValueModel<P>>
-{
-
- /** Cache the current preferences, stored in models and keyed by name. */
- protected final HashMap<String, PreferencePropertyValueModel<P>> preferences;
-
- /** A listener that listens to the preferences node for added or removed preferences. */
- protected final PreferenceChangeListener preferenceChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified preferences node.
- */
- public PreferencesCollectionValueModel(Preferences preferences) {
- this(new StaticPropertyValueModel<Preferences>(preferences));
- }
-
- /**
- * Construct an adapter for the specified preferences node.
- */
- public PreferencesCollectionValueModel(PropertyValueModel<? extends Preferences> preferencesHolder) {
- super(preferencesHolder);
- this.preferences = new HashMap<String, PreferencePropertyValueModel<P>>();
- this.preferenceChangeListener = this.buildPreferenceChangeListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * A preferences have changed, notify the listeners.
- */
- protected PreferenceChangeListener buildPreferenceChangeListener() {
- // transform the preference change events into VALUE collection change events
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent event) {
- PreferencesCollectionValueModel.this.preferenceChanged(event.getKey(), event.getNewValue());
- }
- @Override
- public String toString() {
- return "preference change listener";
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- /**
- * Return an iterator on the preference models.
- */
- public synchronized Iterator<PreferencePropertyValueModel<P>> iterator() {
- return this.preferences.values().iterator();
- }
-
- public synchronized int size() {
- return this.preferences.size();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object value() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends ChangeListener> listenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String listenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChange(Object oldValue, Object newValue) {
- this.fireCollectionChanged(VALUES);
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
- for (Iterator<PreferencePropertyValueModel<P>> stream = this.preferenceModels(); stream.hasNext(); ) {
- PreferencePropertyValueModel<P> preferenceModel = stream.next();
- this.preferences.put(preferenceModel.key(), preferenceModel);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- try {
- this.subject.removePreferenceChangeListener(this.preferenceChangeListener);
- } catch (IllegalStateException ex) {
- // for some odd reason, we are not allowed to remove a listener from a "dead"
- // preferences node; so handle the exception that gets thrown here
- if ( ! ex.getMessage().equals("Node has been removed.")) {
- // if it is not the expected exception, re-throw it
- throw ex;
- }
- }
- this.preferences.clear();
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.subject);
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return an iterator on the preference models.
- * At this point we can be sure that the subject is not null.
- */
- protected Iterator<PreferencePropertyValueModel<P>> preferenceModels() {
- String[] keys;
- try {
- keys = this.subject.keys();
- } catch (BackingStoreException ex) {
- throw new RuntimeException(ex);
- }
- return new TransformationIterator<String, PreferencePropertyValueModel<P>>(new ArrayIterator<String>(keys)) {
- @Override
- protected PreferencePropertyValueModel<P> transform(String key) {
- return PreferencesCollectionValueModel.this.buildPreferenceModel(key);
- }
- };
- }
-
- /**
- * Override this method to tweak the model used to wrap the
- * specified preference (e.g. to customize the model's converter).
- */
- protected PreferencePropertyValueModel<P> buildPreferenceModel(String key) {
- return new PreferencePropertyValueModel<P>(this.subjectHolder, key);
- }
-
- protected synchronized void preferenceChanged(String key, String newValue) {
- if (newValue == null) {
- // a preference was removed
- PreferencePropertyValueModel<P> preferenceModel = this.preferences.remove(key);
- this.fireItemRemoved(VALUES, preferenceModel);
- } else if ( ! this.preferences.containsKey(key)) {
- // a preference was added
- PreferencePropertyValueModel<P> preferenceModel = this.buildPreferenceModel(key);
- this.preferences.put(key, preferenceModel);
- this.fireItemAdded(VALUES, preferenceModel);
- } else {
- // a preference's value changed - do nothing
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java
deleted file mode 100644
index 0e464155f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.io.Serializable;
-
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-
-/**
- * Abstract class that should have been provided by the JDK
- * (à la javax.swing.AbstractListModel). This class provides:
- * - support for a collection of listeners
- * - a number of convenience methods for firing events for those listeners
- */
-public abstract class AbstractTreeModel
- implements TreeModel, Serializable
-{
- /** Our listeners. */
- protected final EventListenerList listenerList;
-
-
- // ********** constructors/initialization **********
-
- protected AbstractTreeModel() {
- super();
- this.listenerList = new EventListenerList();
- }
-
-
- // ********** partial TreeModel implementation **********
-
- public void addTreeModelListener(TreeModelListener l) {
- this.listenerList.add(TreeModelListener.class, l);
- }
-
- public void removeTreeModelListener(TreeModelListener l) {
- this.listenerList.remove(TreeModelListener.class, l);
- }
-
-
- // ********** queries **********
-
- /**
- * Return the model's current collection of listeners.
- * (There seems to be a pattern of making this type of method public;
- * although it should probably be protected....)
- */
- public TreeModelListener[] treeModelListeners() {
- return this.listenerList.getListeners(TreeModelListener.class);
- }
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoTreeModelListeners() {
- return this.listenerList.getListenerCount(TreeModelListener.class) == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasTreeModelListeners() {
- return ! this.hasNoTreeModelListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Notify listeners of a model change.
- * A significant property of the nodes changed, but the nodes themselves
- * are still the same objects.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesChanged(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesChanged(event);
- }
- }
- }
-
-
- /**
- * Notify listeners of a model change.
- * A significant property of the node changed, but the node itself is the same object.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeChanged(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesChanged(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * A significant property of the root changed, but the root itself is the same object.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeRootChanged(Object root) {
- this.fireTreeNodesChanged(new Object[] {root}, null, null);
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesInserted(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesInserted(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeInserted(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesInserted(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesRemoved(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesRemoved(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeRemoved(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesRemoved(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeStructureChanged(Object[] path) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path);
- }
- ((TreeModelListener) listeners[i+1]).treeStructureChanged(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeRootReplaced(Object newRoot) {
- this.fireTreeStructureChanged(new Object[] {newRoot});
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java
deleted file mode 100644
index 126cbfa561..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JCheckBox) in synch with a PropertyValueModel that
- * holds a boolean.
- *
- * Maybe not the richest class in our toolbox, but it was the
- * victim of refactoring.... ~bjv
- */
-public class CheckBoxModelAdapter
- extends ToggleButtonModelAdapter
-{
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder is required.
- */
- public CheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, boolean defaultValue) {
- super(booleanHolder, defaultValue);
- }
-
- /**
- * Constructor - the boolean holder is required.
- * The default value will be false.
- */
- public CheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- super(booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java
deleted file mode 100644
index 482b5d2468..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * This adapter is used by the table model adapter to
- * convert a model object into the models used for each of
- * the cells for the object's corresponding row in the table.
- */
-public interface ColumnAdapter {
- /**
- * Return the number of columns in the table.
- * Typically this is static.
- */
- int columnCount();
-
- /**
- * Return the name of the specified column.
- */
- String columnName(int index);
-
- /**
- * Return the class of the specified column.
- */
- Class<?> columnClass(int index);
-
- /**
- * Return whether the specified column is editable.
- * Typically this is the same for every row.
- */
- boolean columnIsEditable(int index);
-
- /**
- * Return the cell models for the specified subject
- * that corresponds to a single row in the table.
- */
- WritablePropertyValueModel<Object>[] cellModels(Object subject);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java
deleted file mode 100644
index 48387b57a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import javax.swing.ComboBoxModel;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ComboBoxModel can be used to keep a ListDataListener
- * (e.g. a JComboBox) in synch with a ListValueModel (or a CollectionValueModel).
- * For combo boxes, the model object that holds the current selection is
- * typically a different model object than the one that holds the collection
- * of choices.
- *
- * For example, a MWReference (the selectionOwner) has an attribute
- * "sourceTable" (the collectionOwner)
- * which holds on to a collection of MWDatabaseFields. When the selection
- * is changed this model will keep the listeners aware of the changes.
- * The inherited list model will keep its listeners aware of changes to the
- * collection model
- *
- * In addition to the collection holder required by the superclass,
- * an instance of this ComboBoxModel must be supplied with a
- * selection holder, which is a PropertyValueModel that provides access
- * to the selection (typically a PropertyAspectAdapter).
- */
-public class ComboBoxModelAdapter
- extends ListModelAdapter
- implements ComboBoxModel
-{
- protected final WritablePropertyValueModel<Object> selectionHolder;
- protected final PropertyChangeListener selectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder and selection holder are required;
- */
- public ComboBoxModelAdapter(ListValueModel<?> listHolder, WritablePropertyValueModel<Object> selectionHolder) {
- super(listHolder);
- if (selectionHolder == null) {
- throw new NullPointerException();
- }
- this.selectionHolder = selectionHolder;
- this.selectionListener = this.buildSelectionListener();
- }
-
- /**
- * Constructor - the collection holder and selection holder are required;
- */
- public ComboBoxModelAdapter(CollectionValueModel<?> collectionHolder, WritablePropertyValueModel<Object> selectionHolder) {
- super(collectionHolder);
- if (selectionHolder == null) {
- throw new NullPointerException();
- }
- this.selectionHolder = selectionHolder;
- this.selectionListener = this.buildSelectionListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildSelectionListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildSelectionListener_());
- }
-
- protected PropertyChangeListener buildSelectionListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- // notify listeners that the selection has changed
- ComboBoxModelAdapter.this.fireSelectionChanged();
- }
- @Override
- public String toString() {
- return "selection listener";
- }
- };
- }
-
-
- // ********** ComboBoxModel implementation **********
-
- public Object getSelectedItem() {
- return this.selectionHolder.value();
- }
-
- public void setSelectedItem(Object selectedItem) {
- this.selectionHolder.setValue(selectedItem);
- }
-
-
- // ********** behavior **********
-
- /**
- * Extend to engage the selection holder.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.selectionHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.selectionListener);
- }
-
- /**
- * Extend to disengage the selection holder.
- */
- @Override
- protected void disengageModel() {
- this.selectionHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.selectionListener);
- super.disengageModel();
- }
-
- /**
- * Notify the listeners that the selection has changed.
- */
- protected void fireSelectionChanged() {
- // I guess this will work...
- this.fireContentsChanged(this, -1, -1);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectionHolder + ":" + this.listHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java
deleted file mode 100644
index 4318fc6963..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.swing.SpinnerDateModel;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerDateModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a date.
- *
- * This class must be a sub-class of SpinnerDateModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see ListSpinnerModelAdapter
- * @see NumberSpinnerModelAdapter
- */
-public class DateSpinnerModelAdapter
- extends SpinnerDateModel
-{
-
- /**
- * The default spinner value; used when the underlying model date value is null.
- * The default is the current date.
- */
- private final Date defaultValue;
-
- /** A value model on the underlying date. */
- private final WritablePropertyValueModel<Object> dateHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying date. */
- private final PropertyChangeListener dateChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the date holder is required.
- * The default spinner value is the current date.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder) {
- this(dateHolder, new Date());
- }
-
- /**
- * Constructor - the date holder and default value are required.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Date defaultValue) {
- this(dateHolder, null, null, Calendar.DAY_OF_MONTH, defaultValue);
- }
-
- /**
- * Constructor - the date holder is required.
- * The default spinner value is the current date.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Comparable<?> start, Comparable<?> end, int calendarField) {
- this(dateHolder, start, end, calendarField, new Date());
- }
-
- /**
- * Constructor - the date holder is required.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Comparable<?> start, Comparable<?> end, int calendarField, Date defaultValue) {
- super(dateHolder.value() == null ? defaultValue : (Date) dateHolder.value(), start, end, calendarField);
- this.dateHolder = dateHolder;
- this.dateChangeListener = this.buildDateChangeListener();
- // postpone listening to the underlying date
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildDateChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildDateChangeListener_());
- }
-
- protected PropertyChangeListener buildDateChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DateSpinnerModelAdapter.this.synchronize(event.newValue());
- }
- @Override
- public String toString() {
- return "date listener";
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.dateHolder.value()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying date directly.
- * The resulting event will be ignored: @see #synchronize(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.dateHolder.setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying date if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.dateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.dateChangeListener);
- this.synchronize(this.dateHolder.value());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying date if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.dateHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.dateChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Date getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the spinner date has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.dateHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
deleted file mode 100644
index d701eb3489..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.io.Serializable;
-import java.util.EventObject;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.Element;
-import javax.swing.text.PlainDocument;
-import javax.swing.text.Position;
-import javax.swing.text.Segment;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.text.Document can be used to keep a DocumentListener
- * (e.g. a JTextField) in synch with a PropertyValueModel that holds a string.
- *
- * NB: This model should only be used for "small" documents;
- * i.e. documents used by text fields, not text panes.
- * @see #synchronizeDelegate(String)
- */
-public class DocumentAdapter
- implements Document, Serializable
-{
-
- /** The delegate document whose behavior we "enhance". */
- protected final Document delegate;
-
- /** A listener that allows us to forward any changes made to the delegate document. */
- protected final CombinedListener delegateListener;
-
- /** A value model on the underlying model string. */
- protected final WritablePropertyValueModel<String> stringHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying model string. */
- protected final PropertyChangeListener stringListener;
-
- /** The event listener list for the document. */
- protected final EventListenerList listenerList = new EventListenerList();
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the string holder is required.
- * Wrap the specified document.
- */
- public DocumentAdapter(WritablePropertyValueModel<String> stringHolder, Document delegate) {
- super();
- if (stringHolder == null || delegate == null) {
- throw new NullPointerException();
- }
- this.stringHolder = stringHolder;
- // postpone listening to the underlying model string
- // until we have listeners ourselves...
- this.delegate = delegate;
- this.stringListener = this.buildStringListener();
- this.delegateListener = this.buildDelegateListener();
- }
-
- /**
- * Constructor - the string holder is required.
- * Wrap a plain document.
- */
- public DocumentAdapter(WritablePropertyValueModel<String> stringHolder) {
- this(stringHolder, new PlainDocument());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildStringListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildStringListener_());
- }
-
- protected PropertyChangeListener buildStringListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DocumentAdapter.this.stringChanged(event);
- }
- @Override
- public String toString() {
- return "string listener";
- }
- };
- }
-
- protected CombinedListener buildDelegateListener() {
- return new InternalListener();
- }
-
-
- // ********** Document implementation **********
-
- public int getLength() {
- return this.delegate.getLength();
- }
-
- /**
- * Extend to start listening to the underlying models if necessary.
- */
- public void addDocumentListener(DocumentListener listener) {
- if (this.listenerList.getListenerCount(DocumentListener.class) == 0) {
- this.delegate.addDocumentListener(this.delegateListener);
- this.engageStringHolder();
- }
- this.listenerList.add(DocumentListener.class, listener);
- }
-
- /**
- * Extend to stop listening to the underlying models if appropriate.
- */
- public void removeDocumentListener(DocumentListener listener) {
- this.listenerList.remove(DocumentListener.class, listener);
- if (this.listenerList.getListenerCount(DocumentListener.class) == 0) {
- this.disengageStringHolder();
- this.delegate.removeDocumentListener(this.delegateListener);
- }
- }
-
- /**
- * Extend to start listening to the delegate document if necessary.
- */
- public void addUndoableEditListener(UndoableEditListener listener) {
- if (this.listenerList.getListenerCount(UndoableEditListener.class) == 0) {
- this.delegate.addUndoableEditListener(this.delegateListener);
- }
- this.listenerList.add(UndoableEditListener.class, listener);
- }
-
- /**
- * Extend to stop listening to the delegate document if appropriate.
- */
- public void removeUndoableEditListener(UndoableEditListener listener) {
- this.listenerList.remove(UndoableEditListener.class, listener);
- if (this.listenerList.getListenerCount(UndoableEditListener.class) == 0) {
- this.delegate.removeUndoableEditListener(this.delegateListener);
- }
- }
-
- public Object getProperty(Object key) {
- return this.delegate.getProperty(key);
- }
-
- public void putProperty(Object key, Object value) {
- this.delegate.putProperty(key, value);
- }
-
- /**
- * Extend to update the underlying model string directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(String).
- */
- public void remove(int offset, int len) throws BadLocationException {
- this.delegate.remove(offset, len);
- this.stringHolder.setValue(this.delegate.getText(0, this.delegate.getLength()));
- }
-
- /**
- * Extend to update the underlying model string directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(String).
- */
- public void insertString(int offset, String insertedString, AttributeSet a) throws BadLocationException {
- this.delegate.insertString(offset, insertedString, a);
- this.stringHolder.setValue(this.delegate.getText(0, this.delegate.getLength()));
- }
-
- public String getText(int offset, int length) throws BadLocationException {
- return this.delegate.getText(offset, length);
- }
-
- public void getText(int offset, int length, Segment txt) throws BadLocationException {
- this.delegate.getText(offset, length, txt);
- }
-
- public Position getStartPosition() {
- return this.delegate.getStartPosition();
- }
-
- public Position getEndPosition() {
- return this.delegate.getEndPosition();
- }
-
- public Position createPosition(int offs) throws BadLocationException {
- return this.delegate.createPosition(offs);
- }
-
- public Element[] getRootElements() {
- return this.delegate.getRootElements();
- }
-
- public Element getDefaultRootElement() {
- return this.delegate.getDefaultRootElement();
- }
-
- public void render(Runnable r) {
- this.delegate.render(r);
- }
-
-
- // ********** queries **********
-
- public DocumentListener[] documentListeners() {
- return this.listenerList.getListeners(DocumentListener.class);
- }
-
- public UndoableEditListener[] undoableEditListeners() {
- return this.listenerList.getListeners(UndoableEditListener.class);
- }
-
-
- // ********** behavior **********
-
- /**
- * A third party has modified the underlying model string.
- * Synchronize the delegate document accordingly.
- */
- protected void stringChanged(PropertyChangeEvent event) {
- this.synchronizeDelegate((String) event.newValue());
- }
-
- /**
- * Replace the document's entire text string with the new string.
- */
- protected void synchronizeDelegate(String s) {
- try {
- int len = this.delegate.getLength();
- // check to see whether the delegate has already been synchronized
- // (via #insertString() or #remove())
- if ( ! this.delegate.getText(0, len).equals(s)) {
- this.delegate.remove(0, len);
- this.delegate.insertString(0, s, null);
- }
- } catch (BadLocationException ex) {
- throw new IllegalStateException(ex.getMessage()); // this should not happen...
- }
- }
-
- protected void engageStringHolder() {
- this.stringHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.stringListener);
- this.synchronizeDelegate(this.stringHolder.value());
- }
-
- protected void disengageStringHolder() {
- this.stringHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.stringListener);
- }
-
- protected void delegateChangedUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].changedUpdate(ee);
- }
- }
-
- protected void delegateInsertUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].insertUpdate(ee);
- }
- }
-
- protected void delegateRemoveUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].removeUpdate(ee);
- }
- }
-
- protected void delegateUndoableEditHappened(UndoableEditEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- UndoableEditEvent ee = new UndoableEditEvent(this, event.getEdit());
- UndoableEditListener[] listeners = this.undoableEditListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].undoableEditHappened(ee);
- }
- }
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.stringHolder);
- }
-
-
-// ********** inner class **********
-
- protected interface CombinedListener extends DocumentListener, UndoableEditListener {
- // just consolidate the two interfaces
- }
-
- protected class InternalListener implements CombinedListener {
- public void changedUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateChangedUpdate(event);
- }
- public void insertUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateInsertUpdate(event);
- }
- public void removeUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateRemoveUpdate(event);
- }
- public void undoableEditHappened(UndoableEditEvent event) {
- DocumentAdapter.this.delegateUndoableEditHappened(event);
- }
- }
-
- protected static class InternalDocumentEvent
- extends EventObject
- implements DocumentEvent
- {
- protected DocumentEvent delegate;
-
- protected InternalDocumentEvent(Document document, DocumentEvent delegate) {
- super(document);
- this.delegate = delegate;
- }
- public ElementChange getChange(Element elem) {
- return this.delegate.getChange(elem);
- }
- public Document getDocument() {
- return (Document) this.source;
- }
- public int getLength() {
- return this.delegate.getLength();
- }
- public int getOffset() {
- return this.delegate.getOffset();
- }
- public EventType getType() {
- return this.delegate.getType();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java
deleted file mode 100644
index 9bae4030f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import javax.swing.AbstractListModel;
-import javax.swing.event.ListDataListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This javax.swing.ListModel can be used to keep a ListDataListener
- * (e.g. a JList) in synch with a ListValueModel (or a CollectionValueModel).
- *
- * An instance of this ListModel *must* be supplied with a value model,
- * which is a ListValueModel on the bound list or a CollectionValueModel
- * on the bound collection. This is required - the list (or collection)
- * itself can be null, but the value model that holds it cannot.
- */
-public class ListModelAdapter
- extends AbstractListModel
-{
- /** A value model on the underlying model list. */
- protected ListValueModel<?> listHolder;
-
- /**
- * Cache the size of the list for "dramatic" changes.
- * @see #listChanged(ListChangeEvent)
- */
- protected int listSize;
-
- /** A listener that allows us to forward changes made to the underlying model list. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Default constructor - initialize stuff.
- */
- private ListModelAdapter() {
- super();
- this.listSize = 0;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- /**
- * Constructor - the list holder is required.
- */
- public ListModelAdapter(ListValueModel<?> listHolder) {
- this();
- this.setModel(listHolder);
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public ListModelAdapter(CollectionValueModel<?> collectionHolder) {
- this();
- this.setModel(collectionHolder);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- ListModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListChangeEvent event) {
- ListModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListChangeEvent event) {
- ListModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListChangeEvent event) {
- ListModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListChangeEvent event) {
- ListModelAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent event) {
- ListModelAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- // ********** ListModel implementation **********
-
- public int getSize() {
- return this.listHolder.size();
- }
-
- public Object getElementAt(int index) {
- return this.listHolder.get(index);
- }
-
- /**
- * Extend to start listening to the underlying model list if necessary.
- */
- @Override
- public void addListDataListener(ListDataListener l) {
- if (this.hasNoListDataListeners()) {
- this.engageModel();
- this.listSize = this.listHolder.size();
- }
- super.addListDataListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model list if appropriate.
- */
- @Override
- public void removeListDataListener(ListDataListener l) {
- super.removeListDataListener(l);
- if (this.hasNoListDataListeners()) {
- this.disengageModel();
- this.listSize = 0;
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel<?> model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel<?> listHolder) {
- if (listHolder == null) {
- throw new NullPointerException();
- }
- boolean hasListeners = this.hasListDataListeners();
- if (hasListeners) {
- this.disengageModel();
- }
- this.listHolder = listHolder;
- if (hasListeners) {
- this.engageModel();
- this.listChanged();
- }
- }
-
- /**
- * Set the underlying collection model.
- */
- @SuppressWarnings("unchecked")
- public void setModel(CollectionValueModel<?> collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoListDataListeners() {
- return this.getListDataListeners().length == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasListDataListeners() {
- return ! this.hasNoListDataListeners();
- }
-
-
- // ********** behavior **********
-
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsAdded(ListChangeEvent event) {
- int start = event.index();
- int end = start + event.itemsSize() - 1;
- this.fireIntervalAdded(this, start, end);
- this.listSize += event.itemsSize();
- }
-
- /**
- * Items were removed from the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsRemoved(ListChangeEvent event) {
- int start = event.index();
- int end = start + event.itemsSize() - 1;
- this.fireIntervalRemoved(this, start, end);
- this.listSize -= event.itemsSize();
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsReplaced(ListChangeEvent event) {
- int start = event.index();
- int end = start + event.itemsSize() - 1;
- this.fireContentsChanged(this, start, end);
- }
-
- /**
- * Items were moved in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsMoved(ListChangeEvent event) {
- int start = Math.min(event.sourceIndex(), event.targetIndex());
- int end = Math.max(event.sourceIndex(), event.targetIndex()) + event.moveLength() - 1;
- this.fireContentsChanged(this, start, end);
- }
-
- /**
- * The underlying model list was cleared.
- * Notify listeners of the changes.
- */
- protected void listCleared() {
- if (this.listSize != 0) {
- this.fireIntervalRemoved(this, 0, this.listSize - 1);
- this.listSize = 0;
- }
- }
-
- /**
- * The underlying model list has changed "dramatically".
- * Notify listeners of the changes.
- */
- protected void listChanged() {
- if (this.listSize != 0) {
- this.fireIntervalRemoved(this, 0, this.listSize - 1);
- }
- this.listSize = this.listHolder.size();
- if (this.listSize != 0) {
- this.fireIntervalAdded(this, 0, this.listSize - 1);
- }
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java
deleted file mode 100644
index edad3a7c36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.SpinnerListModel;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerListModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a value
- * in the list.
- *
- * This class must be a sub-class of SpinnerListModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * NB: This model should only be used for values that have a reasonably
- * inexpensive #equals() implementation.
- * @see #synchronize(Object)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see DateSpinnerModelAdapter
- * @see NumberSpinnerModelAdapter
- */
-public class ListSpinnerModelAdapter
- extends SpinnerListModel
-{
-
- /**
- * The default spinner value; used when the underlying model value is null.
- * The default is the first item on the list.
- */
- private final Object defaultValue;
-
- /** A value model on the underlying value. */
- private final WritablePropertyValueModel<Object> valueHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying value. */
- private final PropertyChangeListener valueChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder is required.
- * Use the model value itself as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder) {
- this(valueHolder, valueHolder.value());
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object defaultValue) {
- this(valueHolder, new Object[] {defaultValue}, defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * Use the first item in the list of values as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object[] values) {
- this(valueHolder, values, values[0]);
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object[] values, Object defaultValue) {
- this(valueHolder, Arrays.asList(values), defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * Use the first item in the list of values as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, List<Object> values) {
- this(valueHolder, values, values.get(0));
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, List<Object> values, Object defaultValue) {
- super(values);
- this.valueHolder = valueHolder;
- this.valueChangeListener = this.buildValueChangeListener();
- // postpone listening to the underlying value
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValueChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildValueChangeListener_());
- }
-
- protected PropertyChangeListener buildValueChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ListSpinnerModelAdapter.this.synchronize(event.newValue());
- }
- @Override
- public String toString() {
- return "value listener";
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.valueHolder.value()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying value directly.
- * The resulting event will be ignored: @see #synchronize(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.valueHolder.setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying value if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- this.synchronize(this.valueHolder.value());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying value if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Object getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the spinner value has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
deleted file mode 100644
index 79dbc4baa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import javax.swing.SpinnerNumberModel;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerNumberModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a number.
- *
- * This class must be a sub-class of SpinnerNumberModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see DateSpinnerModelAdapter
- * @see ListSpinnerModelAdapter
- */
-public class NumberSpinnerModelAdapter
- extends SpinnerNumberModel
-{
-
- /**
- * The default spinner value; used when the
- * underlying model number value is null.
- */
- private final Number defaultValue;
-
- /** A value model on the underlying number. */
- private final WritablePropertyValueModel<Number> numberHolder;
-
- /**
- * A listener that allows us to synchronize with
- * changes made to the underlying number.
- */
- private final PropertyChangeListener numberChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the number holder is required.
- * The default spinner value is zero.
- * The step size is one.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder) {
- this(numberHolder, 0);
- }
-
- /**
- * Constructor - the number holder is required.
- * The step size is one.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int defaultValue) {
- this(numberHolder, null, null, new Integer(1), new Integer(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- * Use the minimum value as the default spinner value.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int minimum, int maximum, int stepSize) {
- this(numberHolder, minimum, maximum, stepSize, minimum);
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int minimum, int maximum, int stepSize, int defaultValue) {
- this(numberHolder, new Integer(minimum), new Integer(maximum), new Integer(stepSize), new Integer(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- * Use the minimum value as the default spinner value.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize) {
- this(numberHolder, value, minimum, maximum, stepSize, minimum);
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double value, double minimum, double maximum, double stepSize, double defaultValue) {
- this(numberHolder, new Double(minimum), new Double(maximum), new Double(stepSize), new Double(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, Comparable<?> minimum, Comparable<?> maximum, Number stepSize, Number defaultValue) {
- super(numberHolder.value() == null ? defaultValue : (Number) numberHolder.value(), minimum, maximum, stepSize);
- this.numberHolder = numberHolder;
- this.numberChangeListener = this.buildNumberChangeListener();
- // postpone listening to the underlying number
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildNumberChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildNumberChangeListener_());
- }
-
- protected PropertyChangeListener buildNumberChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- NumberSpinnerModelAdapter.this.synchronize(event.newValue());
- }
- @Override
- public String toString() {
- return "number listener";
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.numberHolder.value()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying number directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.numberHolder.setValue((Number) value);
- }
-
- /**
- * Extend to start listening to the underlying number if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.numberHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.numberChangeListener);
- this.synchronize(this.numberHolder.value());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying number if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.numberHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.numberChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Number getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the date has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.numberHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
deleted file mode 100644
index e40a6a1c15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import javax.swing.DefaultListSelectionModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionListener;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This ListSelectionModel is aware of the ListModel and
- * provides convenience methods to access and set the
- * selected *objects*, as opposed to the selected *indexes*.
- */
-public class ObjectListSelectionModel
- extends DefaultListSelectionModel
-{
- /** The list model referenced by the list selection model. */
- private final ListModel listModel;
-
- /** A listener that allows us to clear the selection when the list model has changed. */
- private final ListDataListener listDataListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list selection model for the specified list model.
- */
- public ObjectListSelectionModel(ListModel listModel) {
- super();
- this.listModel = listModel;
- this.listDataListener = this.buildListDataListener();
- }
-
-
- // ********** initialization **********
-
- private ListDataListener buildListDataListener() {
- return new ListDataListener() {
- public void intervalAdded(ListDataEvent event) {
- // this does not affect the selection
- }
- public void intervalRemoved(ListDataEvent event) {
- // this does not affect the selection
- }
- public void contentsChanged(ListDataEvent event) {
- ObjectListSelectionModel.this.listModelContentsChanged(event);
- }
- @Override
- public String toString() {
- return "list data listener";
- }
- };
- }
-
- /**
- * Typically, the selection does not need to be cleared when the
- * contents of the list have changed. Most of the time this just
- * means an item has changed in a way that affects its display string
- * or icon. We typically only use the class for edits involving
- * single selection.
- * A subclass can override this method if the selection
- * should be cleared because a change could mean the selection is invalid.
- */
- protected void listModelContentsChanged(ListDataEvent event) {
- /**this.clearSelection();*/
- }
-
-
- // ********** ListSelectionModel implementation **********
-
- @Override
- public void addListSelectionListener(ListSelectionListener l) {
- if (this.hasNoListSelectionListeners()) {
- this.listModel.addListDataListener(this.listDataListener);
- }
- super.addListSelectionListener(l);
- }
-
- @Override
- public void removeListSelectionListener(ListSelectionListener l) {
- super.removeListSelectionListener(l);
- if (this.hasNoListSelectionListeners()) {
- this.listModel.removeListDataListener(this.listDataListener);
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoListSelectionListeners() { // private-protected
- return this.getListSelectionListeners().length == 0;
- }
-
- /**
- * Return the list model referenced by the list selection model.
- */
- public ListModel listModel() {
- return this.listModel;
- }
-
- public int selectedValuesSize() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return 0;
- }
-
- int n = 0;
- int count = this.listModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- n++;
- }
- }
- return n;
- }
-
- /**
- * Return the first selected value.
- * Return null if the selection is empty.
- */
- public Object selectedValue() {
- int index = this.getMinSelectionIndex();
- if (index == -1) {
- return null;
- }
- if (this.listModel().getSize() <= index) {
- return null;
- }
- return this.listModel().getElementAt(index);
- }
-
- /**
- * Return an array of the selected values.
- */
- public Object[] selectedValues() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return new Object[0];
- }
-
- int maxSize = (max - min) + 1;
- Object[] temp = new Object[maxSize];
- int n = 0;
- int count = this.listModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- temp[n++] = this.listModel().getElementAt(i);
- }
- }
- if (n == maxSize) {
- // all the elements in the range were selected
- return temp;
- }
- // only some of the elements in the range were selected
- Object[] result = new Object[n];
- System.arraycopy(temp, 0, result, 0, n);
- return result;
- }
-
- /**
- * Return an array of the selected indices in ordered.
- */
- public int[] selectedIndices() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return new int[0];
- }
-
- int maxSize = (max - min) + 1;
- int[] temp = new int[maxSize];
- int n = 0;
- int count = this.listModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- temp[n++] = i;
- }
- }
- if (n == maxSize) {
- // all the elements in the range were selected
- Arrays.sort(temp);
- return temp;
- }
- // only some of the elements in the range were selected
- int[] result = new int[n];
- System.arraycopy(temp, 0, result, 0, n);
- Arrays.sort(result);
- return result;
- }
-
- /**
- * Set the selected value.
- */
- public void setSelectedValue(Object object) {
- this.setSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- this.clearSelection();
- this.addSelectedValuesInternal(objects);
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Collection<?> objects) {
- this.setSelectedValues(objects.iterator());
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Object[] objects) {
- this.setSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * Add the specified object to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValue(Object object) {
- this.addSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- this.addSelectedValuesInternal(objects);
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Collection<?> objects) {
- this.addSelectedValues(objects.iterator());
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Object[] objects) {
- this.addSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * Remove the specified object from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValue(Object object) {
- this.removeSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- ListModel lm = this.listModel();
- int lmSize = lm.getSize();
- while (objects.hasNext()) {
- int index = this.indexOf(objects.next(), lm, lmSize);
- this.removeSelectionInterval(index, index);
- }
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Collection<?> objects) {
- this.removeSelectedValues(objects.iterator());
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Object[] objects) {
- this.removeSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getAnchorSelectionIndex()
- * Return null if the anchor selection is empty.
- */
- public Object getAnchorSelectedValue() {
- int index = this.getAnchorSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.listModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#setAnchorSelectionIndex(int)
- */
- public void setAnchorSelectedValue(Object object) {
- this.setAnchorSelectionIndex(this.indexOf(object));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getLeadSelectionIndex()
- * Return null if the lead selection is empty.
- */
- public Object getLeadSelectedValue() {
- int index = this.getLeadSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.listModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#setLeadSelectionIndex(int)
- */
- public void setLeadSelectedValue(Object object) {
- this.setLeadSelectionIndex(this.indexOf(object));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getMaxSelectionIndex()
- * Return null if the max selection is empty.
- */
- public Object getMaxSelectedValue() {
- int index = this.getMaxSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.listModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getMinSelectionIndex()
- * Return null if the min selection is empty.
- */
- public Object getMinSelectedValue() {
- int index = this.getMinSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.listModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#isSelectedIndex(int)
- */
- public boolean valueIsSelected(Object object) {
- return this.isSelectedIndex(this.indexOf(object));
- }
-
- /**
- * Add the specified objects to the current set of selected objects,
- * without wrapping the actions in "adjusting" events.
- */
- private void addSelectedValuesInternal(Iterator<?> objects) {
- ListModel lm = this.listModel();
- int listModelSize = lm.getSize();
- while (objects.hasNext()) {
- int index = this.indexOf(objects.next(), lm, listModelSize);
- this.addSelectionInterval(index, index);
- }
- }
-
- /**
- * Return the index in the list model of the specified object.
- * Return -1 if the object is not in the list model.
- */
- private int indexOf(Object object) {
- ListModel lm = this.listModel();
- return this.indexOf(object, lm, lm.getSize());
- }
-
- /**
- * Return the index in the list model of the specified object.
- * Return -1 if the object is not in the list model.
- */
- // we're just jerking around with performance optimizations here
- // (in memory of Phil...);
- // call this method inside loops that do not modify the listModel
- private int indexOf(Object object, ListModel lm, int listModelSize) {
- for (int i = listModelSize; i-- > 0; ) {
- if (lm.getElementAt(i) == object) {
- return i;
- }
- }
- return -1;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java
deleted file mode 100644
index f72396faef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This TreeModel implementation provides a tree with a "null" root that
- * has a set of "primitive" children. These "primitive" children do not have
- * children themselves, making the tree a maximum of 2 levels deep.
- * This model automatically synchronizes the root's children with a
- * ListValueModel that holds a collection of primitive (non-model) objects
- * (e.g. Strings).
- *
- * This is useful for providing an "editable" list of primitives. Since the JDK
- * does not provide us with an editable listbox, we must use an editable tree.
- * We wrap everything in DefaultMutableTreeNodes.
- *
- * Subclasses must implement #primitiveChanged(int, Object) and update
- * the model appropriately. This method is called when the user edits the
- * list directly and presses <Enter>.
- *
- * The JTree using this model must be configured as "editable":
- * tree.setEditable(true);
- */
-// TODO convert to use an adapter instead of requiring subclass
-public abstract class PrimitiveListTreeModel
- extends DefaultTreeModel
-{
- /** a model on the list of primitives */
- private final ListValueModel<?> listHolder;
-
- /** a listener that handles the adding, removing, and replacing of the primitives */
- private final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Public constructor - the list holder is required
- */
- public PrimitiveListTreeModel(ListValueModel<?> listHolder) {
- super(new DefaultMutableTreeNode(null, true)); // true = the root can have children
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- // postpone listening to the model until we have listeners ourselves
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new PrimitiveListChangeListener();
- }
-
-
- // ********** behavior **********
-
- /**
- * Subclasses should override this method to update the
- * model appropriately. The primitive at the specified index was
- * edited directly by the user and the new value is as specified.
- * Convert the value appropriately and place it in the model.
- */
- protected abstract void primitiveChanged(int index, Object newValue);
-
-
- // ********** TreeModel implementation **********
-
- /**
- * Override to change the underlying model instead of changing the node directly.
- */
- @Override
- public void valueForPathChanged(TreePath path, Object newValue) {
- TreeNode node = (TreeNode) path.getLastPathComponent();
- int index = ((TreeNode) this.getRoot()).getIndex(node);
- this.primitiveChanged(index, newValue);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTreeModelListener(TreeModelListener l) {
- if (this.getTreeModelListeners().length == 0) {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- this.synchronizeList();
- }
- super.addTreeModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeTreeModelListener(TreeModelListener l) {
- super.removeTreeModelListener(l);
- if (this.getTreeModelListeners().length == 0) {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Synchronize our list of nodes with the list of primitives
- */
- void synchronizeList() {
- this.clearList();
- this.buildList();
- }
-
- void clearList() {
- int childcount = this.root.getChildCount();
- for (int i = childcount - 1; i >= 0; i--) {
- this.removeNodeFromParent((MutableTreeNode)this.root.getChildAt(i));
- }
- }
-
- private void buildList() {
- for (Iterator<?> stream = this.listHolder.iterator(); stream.hasNext(); ) {
- this.addPrimitive(stream.next());
- }
- }
-
- /**
- * Add the specified primitive to the end of the list.
- */
- private void addPrimitive(Object primitive) {
- this.insertPrimitive(this.root.getChildCount(), primitive);
- }
-
- /**
- * Create a node for the specified primitive
- * and insert it as a child of the root.
- */
- void insertPrimitive(int index, Object primitive) {
- DefaultMutableTreeNode node = new DefaultMutableTreeNode(primitive, false); // don't allow children on the child node
- this.insertNodeInto(node, (MutableTreeNode) this.root, index);
- }
-
- /**
- * Remove node at the specified index.
- */
- MutableTreeNode removeNode(int index) {
- MutableTreeNode node = (MutableTreeNode) this.root.getChildAt(index);
- this.removeNodeFromParent(node);
- return node;
- }
-
- /**
- * Replace the user object of the node at childIndex.
- */
- void replacePrimitive(int index, Object primitive) {
- MutableTreeNode node = (MutableTreeNode) this.root.getChildAt(index);
- node.setUserObject(primitive);
- this.nodeChanged(node);
- }
-
-
- // ********** inner class **********
-
- private class PrimitiveListChangeListener implements ListChangeListener {
- PrimitiveListChangeListener() {
- super();
- }
-
- public void itemsAdded(ListChangeEvent event) {
- int i = event.index();
- for (ListIterator<?> stream = event.items(); stream.hasNext(); ) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, stream.next());
- }
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- for (int i = 0; i < event.itemsSize(); i++) {
- PrimitiveListTreeModel.this.removeNode(event.index());
- }
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- int i = event.index();
- for (ListIterator<?> stream = event.items(); stream.hasNext(); ) {
- PrimitiveListTreeModel.this.replacePrimitive(i++, stream.next());
- }
- }
-
- public void itemsMoved(ListChangeEvent event) {
- ArrayList<MutableTreeNode> temp = new ArrayList<MutableTreeNode>(event.moveLength());
- for (int i = 0; i < event.moveLength(); i++) {
- temp.add(PrimitiveListTreeModel.this.removeNode(event.sourceIndex()));
- }
- int i = event.targetIndex();
- for (MutableTreeNode node : temp) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, node);
- }
- }
-
- public void listCleared(ListChangeEvent event) {
- PrimitiveListTreeModel.this.clearList();
- }
-
- public void listChanged(ListChangeEvent event) {
- PrimitiveListTreeModel.this.synchronizeList();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
deleted file mode 100644
index 1caee488c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JRadioButton) in synch with a (typically shared)
- * PropertyValueModel that holds one value out of a set of values.
- *
- * NOTE: Do *not* use this model with a ButtonGroup, since the
- * shared value holder and the wrappers built by this adapter will
- * keep the appropriate radio button checked. Also, this allows
- * us to uncheck all the radio buttons in a group when the shared
- * value is null.
- */
-public class RadioButtonModelAdapter
- extends ToggleButtonModelAdapter
-{
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder is required.
- */
- public RadioButtonModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object buttonValue, boolean defaultValue) {
- super(buildBooleanHolder(valueHolder, buttonValue), defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * The default value will be false.
- */
- public RadioButtonModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object buttonValue) {
- super(buildBooleanHolder(valueHolder, buttonValue));
- }
-
-
- // ********** static methods **********
-
- /**
- * Build up a set of wrappers that will convert the
- * specified value holder and button value to/from a boolean.
- *
- * If the value holder's value matches the button value,
- * the wrapper will return true. Likewise, if the value holder's
- * value is set to true, the wrapper will set the value holder's
- * value to the button value.
- */
- public static WritablePropertyValueModel<Boolean> buildBooleanHolder(WritablePropertyValueModel<Object> valueHolder, Object buttonValue) {
- WritablePropertyValueModel<Object> filteringPVM = new FilteringWritablePropertyValueModel<Object>(valueHolder, new RadioButtonFilter(buttonValue));
- return new TransformationWritablePropertyValueModel<Object, Boolean>(filteringPVM, new RadioButtonTransformer(buttonValue));
- }
-
-
- // ********** overrides **********
-
- /**
- * The user cannot de-select a radio button - the user
- * can only *select* a radio button. Only the model can
- * cause a radio button to be de-selected. We use the
- * ARMED flag to indicate whether we are being de-selected
- * by the user.
- */
- @Override
- public void setSelected(boolean b) {
- // do not allow the user to de-select a radio button
- // radio buttons can
- if ((b == false) && this.isArmed()) {
- return;
- }
- super.setSelected(b);
- }
-
-
- // ********** inner classes **********
-
- /**
- * This filter will only pass through a new value to the wrapped
- * value holder when it matches the configured button value.
- */
- public static class RadioButtonFilter implements BidiFilter<Object> {
- private Object buttonValue;
-
- public RadioButtonFilter(Object buttonValue) {
- super();
- this.buttonValue = buttonValue;
- }
-
- /**
- * always return the wrapped value
- */
- public boolean accept(Object value) {
- return true;
- }
-
- /**
- * pass through the value to the wrapped property value model
- * *only* when it matches our button value
- */
- public boolean reverseAccept(Object value) {
- return value == this.buttonValue;
- }
-
- }
-
- /**
- * This transformer will convert the wrapped value to Boolean.TRUE
- * when it matches the configured button value.
- */
- public static class RadioButtonTransformer implements BidiTransformer<Object, Boolean> {
- private Object buttonValue;
-
- public RadioButtonTransformer(Object buttonValue) {
- super();
- this.buttonValue = buttonValue;
- }
-
- /**
- * if the wrapped value matches our button value return true,
- * if it is some other value return false;
- * but if it is null simply pass it through because it will cause the
- * button model's default value to be used
- */
- public Boolean transform(Object value) {
- return (value == null) ? null : Boolean.valueOf(value == this.buttonValue);
- }
-
- /**
- * if the new value is true, pass through the our button value;
- * otherwise pass through null
- */
- public Object reverseTransform(Boolean value) {
- return (value.booleanValue()) ? this.buttonValue : null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java
deleted file mode 100644
index 2fc2f7d609..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import javax.swing.AbstractSpinnerModel;
-import javax.swing.SpinnerModel;
-import javax.swing.SpinnerNumberModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a value.
- *
- * Note: it is likely you want to use one of the following classes instead of
- * this one:
- * DateSpinnerModelAdapter
- * NumberSpinnerModelAdapter
- * ListSpinnerModelAdapter
- *
- * NB: This model should only be used for values that have a fairly
- * inexpensive #equals() implementation.
- * @see #synchronizeDelegate(Object)
- */
-public class SpinnerModelAdapter
- extends AbstractSpinnerModel
-{
- /** The delegate spinner model whose behavior we "enhance". */
- protected final SpinnerModel delegate;
-
- /** A listener that allows us to forward any changes made to the delegate spinner model. */
- protected final ChangeListener delegateListener;
-
- /** A value model on the underlying value. */
- protected final WritablePropertyValueModel<Object> valueHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying value. */
- protected final PropertyChangeListener valueListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder and delegate are required.
- */
- public SpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, SpinnerModel delegate) {
- super();
- if (valueHolder == null || delegate == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.delegate = delegate;
- // postpone listening to the underlying value
- // until we have listeners ourselves...
- this.valueListener = this.buildValueListener();
- this.delegateListener = this.buildDelegateListener();
- }
-
- /**
- * Constructor - the value holder is required.
- * This will wrap a simple number spinner model.
- */
- public SpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder) {
- this(valueHolder, new SpinnerNumberModel());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValueListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildValueListener_());
- }
-
- protected PropertyChangeListener buildValueListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- SpinnerModelAdapter.this.valueChanged(event);
- }
- @Override
- public String toString() {
- return "value listener";
- }
- };
- }
-
- /**
- * expand access a bit for inner class
- */
- @Override
- protected void fireStateChanged() {
- super.fireStateChanged();
- }
-
- protected ChangeListener buildDelegateListener() {
- return new ChangeListener() {
- public void stateChanged(ChangeEvent event) {
- // forward the event, with this as the source
- SpinnerModelAdapter.this.fireStateChanged();
- }
- @Override
- public String toString() {
- return "delegate listener";
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- public Object getValue() {
- return this.delegate.getValue();
- }
-
- /**
- * Extend to update the underlying value directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(Object).
- */
- public void setValue(Object value) {
- this.delegate.setValue(value);
- this.valueHolder.setValue(value);
- }
-
- public Object getNextValue() {
- return this.delegate.getNextValue();
- }
-
- public Object getPreviousValue() {
- return this.delegate.getPreviousValue();
- }
-
- /**
- * Extend to start listening to the underlying value if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.listenerList.getListenerCount(ChangeListener.class) == 0) {
- this.delegate.addChangeListener(this.delegateListener);
- this.engageValueHolder();
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying value if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.listenerList.getListenerCount(ChangeListener.class) == 0) {
- this.disengageValueHolder();
- this.delegate.removeChangeListener(this.delegateListener);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * A third party has modified the underlying value.
- * Synchronize the delegate model accordingly.
- */
- protected void valueChanged(PropertyChangeEvent event) {
- this.synchronizeDelegate(event.newValue());
- }
-
- /**
- * Set the delegate's value if it has changed.
- */
- protected void synchronizeDelegate(Object value) {
- // check to see whether the delegate has already been synchronized
- // (via #setValue())
- if ( ! this.delegate.getValue().equals(value)) {
- this.delegate.setValue(value);
- }
- }
-
- protected void engageValueHolder() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueListener);
- this.synchronizeDelegate(this.valueHolder.value());
- }
-
- protected void disengageValueHolder() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java
deleted file mode 100644
index 580d627730..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.event.TableModelListener;
-import javax.swing.table.AbstractTableModel;
-
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This TableModel can be used to keep a TableModelListener (e.g. a JTable)
- * in synch with a ListValueModel that holds a collection of model objects,
- * each of which corresponds to a row in the table.
- * Typically, each column of the table will be bound to a different aspect
- * of the contained model objects.
- *
- * For example, a MWTable has an attribute 'databaseFields' that holds
- * a collection of MWDatabaseFields that would correspond to the rows of
- * a JTable; and each MWDatabaseField has a number
- * of attributes (e.g. name, type, size) that can be bound to the columns of
- * a row in the JTable. As these database fields are added, removed, and
- * changed, this model will keep the listeners aware of the changes.
- *
- * An instance of this TableModel must be supplied with a
- * list holder (e.g. the 'databaseFields'), which is a value
- * model on the bound collection This is required - the
- * collection itself can be null, but the list value model that
- * holds it is required. Typically this list will be sorted (@see
- * SortedListValueModelAdapter).
- *
- * This TableModel must also be supplied with a ColumnAdapter that
- * will be used to configure the headers, renderers, editors, and contents
- * of the various columns.
- *
- * Design decision:
- * Cell listener options (from low space/high time to high space/low time):
- * - 1 cell listener listening to every cell (this is the current implementation)
- * - 1 cell listener per row
- * - 1 cell listener per cell
- */
-public class TableModelAdapter<E>
- extends AbstractTableModel
-{
- /**
- * a list of user objects that are converted to
- * rows via the column adapter
- */
- private ListValueModel<? extends E> listHolder;
- private final ListChangeListener listChangeListener;
-
- /**
- * each row is an array of cell models
- */
- // declare as ArrayList so we can use #ensureCapacity(int)
- private final ArrayList<WritablePropertyValueModel<Object>[]> rows;
-
- /**
- * client-supplied adapter that provides with the various column
- * settings and converts the objects in the LVM
- * into an array of cell models
- */
- private final ColumnAdapter columnAdapter;
-
- /**
- * the single listener that listens to every cell's model
- */
- private final PropertyChangeListener cellListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a table model adapter for the specified objects
- * and adapter.
- */
- public TableModelAdapter(ListValueModel<? extends E> listHolder, ColumnAdapter columnAdapter) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.columnAdapter = columnAdapter;
- this.listChangeListener = this.buildListChangeListener();
- this.rows = new ArrayList<WritablePropertyValueModel<Object>[]>();
- this.cellListener = this.buildCellListener();
- }
-
- /**
- * Construct a table model adapter for the specified objects
- * and adapter.
- */
- public TableModelAdapter(CollectionValueModel<? extends E> collectionHolder, ColumnAdapter columnAdapter) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), columnAdapter);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- TableModelAdapter.this.addRows(event.index(), event.itemsSize(), this.items(event));
- }
- public void itemsRemoved(ListChangeEvent event) {
- TableModelAdapter.this.removeRows(event.index(), event.itemsSize());
- }
- public void itemsReplaced(ListChangeEvent event) {
- TableModelAdapter.this.replaceRows(event.index(), this.items(event));
- }
- public void itemsMoved(ListChangeEvent event) {
- TableModelAdapter.this.moveRows(event.targetIndex(), event.sourceIndex(), event.moveLength());
- }
- public void listCleared(ListChangeEvent event) {
- TableModelAdapter.this.clearTable();
- }
- public void listChanged(ListChangeEvent event) {
- TableModelAdapter.this.rebuildTable();
- }
- /**
- * minimize scope of suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected Iterator<Object> items(ListChangeEvent event) {
- return (Iterator<Object>) event.items();
- }
- @Override
- public String toString() {
- return "list listener";
- }
- };
- }
-
-
- protected PropertyChangeListener buildCellListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildCellListener_());
- }
-
- protected PropertyChangeListener buildCellListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- TableModelAdapter.this.cellChanged((WritablePropertyValueModel<Object>) event.getSource());
- }
- @Override
- public String toString() {
- return "cell listener";
- }
- };
- }
-
-
- // ********** TableModel implementation **********
-
- public int getColumnCount() {
- return this.columnAdapter.columnCount();
- }
-
- public int getRowCount() {
- return this.rows.size();
- }
-
- @Override
- public String getColumnName(int column) {
- return this.columnAdapter.columnName(column);
- }
-
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- return this.columnAdapter.columnClass(columnIndex);
- }
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return this.columnAdapter.columnIsEditable(columnIndex);
- }
-
- public Object getValueAt(int rowIndex, int columnIndex) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(rowIndex);
- return row[columnIndex].value();
- }
-
- @Override
- public void setValueAt(Object value, int rowIndex, int columnIndex) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(rowIndex);
- row[columnIndex].setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTableModelListener(TableModelListener l) {
- if (this.hasNoTableModelListeners()) {
- this.engageModel();
- }
- super.addTableModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public void removeTableModelListener(TableModelListener l) {
- super.removeTableModelListener(l);
- if (this.hasNoTableModelListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel<? extends E> model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel<E> listHolder) {
- if (listHolder == null) {
- throw new NullPointerException();
- }
- boolean hasListeners = this.hasTableModelListeners();
- if (hasListeners) {
- this.disengageModel();
- }
- this.listHolder = listHolder;
- if (hasListeners) {
- this.engageModel();
- this.fireTableDataChanged();
- }
- }
-
- /**
- * Set the underlying collection model.
- */
- public void setModel(CollectionValueModel<E> collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoTableModelListeners() {
- return this.listenerList.getListenerCount(TableModelListener.class) == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasTableModelListeners() {
- return ! this.hasNoTableModelListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list of objects and the various aspects
- * of the objects that make up the rows.
- */
- private void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- this.engageAllCells();
- }
-
- /**
- * Convert the objects into rows and listen to the cells.
- */
- private void engageAllCells() {
- this.rows.ensureCapacity(this.listHolder.size());
- for (Iterator<? extends E> stream = this.listHolder.iterator(); stream.hasNext(); ) {
- WritablePropertyValueModel<Object>[] row = this.columnAdapter.cellModels(stream.next());
- this.engageRow(row);
- this.rows.add(row);
- }
- }
-
- /**
- * Listen to the cells in the specified row.
- */
- private void engageRow(WritablePropertyValueModel<Object>[] row) {
- for (int i = row.length; i-- > 0; ) {
- row[i].addPropertyChangeListener(PropertyValueModel.VALUE, this.cellListener);
- }
- }
-
- /**
- * Stop listening.
- */
- private void disengageModel() {
- this.disengageAllCells();
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- private void disengageAllCells() {
- for (WritablePropertyValueModel<Object>[] row : this.rows) {
- this.disengageRow(row);
- }
- this.rows.clear();
- }
-
- private void disengageRow(WritablePropertyValueModel<Object>[] row) {
- for (int i = row.length; i-- > 0; ) {
- row[i].removePropertyChangeListener(PropertyValueModel.VALUE, this.cellListener);
- }
- }
-
- /**
- * brute-force search for the cell(s) that changed...
- */
- void cellChanged(WritablePropertyValueModel<Object> cellHolder) {
- for (int i = this.rows.size(); i-- > 0; ) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(i);
- for (int j = row.length; j-- > 0; ) {
- if (row[j] == cellHolder) {
- this.fireTableCellUpdated(i, j);
- }
- }
- }
- }
-
- /**
- * convert the items to rows
- */
- void addRows(int index, int size, Iterator<Object> items) {
- List<WritablePropertyValueModel<Object>[]> newRows = new ArrayList<WritablePropertyValueModel<Object>[]>(size);
- while (items.hasNext()) {
- WritablePropertyValueModel<Object>[] row = this.columnAdapter.cellModels(items.next());
- this.engageRow(row);
- newRows.add(row);
- }
- this.rows.addAll(index, newRows);
- this.fireTableRowsInserted(index, index + size - 1);
- }
-
- void removeRows(int index, int size) {
- for (int i = 0; i < size; i++) {
- this.disengageRow(this.rows.remove(index));
- }
- this.fireTableRowsDeleted(index, index + size - 1);
- }
-
- void replaceRows(int index, Iterator<Object> items) {
- int i = index;
- while (items.hasNext()) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(i);
- this.disengageRow(row);
- row = this.columnAdapter.cellModels(items.next());
- this.engageRow(row);
- this.rows.set(i, row);
- i++;
- }
- this.fireTableRowsUpdated(index, i - 1);
- }
-
- void moveRows(int targetIndex, int sourceIndex, int length) {
- ArrayList<WritablePropertyValueModel<Object>[]> temp = new ArrayList<WritablePropertyValueModel<Object>[]>(length);
- for (int i = 0; i < length; i++) {
- temp.add(this.rows.remove(sourceIndex));
- }
- this.rows.addAll(targetIndex, temp);
-
- int start = Math.min(targetIndex, sourceIndex);
- int end = Math.max(targetIndex, sourceIndex) + length - 1;
- this.fireTableRowsUpdated(start, end);
- }
-
- void clearTable() {
- this.disengageAllCells();
- this.fireTableDataChanged();
- }
-
- void rebuildTable() {
- this.disengageAllCells();
- this.engageAllCells();
- this.fireTableDataChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java
deleted file mode 100644
index 750e52fc92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.awt.event.ActionListener;
-import java.awt.event.ItemListener;
-
-import javax.swing.JToggleButton.ToggleButtonModel;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JCheckBox or a JRadioButton) in synch with a PropertyValueModel
- * on a boolean.
- */
-public class ToggleButtonModelAdapter
- extends ToggleButtonModel
-{
- /**
- * The default setting for the toggle button; for when the underlying model is null.
- * The default [default value] is false (i.e. the toggle button is unchecked/empty).
- */
- protected final boolean defaultValue;
-
- /** A value model on the underlying model boolean. */
- protected final WritablePropertyValueModel<Boolean> booleanHolder;
-
- /**
- * A listener that allows us to synchronize with
- * changes made to the underlying model boolean.
- */
- protected final PropertyChangeListener booleanChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder is required.
- */
- public ToggleButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, boolean defaultValue) {
- super();
- if (booleanHolder == null) {
- throw new NullPointerException();
- }
- this.booleanHolder = booleanHolder;
- this.booleanChangeListener = this.buildBooleanChangeListener();
- // postpone listening to the underlying model
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
- /**
- * Constructor - the boolean holder is required.
- * The default value will be false.
- */
- public ToggleButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- this(booleanHolder, false);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildBooleanChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- protected PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ToggleButtonModelAdapter.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "boolean listener";
- }
- };
- }
-
-
- // ********** ButtonModel implementation **********
-
- /**
- * Extend to update the underlying model if necessary.
- */
- @Override
- public void setSelected(boolean b) {
- if (this.isSelected() != b) { // stop the recursion!
- super.setSelected(b);//put the super call first, otherwise the following gets called twice
- this.booleanHolder.setValue(Boolean.valueOf(b));
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addActionListener(ActionListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addActionListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeActionListener(ActionListener l) {
- super.removeActionListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addItemListener(ItemListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addItemListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeItemListener(ItemListener l) {
- super.removeItemListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addChangeListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener l) {
- super.removeChangeListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether we have no listeners at all.
- */
- protected boolean hasNoListeners() {
- return this.listenerList.getListenerCount() == 0;
- }
-
- protected boolean defaultValue() {
- return this.defaultValue;
- }
-
-
- // ********** behavior **********
-
- /**
- * Synchronize with the specified value.
- * If it is null, use the default value (which is typically false).
- */
- protected void setSelected(Boolean value) {
- if (value == null) {
- this.setSelected(this.defaultValue());
- } else {
- this.setSelected(value.booleanValue());
- }
- }
-
- /**
- * The underlying model has changed - synchronize accordingly.
- */
- protected void booleanChanged(PropertyChangeEvent event) {
- this.setSelected((Boolean) event.newValue());
- }
-
- protected void engageModel() {
- this.booleanHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- this.setSelected(this.booleanHolder.value());
- }
-
- protected void disengageModel() {
- this.booleanHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java
deleted file mode 100644
index 219035f195..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreePath;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTStateChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-
-/**
- * This javax.swing.tree.TreeModel can be used to keep a TreeModelListener
- * (e.g. a JTree) in synch with a tree of TreeNodeValueModel objects. Unlike
- * javax.swing.tree.DefaultTreeModel, you do not add and remove nodes with
- * methods implemented here. You can add and remove nodes by adding and
- * removing them directly to/from the nodes (or, more typically, the domain
- * objects the nodes are wrapping and listening to).
- *
- * Due to limitations in JTree, the root of the tree can never be null,
- * which, typically, should not be a problem. (If you want to display an empty
- * tree you can set the JTree's treeModel to null.)
- */
-public class TreeModelAdapter<T>
- extends AbstractTreeModel
-{
- /**
- * A value model on the underlying tree's root node and its
- * corresponding listener. This allows clients to swap out
- * the entire tree. Due to limitations in JTree, the root should
- * never be set to null while we have listeners.
- */
- private final PropertyValueModel<TreeNodeValueModel<T>> rootHolder;
- private final PropertyChangeListener rootListener;
-
- /**
- * A listener that notifies us when a node's internal
- * "state" changes (as opposed to the node's value or list of
- * children), allowing us to forward notification to our listeners.
- */
- private final StateChangeListener nodeStateListener;
-
- /**
- * A listener that notifies us when a node's "value"
- * changes (as opposed to the node's state or list of
- * children), allowing us to forward notification to our listeners.
- * Typically, this will only happen with nodes that hold
- * primitive data.
- */
- private final PropertyChangeListener nodeValueListener;
-
- /**
- * A listener that notifies us when an underlying node's
- * "list" of children changes, allowing us to keep our
- * internal tree in synch with the underlying tree model.
- */
- private final ListChangeListener childrenListener;
-
- /* these attributes make up our internal tree */
- /**
- * The root cannot be null while we have listeners, which is
- * most of the time. The root is cached so we can disengage
- * from it when it has been swapped out.
- */
- private TreeNodeValueModel<T> root;
-
- /**
- * Map the nodes to their lists of children.
- * We cache these so we can swap out the entire list of children
- * when we receive a #listChanged() event (which does not include
- * the items that were affected).
- * @see EventChangePolicy#rebuildChildren()
- */
- final IdentityHashMap<TreeNodeValueModel<T>, List<TreeNodeValueModel<T>>> childrenLists;
-
- /**
- * Map the children models to their parents.
- * We cache these so we can figure out the "real" source of the
- * list change events (the parent).
- * @see EventChangePolicy#parent()
- */
- final IdentityHashMap<ListValueModel<TreeNodeValueModel<T>>, TreeNodeValueModel<T>> parents;
-
-
- // ********** constructors **********
-
- /**
- * Construct a tree model for the specified root.
- */
- public TreeModelAdapter(PropertyValueModel<TreeNodeValueModel<T>> rootHolder) {
- super();
- if (rootHolder == null) {
- throw new NullPointerException();
- }
- this.rootHolder = rootHolder;
- this.rootListener = this.buildRootListener();
- this.nodeStateListener = this.buildNodeStateListener();
- this.nodeValueListener = this.buildNodeValueListener();
- this.childrenListener = this.buildChildrenListener();
- this.childrenLists = new IdentityHashMap<TreeNodeValueModel<T>, List<TreeNodeValueModel<T>>>();
- this.parents = new IdentityHashMap<ListValueModel<TreeNodeValueModel<T>>, TreeNodeValueModel<T>>();
- }
-
- /**
- * Construct a tree model for the specified root.
- */
- public TreeModelAdapter(TreeNodeValueModel<T> root) {
- this(new StaticPropertyValueModel<TreeNodeValueModel<T>>(root));
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildRootListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildRootListener_());
- }
-
- protected PropertyChangeListener buildRootListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TreeModelAdapter.this.rootChanged();
- }
- @Override
- public String toString() {
- return "root listener";
- }
- };
- }
-
- protected PropertyChangeListener buildNodeValueListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildNodeValueListener_());
- }
-
- protected PropertyChangeListener buildNodeValueListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- TreeModelAdapter.this.nodeChanged((TreeNodeValueModel<T>) event.getSource());
- }
- @Override
- public String toString() {
- return "node value listener";
- }
- };
- }
-
- protected StateChangeListener buildNodeStateListener() {
- return new AWTStateChangeListenerWrapper(this.buildNodeStateListener_());
- }
-
- protected StateChangeListener buildNodeStateListener_() {
- return new StateChangeListener() {
- @SuppressWarnings("unchecked")
- public void stateChanged(StateChangeEvent event) {
- TreeModelAdapter.this.nodeChanged((TreeNodeValueModel<T>) event.getSource());
- }
- @Override
- public String toString() {
- return "node state listener";
- }
- };
- }
-
- protected ListChangeListener buildChildrenListener() {
- return new AWTListChangeListenerWrapper(this.buildChildrenListener_());
- }
-
- protected ListChangeListener buildChildrenListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent event) {
- new EventChangePolicy(event).addChildren();
- }
- public void itemsRemoved(ListChangeEvent event) {
- new EventChangePolicy(event).removeChildren();
- }
- public void itemsReplaced(ListChangeEvent event) {
- new EventChangePolicy(event).replaceChildren();
- }
- public void itemsMoved(ListChangeEvent event) {
- new EventChangePolicy(event).moveChildren();
- }
- public void listCleared(ListChangeEvent event) {
- new EventChangePolicy(event).clearChildren();
- }
- public void listChanged(ListChangeEvent event) {
- new EventChangePolicy(event).rebuildChildren();
- }
- @Override
- public String toString() {
- return "children listener";
- }
- };
- }
-
-
- // ********** TreeModel implementation **********
-
- public Object getRoot() {
- return this.root;
- }
-
- @SuppressWarnings("unchecked")
- public Object getChild(Object parent, int index) {
- return ((TreeNodeValueModel<T>) parent).child(index);
- }
-
- @SuppressWarnings("unchecked")
- public int getChildCount(Object parent) {
- return ((TreeNodeValueModel<T>) parent).childrenSize();
- }
-
- @SuppressWarnings("unchecked")
- public boolean isLeaf(Object node) {
- return ((TreeNodeValueModel<T>) node).isLeaf();
- }
-
- @SuppressWarnings("unchecked")
- public void valueForPathChanged(TreePath path, Object newValue) {
- ((TreeNodeValueModel<T>) path.getLastPathComponent()).setValue((T) newValue);
- }
-
- @SuppressWarnings("unchecked")
- public int getIndexOfChild(Object parent, Object child) {
- return ((TreeNodeValueModel<T>) parent).indexOfChild((TreeNodeValueModel<T>) child);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTreeModelListener(TreeModelListener l) {
- if (this.hasNoTreeModelListeners()) {
- this.engageModel();
- }
- super.addTreeModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeTreeModelListener(TreeModelListener l) {
- super.removeTreeModelListener(l);
- if (this.hasNoTreeModelListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Listen to the root and all the other nodes
- * in the underlying tree model.
- */
- private void engageModel() {
- this.rootHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.rootListener);
- this.root = this.rootHolder.value();
- if (this.root == null) {
- throw new NullPointerException(); // the root cannot be null while we have listeners
- }
- this.engageNode(this.root);
- this.addRoot();
- }
-
- /**
- * Add the root and all of the nodes to the underlying tree.
- */
- private void addRoot() {
- this.addNode(0, this.root);
- }
-
- /**
- * Stop listening to the root and all the other
- * nodes in the underlying tree model.
- */
- private void disengageModel() {
- this.removeRoot();
- this.disengageNode(this.root);
- this.root = null;
- this.rootHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.rootListener);
- }
-
- /**
- * Remove the root and all of the nodes from the underlying tree.
- */
- private void removeRoot() {
- this.removeNode(0, this.root);
- }
-
- /**
- * The root has been swapped.
- * This method is a bit gnarly because the API for notifying listeners
- * that the root has changed is a bit inconsistent with that used for
- * non-root nodes.
- */
- void rootChanged() {
- TreeNodeValueModel<T> newRoot = this.rootHolder.value();
- if (newRoot == null) {
- throw new NullPointerException(); // the root cannot be null while we have listeners
- }
- // remove all the current root's children from the tree
- // and remove the it from the internal tree
- this.removeRoot();
-
- // save the old root and swap in the new root
- TreeNodeValueModel<T> oldRoot = this.root;
- this.root = newRoot;
-
- // we must be listening to both the old and new roots when we fire the event
- // because their values can be affected by whether they have listeners
- this.engageNode(this.root);
- this.fireTreeRootReplaced(this.root);
- // now we can stop listening to the old root
- this.disengageNode(oldRoot);
-
- // add the new root to the internal tree and
- // add all its children to the tree also
- this.addRoot();
- }
-
- /**
- * Either the "value" or the "state" of the specified node has changed,
- * forward notification to our listeners.
- */
- void nodeChanged(TreeNodeValueModel<T> node) {
- TreeNodeValueModel<T> parent = node.parent();
- if (parent == null) {
- this.fireTreeRootChanged(node);
- } else {
- this.fireTreeNodeChanged(parent.path(), parent.indexOfChild(node), node);
- }
- }
-
- /**
- * Listen to the nodes, notify our listeners that the nodes were added,
- * and then add the nodes to our internal tree.
- * We must listen to the nodes before notifying anybody, because
- * adding a listener can change the value of a node.
- */
- void addChildren(TreeNodeValueModel<T>[] path, int[] childIndices, TreeNodeValueModel<T>[] children) {
- int len = childIndices.length;
- for (int i = 0; i < len; i++) {
- this.engageNode(children[i]);
- }
- this.fireTreeNodesInserted(path, childIndices, children);
- for (int i = 0; i < len; i++) {
- this.addNode(childIndices[i], children[i]);
- }
- }
-
- /**
- * Listen to the node and its children model.
- */
- private void engageNode(TreeNodeValueModel<T> node) {
- node.addStateChangeListener(this.nodeStateListener);
- node.addPropertyChangeListener(PropertyValueModel.VALUE, this.nodeValueListener);
- node.childrenModel().addListChangeListener(ListValueModel.LIST_VALUES, this.childrenListener);
- }
-
- /**
- * Add the node to our internal tree;
- * then recurse down through the node's children,
- * adding them to the internal tree also.
- */
- private void addNode(int index, TreeNodeValueModel<T> node) {
- this.addNodeToInternalTree(node.parent(), index, node, node.childrenModel());
- new NodeChangePolicy(node).addChildren();
- }
-
- /**
- * Add the specified node to our internal tree.
- */
- private void addNodeToInternalTree(TreeNodeValueModel<T> parent, int index, TreeNodeValueModel<T> node, ListValueModel<TreeNodeValueModel<T>> childrenModel) {
- List<TreeNodeValueModel<T>> siblings = this.childrenLists.get(parent);
- if (siblings == null) {
- siblings = new ArrayList<TreeNodeValueModel<T>>();
- this.childrenLists.put(parent, siblings);
- }
- siblings.add(index, node);
-
- this.parents.put(childrenModel, node);
- }
-
- /**
- * Remove nodes from our internal tree, notify our listeners that the
- * nodes were removed, then stop listening to the nodes.
- * We must listen to the nodes until after notifying anybody, because
- * removing a listener can change the value of a node.
- */
- void removeChildren(TreeNodeValueModel<T>[] path, int[] childIndices, TreeNodeValueModel<T>[] children) {
- int len = childIndices.length;
- for (int i = 0; i < len; i++) {
- // the indices slide down a notch each time we remove a child
- this.removeNode(childIndices[i] - i, children[i]);
- }
- this.fireTreeNodesRemoved(path, childIndices, children);
- for (int i = 0; i < len; i++) {
- this.disengageNode(children[i]);
- }
- }
-
- /**
- * First, recurse down through the node's children,
- * removing them from our internal tree;
- * then remove the node itself from our internal tree.
- */
- private void removeNode(int index, TreeNodeValueModel<T> node) {
- new NodeChangePolicy(node).removeChildren();
- this.removeNodeFromInternalTree(node.parent(), index, node, node.childrenModel());
- }
-
- /**
- * Remove the specified node from our internal tree.
- */
- private void removeNodeFromInternalTree(TreeNodeValueModel<T> parent, int index, TreeNodeValueModel<T> node, ListValueModel<TreeNodeValueModel<T>> childrenModel) {
- this.parents.remove(childrenModel);
-
- List<TreeNodeValueModel<T>> siblings = this.childrenLists.get(parent);
- siblings.remove(index);
- if (siblings.isEmpty()) {
- this.childrenLists.remove(parent);
- }
- }
-
- /**
- * Stop listening to the node and its children model.
- */
- private void disengageNode(TreeNodeValueModel<T> node) {
- node.childrenModel().removeListChangeListener(ListValueModel.LIST_VALUES, this.childrenListener);
- node.removePropertyChangeListener(PropertyValueModel.VALUE, this.nodeValueListener);
- node.removeStateChangeListener(this.nodeStateListener);
- }
-
- void moveChildren(TreeNodeValueModel<T> parent, int targetIndex, int sourceIndex, int length) {
- List<TreeNodeValueModel<T>> childrenList = this.childrenLists.get(parent);
- ArrayList<TreeNodeValueModel<T>> temp = new ArrayList<TreeNodeValueModel<T>>(length);
- for (int i = 0; i < length; i++) {
- temp.add(childrenList.remove(sourceIndex));
- }
- childrenList.addAll(targetIndex, temp);
-
- this.fireTreeStructureChanged(parent.path());
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.root);
- }
-
-
- // ********** inner classes **********
-
- /**
- * Coalesce some of the common change policy behavior.
- */
- private abstract class ChangePolicy {
-
- ChangePolicy() {
- super();
- }
-
- /**
- * Add the current set of children.
- */
- void addChildren() {
- TreeModelAdapter.this.addChildren(this.parent().path(), this.childIndices(), this.childArray());
- }
-
- /**
- * Remove the current set of children.
- */
- void removeChildren() {
- TreeModelAdapter.this.removeChildren(this.parent().path(), this.childIndices(), this.childArray());
- }
-
- /**
- * Return an array of the indices of the current set of children,
- * which should be contiguous.
- */
- int[] childIndices() {
- return this.buildIndices(this.childrenStartIndex(), this.childrenSize());
- }
-
- /**
- * Return an array of the current set of children.
- */
- TreeNodeValueModel<T>[] childArray() {
- return this.buildArray(this.children(), this.childrenSize());
- }
-
- /**
- * Build an array to hold the elements in the specified iterator.
- * If they are different sizes, something is screwed up...
- */
- TreeNodeValueModel<T>[] buildArray(Iterator<TreeNodeValueModel<T>> stream, int size) {
- @SuppressWarnings("unchecked")
- TreeNodeValueModel<T>[] array = new TreeNodeValueModel[size];
- for (int i = 0; stream.hasNext(); i++) {
- array[i] = stream.next();
- }
- return array;
- }
-
- /**
- * Return a set of indices, starting at zero and
- * continuing for the specified size.
- */
- int[] buildIndices(int size) {
- return buildIndices(0, size);
- }
-
- /**
- * Return a set of indices, starting at the specified index and
- * continuing for the specified size.
- */
- int[] buildIndices(int start, int size) {
- int[] indices = new int[size];
- int index = start;
- for (int i = 0; i < size; i++) {
- indices[i] = index++;
- }
- return indices;
- }
-
- /**
- * Return the parent of the current set of children.
- */
- abstract TreeNodeValueModel<T> parent();
-
- /**
- * Return the starting index for the current set of children.
- */
- abstract int childrenStartIndex();
-
- /**
- * Return the size of the current set of children.
- */
- abstract int childrenSize();
-
- /**
- * Return an interator on the current set of children.
- */
- abstract Iterator<TreeNodeValueModel<T>> children();
-
- }
-
-
- /**
- * Wraps a ListChangeEvent for adding, removing, replacing,
- * and changing children.
- */
- private class EventChangePolicy extends ChangePolicy {
- private ListChangeEvent event;
-
- EventChangePolicy(ListChangeEvent event) {
- this.event = event;
- }
-
- /**
- * Map the ListChangeEvent's source to the corresponding parent.
- */
- @Override
- TreeNodeValueModel<T> parent() {
- return TreeModelAdapter.this.parents.get(this.event.getSource());
- }
-
- /**
- * The ListChangeEvent's item index is the children start index.
- */
- @Override
- int childrenStartIndex() {
- return this.event.index();
- }
-
- /**
- * The ListChangeEvent's size is the children size.
- */
- @Override
- int childrenSize() {
- return this.event.itemsSize();
- }
-
- /**
- * The ListChangeEvent's items are the children.
- */
- @Override
- @SuppressWarnings("unchecked")
- Iterator<TreeNodeValueModel<T>> children() {
- return (Iterator<TreeNodeValueModel<T>>) this.event.items();
- }
-
- /**
- * Remove the old nodes and add the new ones.
- */
- void replaceChildren() {
- TreeNodeValueModel<T>[] parentPath = this.parent().path();
- int[] childIndices = this.childIndices();
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, this.replacedChildren());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, this.childArray());
- }
-
- /**
- * Remove the old nodes and add the new ones.
- */
- void moveChildren() {
- TreeModelAdapter.this.moveChildren(this.parent(), this.event.targetIndex(), this.event.sourceIndex(), this.event.moveLength());
- }
-
- /**
- * Clear all the nodes.
- */
- void clearChildren() {
- TreeNodeValueModel<T> parent = this.parent();
- TreeNodeValueModel<T>[] parentPath = parent.path();
- List<TreeNodeValueModel<T>> childrenList = TreeModelAdapter.this.childrenLists.get(parent);
- int[] childIndices = this.buildIndices(childrenList.size());
- TreeNodeValueModel<T>[] childArray = this.buildArray(childrenList.iterator(), childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
- }
-
- /**
- * Remove all the old nodes and add all the new nodes.
- */
- void rebuildChildren() {
- TreeNodeValueModel<T> parent = this.parent();
- TreeNodeValueModel<T>[] parentPath = parent.path();
- List<TreeNodeValueModel<T>> childrenList = TreeModelAdapter.this.childrenLists.get(parent);
- int[] childIndices = this.buildIndices(childrenList.size());
- TreeNodeValueModel<T>[] childArray = this.buildArray(childrenList.iterator(), childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
-
- childIndices = this.buildIndices(parent.childrenModel().size());
- childArray = this.buildArray(parent.childrenModel().iterator(), parent.childrenSize());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, childArray);
- }
-
- /**
- * The ListChangeEvent's replaced items are the replaced children.
- */
- @SuppressWarnings("unchecked")
- TreeNodeValueModel<T>[] replacedChildren() {
- return this.buildArray((Iterator<TreeNodeValueModel<T>>) this.event.replacedItems(), this.event.itemsSize());
- }
-
- }
-
-
- /**
- * Wraps a TreeNodeValueModel for adding and removing its children.
- */
- private class NodeChangePolicy extends ChangePolicy {
- private TreeNodeValueModel<T> node;
-
- NodeChangePolicy(TreeNodeValueModel<T> node) {
- this.node = node;
- }
-
- /**
- * The node itself is the parent.
- */
- @Override
- TreeNodeValueModel<T> parent() {
- return this.node;
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children start index is always zero.
- */
- @Override
- int childrenStartIndex() {
- return 0;
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children size is always equal to the size
- * of the children model.
- */
- @Override
- int childrenSize() {
- return this.node.childrenModel().size();
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children are all the objects held by
- * the children model.
- */
- @Override
- Iterator<TreeNodeValueModel<T>> children() {
- return this.node.childrenModel().iterator();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java
deleted file mode 100644
index c7709ee3d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java
+++ /dev/null
@@ -1,991 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-
-/**
- * Base class for Node classes.
- * Provides support for the following:
- * initialization
- * enforced object identity wrt #equals()/#hashCode()
- * containment hierarchy (parent/child)
- * user comment
- * dirty flag
- * problems
- * sorting
- *
- * Typically, subclasses should consider implementing the following methods:
- * the appropriate constructors
- * (with the appropriately-restrictive type declaration for parent)
- * #initialize()
- * #initialize(Node parentNode)
- * #checkParent(Node parentNode)
- * #addChildrenTo(List list)
- * #nodeRemoved(Node)
- * #validator()
- * #transientAspectNames() or
- * #addTransientAspectNamesTo(Set transientAspectNames)
- * #addProblemsTo(List currentProblems)
- * #nonValidatedAspectNames()
- * #addNonValidatedAspectNamesTo(Set nonValidatedAspectNames)
- * #displayString()
- * #toString(StringBuilder sb)
- */
-public abstract class AbstractNode
- extends AbstractModel
- implements Node
-{
-
- /** Containment hierarchy. */
- private Node parent; // pseudo-final
-
- /** Track whether the node has changed. */
- private volatile boolean dirty;
- private volatile boolean dirtyBranch;
-
- /**
- * The node's problems, as calculated during validation.
- * This list should only be modified via a ProblemSynchronizer,
- * allowing for asynchronous modification from another thread.
- */
- private Vector<Problem> problems; // pseudo-final
- private static final Object[] EMPTY_PROBLEM_MESSAGE_ARGUMENTS = new Object[0];
-
- /**
- * Cache the node's "branch" problems, as calculated during validation.
- * This list should only be modified via a ProblemSynchronizer,
- * allowing for asynchronous modification from another thread.
- * This must be recalculated every time this node or one of its
- * descendants changes it problems.
- */
- private Vector<Problem> branchProblems; // pseudo-final
-
- /** User comment. */
- private volatile String comment;
-
-
- // ********** static fields **********
-
- /**
- * Sets of transient aspect names, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final HashMap<Class<? extends AbstractNode>, HashSet<String>> transientAspectNameSets = new HashMap<Class<? extends AbstractNode>, HashSet<String>>();
-
- /**
- * Sets of non-validated aspect names, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final HashMap<Class<? extends AbstractNode>, HashSet<String>> nonValidatedAspectNameSets = new HashMap<Class<? extends AbstractNode>, HashSet<String>>();
-
-
- // ********** constructors **********
-
- /**
- * Most objects must have a parent.
- * Use this constructor to create a new node.
- * @see #initialize(Node)
- */
- protected AbstractNode(Node parent) {
- super();
- this.initialize(parent);
- }
-
-
- // ********** initialization **********
-
- /**
- * Initialize a newly-created instance.
- * @see #initialize(Node)
- */
- @Override
- protected void initialize() {
- super.initialize();
- this.comment = "";
-
- // a new object is dirty, by definition
- this.dirty = true;
- this.dirtyBranch = true;
-
- this.problems = new Vector<Problem>();
- this.branchProblems = new Vector<Problem>();
-
- // when you override this method, don't forget to include:
- // super.initialize();
- }
-
- /**
- * Initialize a newly-created instance.
- * @see #initialize()
- */
- protected void initialize(Node parentNode) {
- this.checkParent(parentNode);
- this.parent = parentNode;
- // when you override this method, don't forget to include:
- // super.initialize(parentNode);
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new LocalChangeSupport(this);
- }
-
-
- // ********** equality **********
-
- /**
- * Enforce object identity - do not allow objects to be equal unless
- * they are the same object.
- * Do NOT override this method - we rely on object identity extensively.
- */
- @Override
- public final boolean equals(Object o) {
- return this == o;
- }
-
- /**
- * Enforce object identity - do not allow objects to be equal unless
- * they are the same object.
- * Do NOT override this method - we rely on object identity extensively.
- */
- @Override
- public final int hashCode() {
- return super.hashCode();
- }
-
-
- // ********** containment hierarchy (parent/children) **********
-
- /**
- * INTRA-TREE API?
- * Return the node's parent in the containment hierarchy.
- * Most nodes must have a parent.
- * @see #children()
- */
- public Node parent() {
- return this.parent;
- }
-
- /**
- * Throw an IllegalArgumentException if the parent is not valid
- * for the node.
- * By default require a non-null parent. Override if other restrictions exist
- * or the parent should be null.
- * NB: Root node model implementations will need to override this method.
- */
- protected void checkParent(Node parentNode) {
- if (parentNode == null) {
- throw new IllegalArgumentException("The parent node cannot be null");
- }
- }
-
- /**
- * INTRA-TREE API?
- * Return the node's children, which are also nodes.
- * Do NOT override this method.
- * Override #addChildrenTo(List).
- * @see #parent()
- * @see #addChildrenTo(java.util.List)
- */
- public final Iterator<Node> children() {
- List<Node> children = new ArrayList<Node>();
- this.addChildrenTo(children);
- return children.iterator();
- }
-
- /**
- * Subclasses should override this method to add their children
- * to the specified list.
- * @see #children()
- */
- protected void addChildrenTo(List<Node> list) {
- // this class has no children, subclasses will...
- // when you override this method, don't forget to include:
- // super.addChildrenTo(list);
- }
-
- /**
- * INTRA-TREE API?
- * Return the containment hierarchy's root node.
- * Most nodes must have a root.
- * @see #parent()
- * NB: Assume the root has no parent.
- */
- public Node root() {
- Node p = this.parent;
- return (p == null) ? this : p.root();
- }
-
- /**
- * Return whether the node is a descendant of the specified node.
- * By definition, a node is a descendant of itself.
- */
- public boolean isDescendantOf(Node node) {
- return (this == node) || this.parentIsDescendantOf(node);
- }
-
- protected boolean parentIsDescendantOf(Node node) {
- return (this.parent != null) && this.parent.isDescendantOf(node);
- }
-
- /**
- * Return a collection holding all the node's "references", and all
- * the node's descendants' "references". "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- */
- public Iterator<Node.Reference> branchReferences() {
- Collection<Node.Reference> branchReferences = new ArrayList<Node.Reference>(1000); // start big
- this.addBranchReferencesTo(branchReferences);
- return branchReferences.iterator();
- }
-
- /**
- * INTRA-TREE API
- * Add the node's "references", and all the node's descendants'
- * "references", to the specified collection. "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- * This method is of particular concern to Handles, since most
- * (hopefully all) "references" are held by Handles.
- * @see Reference
- * @see #children()
- */
- public void addBranchReferencesTo(Collection<Node.Reference> branchReferences) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addBranchReferencesTo(branchReferences);
- }
- }
-
- /**
- * Return all the nodes in the object's branch of the tree,
- * including the node itself. The nodes will probably returned
- * in "depth-first" order.
- * Only really used for testing and debugging.
- */
- public Iterator<Node> allNodes() {
- Collection<Node> nodes = new ArrayList<Node>(1000); // start big
- this.addAllNodesTo(nodes);
- return nodes.iterator();
- }
-
- /**
- * INTRA-TREE API?
- * Add all the nodes in the object's branch of the tree,
- * including the node itself, to the specified collection.
- * Only really used for testing and debugging.
- */
- public void addAllNodesTo(Collection<Node> nodes) {
- nodes.add(this);
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addAllNodesTo(nodes);
- }
- }
-
-
- // ********** model synchronization support **********
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * removed from the tree. The node receiving this notification
- * should perform any necessary updates to remain in synch
- * with the tree (e.g. clearing out or replacing any references
- * to the removed node or any of the removed node's descendants).
- * @see #isDescendantOf(Node)
- */
- public void nodeRemoved(Node node) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.nodeRemoved(node);
- }
- // when you override this method, don't forget to include:
- // super.nodeRemoved(node);
- }
-
- /**
- * convenience method
- * return whether node1 is a descendant of node2;
- * node1 can be null
- */
- protected boolean nodeIsDescendantOf(Node node1, Node node2) {
- return (node1 != null) && node1.isDescendantOf(node2);
- }
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * renamed. The node receiving this notification should mark its
- * branch dirty if necessary (i.e. it references the renamed node
- * or one of its descendants). This method is of particular concern
- * to Handles.
- * @see #isDescendantOf(Node)
- */
- public void nodeRenamed(Node node) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.nodeRenamed(node);
- }
- // when you override this method, don't forget to include:
- // super.nodeRenamed(node);
- }
-
-
- // ********** user comment **********
-
- /**
- * Return the object's user comment.
- */
- public final String comment() {
- return this.comment;
- }
-
- /**
- * Set the object's user comment.
- */
- public final void setComment(String comment) {
- Object old = this.comment;
- this.comment = comment;
- this.firePropertyChanged(COMMENT_PROPERTY, old, comment);
- }
-
-
- // ********** change support **********
-
- /**
- * An aspect of the node has changed:
- * - if it is a persistent aspect, mark the object dirty
- * - if it is a significant aspect, validate the object
- */
- protected void aspectChanged(String aspectName) {
- if (this.aspectIsPersistent(aspectName)) {
- // System.out.println(Thread.currentThread() + " dirty change: " + this + ": " + aspectName);
- this.markDirty();
- }
- if (this.aspectChangeRequiresValidation(aspectName)) {
- // System.out.println(Thread.currentThread() + " validation change: " + this + ": " + aspectName);
- this.validate();
- }
- }
-
- protected void validate() {
- this.validator().validate();
- }
-
- /**
- * INTRA-TREE API
- * Return a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- * NB: Root node model implementations will need to override this method.
- */
- public Node.Validator validator() {
- if (this.parent == null) {
- throw new IllegalStateException("This node should not be firing change events during its construction.");
- }
- return this.parent.validator();
- }
-
- /**
- * Set a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- * NB: Root node model implementations will need to override this method.
- */
- public void setValidator(Node.Validator validator) {
- if (this.parent == null) {
- throw new IllegalStateException("This root node should implement #setValidator(Node.Validator).");
- }
- throw new UnsupportedOperationException("Only root nodes implement #setValidator(Node.Validator).");
- }
-
-
- // ********** dirty flag support **********
-
- /**
- * Return whether any persistent aspects of the object
- * have changed since the object was last read or saved.
- * This does NOT include changes to the object's descendants.
- */
- public final boolean isDirty() {
- return this.dirty;
- }
-
- /**
- * Return whether any persistent aspects of the object,
- * or any of its descendants, have changed since the object and
- * its descendants were last read or saved.
- */
- public final boolean isDirtyBranch() {
- return this.dirtyBranch;
- }
-
- /**
- * Return whether the object is unmodified
- * since it was last read or saved.
- * This does NOT include changes to the object's descendants.
- */
- public final boolean isClean() {
- return ! this.dirty;
- }
-
- /**
- * Return whether the object and all of its descendants
- * are unmodified since the object and
- * its descendants were last read or saved.
- */
- public final boolean isCleanBranch() {
- return ! this.dirtyBranch;
- }
-
- /**
- * Set the dirty branch flag setting. This is set to true
- * when either the object or one of its descendants becomes dirty.
- */
- private void setIsDirtyBranch(boolean dirtyBranch) {
- boolean old = this.dirtyBranch;
- this.dirtyBranch = dirtyBranch;
- this.firePropertyChanged(DIRTY_BRANCH_PROPERTY, old, dirtyBranch);
- }
-
- /**
- * Mark the object as dirty and as a dirty branch.
- * An object is marked dirty when either a "persistent" attribute
- * has changed or its save location has changed.
- */
- private void markDirty() {
- this.dirty = true;
- this.markBranchDirty();
- }
-
- /**
- * INTRA-TREE API
- * Mark the node and its parent as dirty branches.
- * This message is propagated up the containment
- * tree when a particular node becomes dirty.
- */
- public void markBranchDirty() {
- // short-circuit any unnecessary propagation
- if (this.dirtyBranch) {
- // if this is already a dirty branch, the parent must be also
- return;
- }
-
- this.setIsDirtyBranch(true);
- this.markParentBranchDirty();
- }
-
- protected void markParentBranchDirty() {
- if (this.parent != null) {
- this.parent.markBranchDirty();
- }
- }
-
- /**
- * Mark the object and all its descendants as dirty.
- * This is used when the save location of some
- * top-level object is changed and the entire
- * containment tree must be marked dirty so it
- * will be written out.
- */
- public final void markEntireBranchDirty() {
- this.markDirty();
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.markEntireBranchDirty();
- }
- }
-
- /**
- * Mark the object and all its descendants as clean.
- * Then notify the object's parent that it (the parent)
- * might now be a clean branch also.
- * Typically used when the object has just been
- * read in or written out.
- */
- public final void markEntireBranchClean() {
- this.cascadeMarkEntireBranchClean();
- this.markParentBranchCleanIfPossible();
- }
-
- protected void markParentBranchCleanIfPossible() {
- if (this.parent != null) {
- this.parent.markBranchCleanIfPossible();
- }
- }
-
- /**
- * INTRA-TREE API
- * Mark the node and all its descendants as clean.
- * Typically used when the node has just been
- * read in or written out.
- * This method is for internal use only; it is not for
- * client use.
- * Not the best of method names.... :-(
- */
- public final void cascadeMarkEntireBranchClean() {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.cascadeMarkEntireBranchClean();
- }
- this.dirty = false;
- this.setIsDirtyBranch(false);
- }
-
- /**
- * INTRA-TREE API
- * A child node's branch has been marked clean. If the node
- * itself is clean and if all of its children are also clean, the
- * node's branch can be marked clean. Then, if the node's
- * branch is clean, the node will notify its parent that it might
- * be clean also. This message is propagated up the containment
- * tree when a particular node becomes clean.
- */
- public final void markBranchCleanIfPossible() {
- // short-circuit any unnecessary propagation
- if (this.dirty) {
- // if the object is "locally" dirty, it is still a dirty branch
- return;
- }
-
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- if (child.isDirtyBranch()) {
- return;
- }
- }
-
- this.setIsDirtyBranch(false);
- this.markParentBranchCleanIfPossible();
- }
-
- private boolean aspectIsPersistent(String aspectName) {
- return ! this.aspectIsTransient(aspectName);
- }
-
- private boolean aspectIsTransient(String aspectName) {
- return this.transientAspectNames().contains(aspectName);
- }
-
- /**
- * Return a set of the object's transient aspect names.
- * These are the aspects that, when they change, will NOT cause the
- * object to be marked dirty.
- * If you need instance-based calculation of your transient aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addTransientAspectNamesTo(Set).
- */
- protected final Set<String> transientAspectNames() {
- synchronized (transientAspectNameSets) {
- HashSet<String> transientAspectNames = transientAspectNameSets.get(this.getClass());
- if (transientAspectNames == null) {
- transientAspectNames = new HashSet<String>();
- this.addTransientAspectNamesTo(transientAspectNames);
- transientAspectNameSets.put(this.getClass(), transientAspectNames);
- }
- return transientAspectNames;
- }
- }
-
- /**
- * Add the object's transient aspect names to the specified set.
- * These are the aspects that, when they change, will NOT cause the
- * object to be marked dirty.
- * If class-based calculation of your transient aspects is sufficient,
- * override this method. If you need instance-based calculation,
- * override #transientAspectNames().
- */
- protected void addTransientAspectNamesTo(Set<String> transientAspectNames) {
- transientAspectNames.add(DIRTY_BRANCH_PROPERTY);
- transientAspectNames.add(BRANCH_PROBLEMS_LIST);
- transientAspectNames.add(HAS_BRANCH_PROBLEMS_PROPERTY);
- // when you override this method, don't forget to include:
- // super.addTransientAspectNamesTo(transientAspectNames);
- }
-
- /**
- * Return the dirty nodes in the object's branch of the tree,
- * including the node itself (if appropriate).
- * Only really used for testing and debugging.
- */
- public final Iterator<Node> allDirtyNodes() {
- return new FilteringIterator<Node, Node>(this.allNodes()) {
- @Override
- protected boolean accept(Node node) {
- return (node instanceof AbstractNode) && ((AbstractNode) node).isDirty();
- }
- };
- }
-
-
- // ********** problems **********
-
- /**
- * Return the node's problems.
- * This does NOT include the problems of the node's descendants.
- * @see #branchProblems()
- */
- public final Iterator<Problem> problems() {
- return new CloneIterator<Problem>(this.problems); // removes are not allowed
- }
-
- /**
- * Return the size of the node's problems.
- * This does NOT include the problems of the node's descendants.
- * @see #branchProblemsSize()
- */
- public final int problemsSize() {
- return this.problems.size();
- }
-
- /**
- * Return whether the node has problems
- * This does NOT include the problems of the node's descendants.
- * @see #hasBranchProblems()
- */
- public final boolean hasProblems() {
- return ! this.problems.isEmpty();
- }
-
- /**
- * Return all the node's problems along with all the
- * node's descendants' problems.
- */
- public final ListIterator<Problem> branchProblems() {
- return new CloneListIterator<Problem>(this.branchProblems); // removes are not allowed
- }
-
- /**
- * Return the size of all the node's problems along with all the
- * node's descendants' problems.
- */
- public final int branchProblemsSize() {
- return this.branchProblems.size();
- }
-
- /**
- * Return whether the node or any of its descendants have problems.
- */
- public final boolean hasBranchProblems() {
- return ! this.branchProblems.isEmpty();
- }
-
- public final boolean containsBranchProblem(Problem problem) {
- return this.branchProblems.contains(problem);
- }
-
- protected final Problem buildProblem(String messageKey, Object... messageArguments) {
- return new DefaultProblem(this, messageKey, messageArguments);
- }
-
- protected final Problem buildProblem(String messageKey) {
- return this.buildProblem(messageKey, EMPTY_PROBLEM_MESSAGE_ARGUMENTS);
- }
-
- /**
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * If the node's "branch" problems have changed,
- * notify the node's parent.
- */
- public void validateBranch() {
- if (this.validateBranchInternal()) {
- // if our "branch" problems have changed, then
- // our parent must rebuild its "branch" problems also
- this.rebuildParentBranchProblems();
- }
- }
-
- protected void rebuildParentBranchProblems() {
- if (this.parent != null) {
- this.parent.rebuildBranchProblems();
- }
- }
-
- /**
- * INTRA-TREE API
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- public boolean validateBranchInternal() {
- // rebuild "branch" problems in children first
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- // ignore the return value because we are going to rebuild our "branch"
- // problems no matter what, to see if they have changed
- child.validateBranchInternal();
- }
-
- this.problems.clear();
- this.addProblemsTo(this.problems);
-
- return this.checkBranchProblems();
- }
-
- /**
- * Check for any problems and add them to the specified list.
- * This method should ONLY add problems for this particular node;
- * it should NOT add problems for any of this node's descendants
- * or ancestors. (Although there will be times when it is debatable
- * as to which node a problem "belongs" to....)
- *
- * NB: This method should NOT modify ANY part of the node's state!
- * It is a READ-ONLY behavior. ONLY the list of current problems
- * passed in to the method should be modified.
- */
- protected void addProblemsTo(List<Problem> currentProblems) {
- // The default is to do nothing.
- // When you override this method, don't forget to include:
- // super.addProblemsTo(currentProblems);
- }
-
- /**
- * Rebuild the "branch" problems and return whether they have
- * changed.
- * NB: The entire collection of "branch" problems must be re-calculated
- * with EVERY "significant" change - we cannot keep it in synch via
- * change notifications because if a descendant with problems is
- * removed or replaced we will not receive notification that its
- * problems were removed from our "branch" problems.
- */
- private boolean checkBranchProblems() {
- Vector<Problem> oldBranchProblems = new Vector<Problem>(this.branchProblems);
- int oldSize = this.branchProblems.size();
-
- this.branchProblems.clear();
- this.branchProblems.addAll(this.problems);
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addBranchProblemsTo(this.branchProblems);
- }
-
- // if the size has changed to or from zero, our virtual flag has changed
- int newSize = this.branchProblems.size();
- if ((oldSize == 0) && (newSize != 0)) {
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, false, true);
- } else if ((oldSize != 0) && (newSize == 0)) {
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, true, false);
- }
-
- if (oldBranchProblems.equals(this.branchProblems)) {
- return false; // our "branch" problems did not change
- }
- // our "branch" problems changed
- this.fireListChanged(BRANCH_PROBLEMS_LIST);
- return true;
- }
-
- /**
- * INTRA-TREE API
- * Add all the problems of the node and all
- * the problems of its descendants to the
- * specified collection.
- */
- public final void addBranchProblemsTo(List<Problem> list) {
- list.addAll(this.branchProblems);
- }
-
- /**
- * INTRA-TREE API
- * A child node's "branch" problems changed;
- * therefore the node's "branch" problems have changed also and
- * must be rebuilt.
- */
- public final void rebuildBranchProblems() {
- if ( ! this.checkBranchProblems()) {
- throw new IllegalStateException("we should not get here unless our \"branch\" problems have changed");
- }
- this.rebuildParentBranchProblems();
- }
-
- /**
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * If the node's "branch" problems have changed,
- * notify the node's parent.
- */
- public final void clearAllBranchProblems() {
- if (this.clearAllBranchProblemsInternal()) {
- // if our "branch" problems have changed, then
- // our parent must rebuild its "branch" problems also
- this.rebuildParentBranchProblems();
- }
- }
-
- /**
- * INTRA-TREE API
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- public final boolean clearAllBranchProblemsInternal() {
- if (this.branchProblems.isEmpty()) {
- return false;
- }
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- // ignore the return value because we are going to clear our "branch"
- // problems no matter what
- child.clearAllBranchProblemsInternal();
- }
- this.problems.clear();
- this.branchProblems.clear();
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, true, false);
- this.fireListChanged(BRANCH_PROBLEMS_LIST);
- return true;
- }
-
- /**
- * Return whether a change to specified aspect requires a re-validation
- * of the node's tree.
- */
- private boolean aspectChangeRequiresValidation(String aspectName) {
- return ! this.aspectChangeDoesNotRequireValidation(aspectName);
- }
-
- private boolean aspectChangeDoesNotRequireValidation(String aspectName) {
- return this.nonValidatedAspectNames().contains(aspectName);
- }
-
- /**
- * Return a set of the object's "non-validated" aspect names.
- * These are the aspects that, when they change, will NOT cause the
- * object (or its containing tree) to be validated, i.e. checked for problems.
- * If you need instance-based calculation of your "non-validated" aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addNonValidatedAspectNamesTo(Set).
- */
- protected final Set<String> nonValidatedAspectNames() {
- synchronized (nonValidatedAspectNameSets) {
- HashSet<String> nonValidatedAspectNames = nonValidatedAspectNameSets.get(this.getClass());
- if (nonValidatedAspectNames == null) {
- nonValidatedAspectNames = new HashSet<String>();
- this.addNonValidatedAspectNamesTo(nonValidatedAspectNames);
- nonValidatedAspectNameSets.put(this.getClass(), nonValidatedAspectNames);
- }
- return nonValidatedAspectNames;
- }
- }
-
- /**
- * Add the object's "non-validated" aspect names to the specified set.
- * These are the aspects that, when they change, will NOT cause the
- * object (or its containing tree) to be validated, i.e. checked for problems.
- * If class-based calculation of your "non-validated" aspects is sufficient,
- * override this method. If you need instance-based calculation,
- * override #nonValidatedAspectNames().
- */
- protected void addNonValidatedAspectNamesTo(Set<String> nonValidatedAspectNames) {
- nonValidatedAspectNames.add(COMMENT_PROPERTY);
- nonValidatedAspectNames.add(DIRTY_BRANCH_PROPERTY);
- nonValidatedAspectNames.add(BRANCH_PROBLEMS_LIST);
- nonValidatedAspectNames.add(HAS_BRANCH_PROBLEMS_PROPERTY);
- // when you override this method, don't forget to include:
- // super.addNonValidatedAspectNamesTo(nonValidatedAspectNames);
- }
-
-
- // ********** display methods **********
-
- /**
- * Compare display strings.
- */
- public int compareTo(Node node) {
- return DEFAULT_COMPARATOR.compare(this, node);
- }
-
- /**
- * Return a developer-friendly String. If you want something useful for
- * displaying in a user interface, use #displayString().
- * If you want to give more information in your #toString(),
- * override #toString(StringBuilder sb).
- * Whatever you add to that string buffer will show up between the parentheses.
- * @see AbstractModel#toString(StringBuilder sb)
- * @see #displayString()
- */
- @Override
- public final String toString() {
- return super.toString();
- }
-
-
- // ********** member classes **********
-
- /**
- * This change support class will:
- * - notify the source node when one of the node's aspects has changed
- * - allow the source node to supply the change event dispatcher
- * - build a custom "child" change support
- * @see AbstractNode#aspectChanged(String)
- * @see AbstractNode#changeEventDispatcher()
- * @see AbstractNode.LocalChildChangeSupport
- */
- protected static class LocalChangeSupport extends ChangeSupport {
- private static final long serialVersionUID = 1L;
- public LocalChangeSupport(AbstractNode source) {
- super(source);
- }
- protected AbstractNode sourceNode() {
- return (AbstractNode) this.source;
- }
- @Override
- protected ChangeSupport buildChildChangeSupport() {
- return new LocalChildChangeSupport(this.sourceNode());
- }
- @Override
- protected void sourceChanged(String aspectName) {
- super.sourceChanged(aspectName);
- this.sourceNode().aspectChanged(aspectName);
- }
- }
-
- /**
- * The aspect-specific change support class does not need to
- * notify the source node of changes (the parent will take care of that);
- * nor does it need to build "grandchildren" change support objects.
- */
- protected static class LocalChildChangeSupport extends ChangeSupport {
- private static final long serialVersionUID = 1L;
- public LocalChildChangeSupport(AbstractNode source) {
- super(source);
- }
- protected AbstractNode sourceNode() {
- return (AbstractNode) this.source;
- }
- @Override
- protected ChangeSupport buildChildChangeSupport() {
- // there are no grandchildren
- throw new UnsupportedOperationException();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java
deleted file mode 100644
index fd2059cc8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java
+++ /dev/null
@@ -1,50 +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.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of the PluggableValidator.Delegate interface
- * simply sets a shared "validate" flag to true. This should trigger a
- * separate "validation" thread to begin validating the appropriate
- * branch of nodes.
- */
-public class AsynchronousValidator
- implements PluggableValidator.Delegate
-{
- private SynchronizedBoolean validateFlag;
-
- /**
- * Construct a validator delegate with the specified shared
- * "validate" flag. This flag should be shared with
- * another thread that will perform the actual validation.
- */
- public AsynchronousValidator(SynchronizedBoolean validateFlag) {
- super();
- this.validateFlag = validateFlag;
- }
-
- /**
- * Set the shared "validate" flag to true, triggering
- * an asynchronous validation of the appropriate
- * branch of nodes.
- */
- public void validate() {
- this.validateFlag.setTrue();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.validateFlag);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java
deleted file mode 100644
index 75f5741ca3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java
+++ /dev/null
@@ -1,80 +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.utility.internal.node;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This class is a straightforward implementation of the Problem interface.
- */
-public class DefaultProblem
- implements Problem
-{
- private final Node source;
- private final String messageKey;
- private final Object[] messageArguments;
-
-
- DefaultProblem(Node source, String messageKey, Object[] messageArguments) {
- super();
- this.source = source;
- this.messageKey = messageKey;
- this.messageArguments = messageArguments;
- }
-
-
- // ********** Problem implementation **********
-
- public Node source() {
- return this.source;
- }
-
- public String messageKey() {
- return this.messageKey;
- }
-
- public Object[] messageArguments() {
- return this.messageArguments;
- }
-
-
- // ********** Object overrides **********
-
- /**
- * We implement #equals(Object) because problems are repeatedly
- * re-calculated and the resulting problems merged with the existing
- * set of problems; and we want to keep the original problems and
- * ignore any freshly-generated duplicates.
- * Also, problems are not saved to disk....
- */
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Problem)) {
- return false;
- }
- Problem other = (Problem) o;
- return this.source == other.source()
- && this.messageKey.equals(other.messageKey())
- && Arrays.equals(this.messageArguments, other.messageArguments());
- }
-
- @Override
- public int hashCode() {
- return this.source.hashCode() ^ this.messageKey.hashCode();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.messageKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java
deleted file mode 100644
index 7096462327..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.node;
-
-import java.text.Collator;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * This interface defines the methods that must be implemented
- * by any class whose instances are to be part of a containment hierarchy
- * that supports a "dirty" state and validation "problems".
- *
- * Note: Methods marked "INTRA-TREE API" are typically only used by
- * the nodes themselves, as opposed to clients of the nodes. These
- * methods are called by a node on either its parent or its children.
- */
-public interface Node extends Model, Comparable<Node> {
-
-
- // ********** containment hierarchy (parent/children) **********
-
- /**
- * INTRA-TREE API?
- * Return the node's parent in the containment hierarchy.
- * Most nodes must have a parent. The parent is immutable.
- * @see #children()
- */
- Node parent();
-
- /**
- * INTRA-TREE API?
- * Return the node's children, which are also nodes.
- * @see #parent()
- */
- Iterator<Node> children();
-
- /**
- * INTRA-TREE API?
- * Return the containment hierarchy's root node.
- * Most nodes must have a root.
- * @see #parent()
- */
- Node root();
-
- /**
- * Return whether the node is a descendant of the specified node.
- * By definition, a node is a descendant of itself.
- */
- boolean isDescendantOf(Node node);
-
- /**
- * INTRA-TREE API
- * Add the node's "references", and all the node's descendants'
- * "references", to the specified collection. "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- * This method is of particular concern to Handles, since most
- * (hopefully all) "references" are held by Handles.
- * @see Reference
- * @see #children()
- */
- void addBranchReferencesTo(Collection<Node.Reference> branchReferences);
-
- /**
- * INTRA-TREE API?
- * Add all the nodes in the object's branch of the tree,
- * including the node itself, to the specified collection.
- * Only really used for testing and debugging.
- */
- void addAllNodesTo(Collection<Node> nodes);
-
-
- // ********** model synchronization support **********
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * removed from the tree. The node receiving this notification
- * should perform any necessary updates to remain in synch
- * with the tree (e.g. clearing out or replacing any references
- * to the removed node or any of the removed node's descendants).
- * @see #isDescendantOf(Node)
- */
- void nodeRemoved(Node node);
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * renamed. The node receiving this notification should mark its
- * branch dirty if necessary (i.e. it references the renamed node
- * or one of its descendants). This method is of particular concern
- * to Handles.
- * @see #isDescendantOf(Node)
- */
- void nodeRenamed(Node node);
-
-
- // ********** dirty flag support **********
-
- /**
- * Return whether any persistent aspects of the node,
- * or any of its descendants, have changed since the node and
- * its descendants were last read or saved.
- */
- boolean isDirtyBranch();
- String DIRTY_BRANCH_PROPERTY = "dirtyBranch";
-
- /**
- * INTRA-TREE API
- * Mark the node and its parent as dirty branches.
- * This message is propagated up the containment
- * tree when a particular node becomes dirty.
- */
- void markBranchDirty();
-
- /**
- * Mark the node and all its descendants as dirty.
- * This is used when the save location of some
- * top-level node is changed and the entire
- * containment tree must be marked dirty so it
- * will be written out.
- */
- void markEntireBranchDirty();
-
- /**
- * INTRA-TREE API
- * A child node's branch has been marked clean. If the node
- * itself is clean and if all of its children are also clean, the
- * node's branch can be marked clean. Then, if the node's
- * branch is clean, the node will notify its parent that it might
- * be clean also. This message is propagated up the containment
- * tree when a particular node becomes clean.
- */
- void markBranchCleanIfPossible();
-
- /**
- * INTRA-TREE API
- * Mark the node and all its descendants as clean.
- * Typically used when the node has just been
- * read in or written out.
- * This method is for internal use only; it is not for
- * client use.
- * Not the best of method names.... :-(
- */
- void cascadeMarkEntireBranchClean();
-
-
- // ********** problems **********
-
- /**
- * INTRA-TREE API
- * Return a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- */
- Validator validator();
-
- /**
- * Set a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- */
- void setValidator(Validator validator);
-
- /**
- * Validate the node and its descendants.
- * This is an explicit request invoked by a client; and it will
- * typically be followed by a call to one of the following methods:
- * #branchProblems()
- * #hasBranchProblems()
- * Whether the node maintains its problems on the fly
- * or waits until this method is called is determined by the
- * implementation.
- * @see Problem
- */
- void validateBranch();
-
- /**
- * INTRA-TREE API
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- boolean validateBranchInternal();
-
- /**
- * Return all the node's problems along with all the
- * node's descendants' problems.
- */
- ListIterator<Problem> branchProblems();
- String BRANCH_PROBLEMS_LIST = "branchProblems";
-
- /**
- * Return the size of all the node's problems along with all the
- * node's descendants' problems.
- */
- int branchProblemsSize();
-
- /**
- * Return whether the node or any of its descendants have problems.
- */
- boolean hasBranchProblems();
- String HAS_BRANCH_PROBLEMS_PROPERTY = "hasBranchProblems";
-
- /**
- * Return whether the node contains the specified branch problem.
- */
- boolean containsBranchProblem(Problem problem);
-
- /**
- * INTRA-TREE API
- * Something changed, rebuild the node's collection of branch problems.
- */
- void rebuildBranchProblems();
-
- /**
- * INTRA-TREE API
- * Add the node's problems, and all the node's descendants'
- * problems, to the specified list.
- * A call to this method should be immediately preceded by a call to
- * #validateBranch() or all of the problems might not be
- * added to the list.
- * @see Problem
- */
- void addBranchProblemsTo(List<Problem> branchProblems);
-
- /**
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- */
- void clearAllBranchProblems();
-
- /**
- * INTRA-TREE API
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- boolean clearAllBranchProblemsInternal();
-
-
- // ********** comment **********
-
- /**
- * Return the user comment concerning the node.
- */
- String comment();
- String COMMENT_PROPERTY = "comment";
-
- /**
- * Set the user comment concerning the node.
- */
- void setComment(String comment);
-
-
- // ********** displaying/sorting **********
-
- /**
- * Return a string representation of the model, suitable for sorting.
- */
- String displayString();
-
-
- // ********** sub-interfaces **********
-
- /**
- * Simple interface defining a "reference" between two nodes.
- * @see Node#addBranchReferencesTo(java.util.Collection)
- */
- interface Reference {
-
- /**
- * Return the "source" node of the reference, i.e. the node that
- * references the "target" node.
- */
- Node source();
-
- /**
- * Return the "target" node of the reference, i.e. the node that
- * is referenced by the "source" node.
- */
- Node target();
-
- }
-
-
- /**
- * A validator will validate a node as appropriate.
- * Typically the validation will
- * - occur whenever a node has changed
- * - encompass the entire tree containing the node
- * - execute asynchronously
- */
- interface Validator {
-
- /**
- * A "significant" aspect has changed;
- * validate the node as appropriate
- */
- void validate();
-
- /**
- * Stop all validation of the node until #resume() is called.
- * This can be used to improve the performance of any long-running
- * action that triggers numerous changes to the node. Be sure to
- * match a call to this method with a corresponding call to
- * #resume().
- */
- void pause();
-
- /**
- * Resume validation of the node. This method can only be
- * called after a matching call to #pause().
- */
- void resume();
-
- }
-
-
- // ********** helper implementations **********
-
- /**
- * Straightforward implementation of the Reference interface
- * defined above.
- */
- public class SimpleReference implements Reference {
- private Node source;
- private Node target;
- public SimpleReference(Node source, Node target) {
- super();
- if (source == null || target == null) {
- throw new NullPointerException();
- }
- this.source = source;
- this.target = target;
- }
- public Node source() {
- return this.source;
- }
- public Node target() {
- return this.target;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.source + " => " + this.target);
- }
- }
-
- /**
- * Typical comparator that can be used to sort a collection of nodes.
- * Sort based on display string:
- * - identical objects are equal (which means that cannot
- * co-exist in a SortedSet)
- * - use the default collator (which typically interleaves
- * lower- and upper-case letters)
- * - allow duplicate display strings (from different objects)
- * - try to return consistent results for same object pairs
- */
- Comparator<Node> DEFAULT_COMPARATOR =
- new Comparator<Node>() {
- public int compare(Node node1, Node node2) {
- // disallow duplicates based on object identity
- if (node1 == node2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = Collator.getInstance().compare(node1.displayString(), node2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(node1) - System.identityHashCode(node2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Node.DEFAULT_COMPARATOR";
- }
- };
-
-
- /**
- * This validator does nothing to validate the node.
- */
- Validator NULL_VALIDATOR =
- new PluggableValidator(PluggableValidator.Delegate.Null.instance()) {
- @Override
- public String toString() {
- return "Node.NULL_VALIDATOR";
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java
deleted file mode 100644
index c44f8aab43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of the Validator interface implements the
- * pause/resume portion of the protocol, but delegates the actual
- * validation to a "pluggable" delegate.
- */
-public class PluggableValidator
- implements Node.Validator
-{
- private boolean pause;
- private boolean validateOnResume;
- private final Delegate delegate;
-
-
- /**
- * Convenience factory method.
- */
- public static Node.Validator buildAsynchronousValidator(SynchronizedBoolean validateFlag) {
- return new PluggableValidator(new AsynchronousValidator(validateFlag));
- }
-
- /**
- * Convenience factory method.
- */
- public static Node.Validator buildSynchronousValidator(Node node) {
- return new PluggableValidator(new SynchronousValidator(node));
- }
-
- /**
- * Construct a validator with the specified delegate.
- */
- public PluggableValidator(Delegate delegate) {
- super();
- this.pause = false;
- this.validateOnResume = false;
- this.delegate = delegate;
- }
-
- public synchronized void validate() {
- if (this.pause) {
- this.validateOnResume = true;
- } else {
- this.delegate.validate();
- }
- }
-
- public synchronized void pause() {
- if (this.pause) {
- throw new IllegalStateException("already paused");
- }
- this.pause = true;
- }
-
- public synchronized void resume() {
- if ( ! this.pause) {
- throw new IllegalStateException("not paused");
- }
- this.pause = false;
- // validate any changes that occurred while the validation was paused
- if (this.validateOnResume) {
- this.validateOnResume = false;
- this.delegate.validate();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.delegate);
- }
-
-
- // ********** member interface **********
-
- /**
- * Interface implemented by any delegates of a pluggable validator.
- */
- public interface Delegate {
-
- /**
- * The validator is not "paused" - perform the appropriate validation.
- */
- void validate();
-
-
- /**
- * This delegate does nothing.
- */
- final class Null implements Delegate {
- public static final Delegate INSTANCE = new Null();
- public static Delegate instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void validate() {
- // do nothing
- }
- @Override
- public String toString() {
- return "PluggableValidator.Delegate.Null";
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java
deleted file mode 100644
index 4f8e730362..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java
+++ /dev/null
@@ -1,46 +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.utility.internal.node;
-
-/**
- * Define an interface describing the problems associated with a node.
- */
-public interface Problem {
-
- /**
- * Return the node most closely associated with the problem.
- */
- Node source();
-
- /**
- * Return a key that can be used to uniquely identify the problem's message.
- */
- String messageKey();
-
- /**
- * Return the arguments associate with the problem's message.
- */
- Object[] messageArguments();
-
- /**
- * Return whether the problem is equal to the specified object.
- * It is equal if the specified object is a implementation of the
- * Problem interface and its source, message key, and message
- * arguments are all equal to this problem's.
- */
- boolean equals(Object o);
-
- /**
- * Return the problem's hash code, which should calculated as an
- * XOR of the source's hash code and the message key's hash code.
- */
- int hashCode();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.java
deleted file mode 100644
index 4234010fce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/RunnableValidation.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.utility.internal.node;
-
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of Runnable will asynchronously validate
- * a branch of nodes. It will wait until a shared "validate" flag is
- * set to validate the branch. Once the the branch is validated,
- * the thread will quiesce until the flag is set again.
- *
- * There are two ways to stop this thread:
- * - Thread.interrupt()
- * - set the "continue" flag to false
- * For now, these two are equivalent; but in the future we might
- * pass the "continue" flag to the Node.validateBranch()
- * method so we can short-circuit the validation instead of waiting
- * until the entire branch is validated.
- */
-public class RunnableValidation
- implements Runnable
-{
- /** The node whose branch this thread will validate. */
- private final Node node;
-
- /** When this flag is set to true, we kick off the validation routine. */
- private final SynchronizedBoolean validateFlag;
-
- /** When this flag is set to false, we allow this thread to die. */
- private final SynchronizedBoolean continueFlag;
-
- /** Log any exceptions encountered during validation with the following settings. */
- private final Logger exceptionLogger;
- private final Level exceptionLevel;
- private final String exceptionMessage;
-
-
- /**
- * Construct a validation thread.
- */
- public RunnableValidation(
- Node node,
- SynchronizedBoolean validateFlag,
- SynchronizedBoolean continueFlag,
- Logger exceptionLogger,
- Level exceptionLevel,
- String exceptionMessage
- ) {
- super();
- this.node = node;
- this.validateFlag = validateFlag;
- this.continueFlag = continueFlag;
- this.exceptionLogger = exceptionLogger;
- this.exceptionLevel = exceptionLevel;
- this.exceptionMessage = exceptionMessage;
- }
-
-
- // ********** Runnable Implementation **********
-
- /**
- * Loop while the "continue" flag is true and the thread
- * has not been interrupted by another thread.
- * In each loop: Wait until the "validate" flag is set to true,
- * then set it back to false and validate the branch of nodes.
- */
- public void run() {
- while (this.continueFlag.isTrue()) {
- try {
- this.validateFlag.waitToSetFalse();
- } catch (InterruptedException ex) {
- // we were interrupted while waiting, must be quittin' time
- return;
- }
- this.validateNode();
- }
- }
-
- /**
- * Validate the node, logging any exceptions.
- * If an exception occurs, we terminate the validation until the
- * "validation" flag is set again. Some exceptions occur because
- * of concurrent changes to the model that occur *after* validation
- * starts but before it completes an entire pass over the model. If that
- * is the case, things should be OK; because the exception will be
- * caught and the "validation" flag will have been set again *during* the
- * initial validation pass. So when we return from catching the exception
- * we will simply re-start the validation, hopefully with the model in
- * a consistent state that will prevent another exception from
- * occurring. Of course, if we have any exceptions that are *not*
- * the result of the model being in an inconsistent state, we will
- * probably fill the log; and those exceptions are bugs that need
- * to be fixed. (!) Hopefully the user will notice the enormous log and
- * contact support.... ~bjv
- */
- private void validateNode() {
- try {
- this.node.validateBranch();
- } catch (Throwable ex) {
- this.logException(ex);
- }
- }
-
- /**
- * We need to do all this because Logger#log(LogRecord) does not pass through
- * Logger#doLog(LogRecord) like all the other Logger#log(...) methods.
- */
- private void logException(Throwable ex) {
- LogRecord logRecord = new LogRecord(this.exceptionLevel, this.exceptionMessage);
- logRecord.setParameters(new Object[] { this.node.displayString() });
- logRecord.setThrown(ex);
- logRecord.setLoggerName(this.exceptionLogger.getName());
- logRecord.setResourceBundle(this.exceptionLogger.getResourceBundle());
- this.exceptionLogger.log(logRecord);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java
deleted file mode 100644
index ede6b8b8f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.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.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This implementation of the PluggableValidator.Delegate interface
- * will validate the node immediately.
- *
- * This is useful for debugging in a single thread or generating
- * problem reports.
- */
-public class SynchronousValidator
- implements PluggableValidator.Delegate
-{
- private final Node node;
-
- /**
- * Construct a validator that will immediately validate the
- * specified node.
- */
- public SynchronousValidator(Node node) {
- super();
- this.node = node;
- }
-
- public void validate() {
- this.node.validateBranch();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.node);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java
deleted file mode 100644
index 8ebe2617e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java
+++ /dev/null
@@ -1,42 +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.utility.internal.swing;
-
-import javax.swing.ComboBoxModel;
-
-/**
- * This interface allows a client to better control the performance of
- * a combo box model by allowing the client to specify when it is
- * acceptable for the model to "cache" and "uncache" its list of elements.
- * The model may ignore these hints if appropriate.
- */
-public interface CachingComboBoxModel extends ComboBoxModel {
-
- /**
- * Cache the comboBoxModel List. If you call this, you
- * must make sure to call uncacheList() as well. Otherwise
- * stale data will be in the ComboBox until cacheList() is
- * called again or uncacheList() is called.
- */
- void cacheList();
-
- /**
- * Clear the cached list. Next time the list is needed it will
- * be built when it is not cached.
- */
- void uncacheList();
-
- /**
- * Check to see if the list is already cached. This can be used for
- * MouseEvents, since they are not terribly predictable.
- */
- boolean isCached();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java
deleted file mode 100644
index 6cbd37ddd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.Icon;
-import javax.swing.JCheckBox;
-import javax.swing.JTable;
-import javax.swing.SwingConstants;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-
-import org.eclipse.jpt.utility.internal.swing.TableCellEditorAdapter.ImmediateEditListener;
-
-/**
- * Make the cell look like a check box.
- */
-public class CheckBoxTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /** the component used to paint the cell */
- private final JCheckBox checkBox;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
- /** "normal" border - assume the default table "focus" border is 1 pixel thick */
- private static final Border NO_FOCUS_BORDER = BorderFactory.createEmptyBorder(1, 1, 1, 1);
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a cell renderer with no label or icon.
- */
- public CheckBoxTableCellRenderer() {
- super();
- this.checkBox = this.buildCheckBox();
- // by default, check boxes do not paint their borders
- this.checkBox.setBorderPainted(true);
- // this setting is recommended for check boxes inside of trees and tables
- this.checkBox.setBorderPaintedFlat(true);
- }
-
- /**
- * Construct a cell renderer with the specified text and icon,
- * either of which may be null.
- */
- public CheckBoxTableCellRenderer(String text, Icon icon) {
- this();
- this.setText(text);
- this.setIcon(icon);
- }
-
- /**
- * Construct a cell renderer with the specified text.
- */
- public CheckBoxTableCellRenderer(String text) {
- this(text, null);
- }
-
- /**
- * Construct a cell renderer with the specified icon.
- */
- public CheckBoxTableCellRenderer(Icon icon) {
- this(null, icon);
- }
-
- protected JCheckBox buildCheckBox() {
- JCheckBox cb = new JCheckBox();
- cb.addActionListener(this.buildActionListener());
- return cb;
- }
-
- private ActionListener buildActionListener() {
- return new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (CheckBoxTableCellRenderer.this.immediateEditListener != null) {
- CheckBoxTableCellRenderer.this.immediateEditListener.immediateEdit();
- }
- }
- };
- }
-
-
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- this.checkBox.setHorizontalAlignment(SwingConstants.CENTER);
- this.checkBox.setComponentOrientation(table.getComponentOrientation());
- this.checkBox.setFont(table.getFont());
- this.checkBox.setEnabled(table.isEnabled());
-
- this.checkBox.setForeground(this.foregroundColor(table, value, selected, hasFocus, row, column));
- this.checkBox.setBackground(this.backgroundColor(table, value, selected, hasFocus, row, column));
- // once the colors are set, calculate opaque setting
- this.checkBox.setOpaque(this.cellIsOpaqueIn(table, value, selected, hasFocus, row, column));
- this.checkBox.setBorder(this.border(table, value, selected, hasFocus, row, column));
-
- this.setValue(value);
- return this.checkBox;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground");
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground");
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- return hasFocus ? UIManager.getBorder("Table.focusCellHighlightBorder") : NO_FOCUS_BORDER;
- }
-
- /**
- * Return whether the cell should be opaque in the table.
- * If the cell's background is the same as the table's background
- * and table is opaque, we don't need to paint the background -
- * the table will do it.
- */
- protected boolean cellIsOpaqueIn(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- Color cellBackground = this.checkBox.getBackground();
- Color tableBackground = table.getBackground();
- return ! (table.isOpaque() && cellBackground.equals(tableBackground));
- }
-
- /**
- * Set the check box's value.
- */
- protected void setValue(Object value) {
- // CR#3999318 - This null check needs to be removed once JDK bug is fixed
- if (value == null) {
- value = Boolean.FALSE;
- }
- this.checkBox.setSelected(((Boolean) value).booleanValue());
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return Boolean.valueOf(this.checkBox.isSelected());
- }
-
- public void setImmediateEditListener(ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
- // ********** public API **********
-
- /**
- * Set the check box's text; which by default is blank.
- */
- public void setText(String text) {
- this.checkBox.setText(text);
- }
-
- /**
- * Set the check box's icon; which by default is not present.
- */
- public void setIcon(Icon icon) {
- this.checkBox.setIcon(icon);
- }
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the table's row height to something the check box
- * will look good in....
- */
- public int preferredHeight() {
- // add in space for the border top and bottom
- return (int) this.checkBox.getPreferredSize().getHeight() + 2;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java
deleted file mode 100644
index d0db82bbdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.ComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JTable;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * Make the cell look like a combo-box.
- */
-public class ComboBoxTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /* caching the combo box because we are caching the comboBoxModel.
- * Everytime we rebuilt the comboBox we would set the model on it and not
- * remove the model from the old combo box. This meant that new listeners
- * kept being added to the comboBoxModel for every comboBox build.
- * Not sure if there is a way to clear out the old combo box, or why
- * we were buildig a new combo box every time so I went with caching it.
- */
- private JComboBox comboBox;
-
- /** the items used to populate the combo box */
- private CachingComboBoxModel model;
- private ListCellRenderer renderer;
- Object value;
- private static int height = -1;
- boolean fakeFocusFlag;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
- /** hold the original colors of the combo-box */
- private static Color defaultForeground;
- private static Color defaultBackground;
-
- /** "normal" border - assume the default table "focus" border is 1 pixel thick */
- private static final Border NO_FOCUS_BORDER = BorderFactory.createEmptyBorder(1, 1, 1, 1);
-
-
- // ********** constructors/initialization **********
-
- /**
- * Default constructor.
- */
- private ComboBoxTableCellRenderer() {
- super();
- initialize();
- }
-
- /**
- * Construct a cell renderer that uses the specified combo-box model.
- */
- public ComboBoxTableCellRenderer(ComboBoxModel model) {
- this(new NonCachingComboBoxModel(model));
- }
-
- /**
- * Construct a cell renderer that uses the specified caching combo-box model.
- */
- public ComboBoxTableCellRenderer(CachingComboBoxModel model) {
- this();
- this.model = model;
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * combo-box model and renderer.
- */
- public ComboBoxTableCellRenderer(ComboBoxModel model, ListCellRenderer renderer) {
- this(new NonCachingComboBoxModel(model), renderer);
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * caching combo-box model and renderer.
- */
- public ComboBoxTableCellRenderer(CachingComboBoxModel model, ListCellRenderer renderer) {
- this(model);
- this.renderer = renderer;
- }
-
- protected void initialize() {
- // save the original colors of the combo-box, so we
- // can use them to paint non-selected cells
- if (height == -1) {
- JComboBox cb = new JComboBox();
- cb.addItem("m");
-
- // add in space for the border top and bottom
- height = cb.getPreferredSize().height + 2;
-
- defaultForeground = cb.getForeground();
- defaultBackground = cb.getBackground();
- }
- }
-
- static JLabel prototypeLabel = new JLabel("Prototype", new EmptyIcon(16), SwingConstants.LEADING);
-
- protected JComboBox buildComboBox() {
-
- final JComboBox result = new JComboBox() {
- private boolean fakeFocus;
- @Override
- public boolean hasFocus() {
- return fakeFocus || super.hasFocus();
- }
- @Override
- public void paint(Graphics g) {
- fakeFocus = ComboBoxTableCellRenderer.this.fakeFocusFlag;
- super.paint(g);
- fakeFocus = false;
- }
- //wrap the renderer to deal with the prototypeDisplayValue
- @Override
- public void setRenderer(final ListCellRenderer aRenderer) {
- super.setRenderer(new ListCellRenderer(){
- public Component getListCellRendererComponent(JList list, Object v, int index, boolean isSelected, boolean cellHasFocus) {
- if (v == prototypeLabel) {
- return prototypeLabel;
- }
- return aRenderer.getListCellRendererComponent(list, v, index, isSelected, cellHasFocus);
- }
- });
- }
- @Override
- public int getSelectedIndex() {
- boolean listNotCached = !listIsCached();
- if (listNotCached) {
- cacheList();
- }
-
- int index = super.getSelectedIndex();
-
- if (listNotCached) {
- uncacheList();
- }
- return index;
- }
-
- };
- // stole this code from javax.swing.DefaultCellEditor
- result.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
- result.addActionListener(this.buildActionListener());
- result.addPopupMenuListener(this.buildPopupMenuListener());
-
- //These are used to workaround problems with Swing trying to
- //determine the size of a comboBox with a large model
- result.setPrototypeDisplayValue(prototypeLabel);
- getListBox(result).setPrototypeCellValue(prototypeLabel);
-
- return result;
- }
-
-
- private JList getListBox(JComboBox result) {
- return (JList) ClassTools.fieldValue(result.getUI(), "listBox");
- }
-
-
- private ActionListener buildActionListener() {
- return new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JComboBox cb = (JComboBox) e.getSource();
- Object selectedItem = cb.getSelectedItem();
-
- // Only update the selected item and invoke immediateEdit() if the
- // selected item actually changed, during the initialization of the
- // editing, the model changes and causes this method to be invoked,
- // it causes CR#3963675 to occur because immediateEdit() stop the
- // editing, which is done at the wrong time
- if (ComboBoxTableCellRenderer.this.value != selectedItem) {
- ComboBoxTableCellRenderer.this.value = cb.getSelectedItem();
- ComboBoxTableCellRenderer.this.immediateEdit();
- }
- }
- };
- }
-
- void immediateEdit() {
- if (this.immediateEditListener != null) {
- this.immediateEditListener.immediateEdit();
- }
- }
-
- private PopupMenuListener buildPopupMenuListener() {
- return new PopupMenuListener() {
-
- public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
- cacheList();
- }
-
- public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
-
- }
-
- public void popupMenuCanceled(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
- }
- };
- }
-
-
- void cacheList() {
- this.model.cacheList();
- }
-
- void uncacheList() {
- this.model.uncacheList();
- }
-
- boolean listIsCached() {
- return this.model.isCached();
- }
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- this.fakeFocusFlag = selected || hasFocus;
- if (this.comboBox == null) {
- this.comboBox = this.buildComboBox();
-
- this.comboBox.setComponentOrientation(table.getComponentOrientation());
- this.comboBox.setModel(this.model);
- if (this.renderer != null) {
- this.comboBox.setRenderer(this.renderer);
- }
- this.comboBox.setFont(table.getFont());
- this.comboBox.setEnabled(table.isEnabled());
- this.comboBox.setBorder(this.border(table, val, selected, hasFocus, row, column));
- }
-
- // We need to go through the model since JComboBox might prevent us from
- // selecting the value. This can happen when the value is not contained
- // in the model, see CR#3950044 for an example
- this.model.setSelectedItem(val);
-
- return this.comboBox;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return defaultForeground;
- }
- return table.getSelectionForeground();
- }
- return defaultForeground;
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return defaultBackground;
- }
- return table.getSelectionBackground();
- }
- return defaultBackground;
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- return hasFocus ?
- UIManager.getBorder("Table.focusCellHighlightBorder")
- :
- NO_FOCUS_BORDER;
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return this.value;
- }
-
- public void setImmediateEditListener(TableCellEditorAdapter.ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
-
- // ********** public API **********
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the row height to something the combo-box will look good in....
- */
- public int preferredHeight() {
- return height;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java
deleted file mode 100644
index 492f18ffd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.text.Collator;
-import java.util.Comparator;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Used by general-purpose UI models and renderers to cast
- * application model objects to something displayable.
- */
-public interface Displayable
- extends Model, Comparable<Displayable>
-{
-
- /**
- * Return a string that can be used to identify the model
- * in a textual UI setting (typically the object's name).
- * When the display string changes, the model should fire
- * the appropriate change notification:
- * this.firePropertyChanged(DISPLAY_STRING_PROPERTY, oldDisplayString, this.displayString());
- */
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString";
-
- /**
- * Return an icon that can be used to identify the model
- * in a UI component that supports icons (the icon can be null).
- * When the icon changes, the model should fire
- * the appropriate change notification:
- * this.firePropertyChanged(ICON_PROPERTY, oldIcon, this.icon());
- */
- Icon icon();
- String ICON_PROPERTY = "icon";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- /**
- * Since all displayable objects must be comparable, provide a
- * typical comparator that can be used to sort a collection of
- * displayable objects.
- * Sort based on display string:
- * - identical objects are equal (which means they cannot
- * co-exist in a SortedSet)
- * - use the default collator (which typically interleaves
- * lower- and upper-case letters)
- * - allow duplicate display strings (from different objects)
- * - try to return consistent results for same object pairs
- */
- Comparator<Displayable> DEFAULT_COMPARATOR =
- new Comparator<Displayable>() {
- public int compare(Displayable d1, Displayable d2) {
- // disallow duplicates based on object identity
- if (d1 == d2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = DEFAULT_COLLATOR.compare(d1.displayString(), d2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(d1) - System.identityHashCode(d2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Displayable.DEFAULT_COMPARATOR";
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java
deleted file mode 100644
index 802251f212..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java
+++ /dev/null
@@ -1,55 +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.utility.internal.swing;
-
-import java.awt.Component;
-import java.awt.Graphics;
-
-import javax.swing.Icon;
-
-/**
- * Implement the Icon interface with an icon that has a size but
- * does not paint anything on the graphics context.
- */
-public class EmptyIcon
- implements Icon
-{
- private final int width;
- private final int height;
-
- public static final EmptyIcon NULL_INSTANCE = new EmptyIcon(0);
-
-
- public EmptyIcon(int width, int height) {
- super();
- this.width = width;
- this.height = height;
- }
-
- public EmptyIcon(int size) {
- this(size, size);
- }
-
-
- // ********** Icon implementation **********
-
- public void paintIcon(Component c, Graphics g, int x, int y) {
- // don't paint anything for an empty icon
- }
-
- public int getIconWidth() {
- return this.width;
- }
-
- public int getIconHeight() {
- return this.height;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java
deleted file mode 100644
index d59f3e04d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import javax.swing.Icon;
-import javax.swing.JComboBox;
-import javax.swing.JOptionPane;
-import javax.swing.ListModel;
-
-/**
- * This implementation of LongListComponent.Browser uses a
- * JOptionPane to prompt the user for the selection. The JOPtionPane
- * is passed a FilteringListPanel to assist the user in making
- * a selection.
- */
-public class FilteringListBrowser<T>
- implements ListChooser.ListBrowser
-{
- private FilteringListPanel<T> panel;
-
- /**
- * Default constructor.
- */
- public FilteringListBrowser() {
- super();
- this.panel = this.buildPanel();
- }
-
- protected FilteringListPanel<T> buildPanel() {
- return new LocalFilteringListPanel<T>();
- }
-
- /**
- * Prompt the user using a JOptionPane with a filtering
- * list panel.
- */
- public void browse(ListChooser chooser) {
- this.initializeCellRenderer(chooser);
-
- int option =
- JOptionPane.showOptionDialog(
- chooser,
- this.message(chooser),
- this.title(chooser),
- this.optionType(chooser),
- this.messageType(chooser),
- this.icon(chooser),
- this.selectionValues(chooser),
- this.initialSelectionValue(chooser)
- );
-
- if (option == JOptionPane.OK_OPTION) {
- chooser.getModel().setSelectedItem(this.panel.selection());
- }
-
- // clear the text field so the list box is re-filtered
- this.panel.textField().setText("");
- }
-
- protected void initializeCellRenderer(JComboBox comboBox) {
- // default behavior should be to use the cell renderer from the combobox.
- this.panel.listBox().setCellRenderer(comboBox.getRenderer());
- }
-
- /**
- * the message can be anything - here we build a component
- */
- protected Object message(JComboBox comboBox) {
- this.panel.setCompleteList(this.convertToArray(comboBox.getModel()));
- this.panel.setSelection(comboBox.getModel().getSelectedItem());
- return this.panel;
- }
-
- protected String title(JComboBox comboBox) {
- return null;
- }
-
- protected int optionType(JComboBox comboBox) {
- return JOptionPane.OK_CANCEL_OPTION;
- }
-
- protected int messageType(JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(JComboBox comboBox) {
- return null;
- }
-
- protected Object[] selectionValues(JComboBox comboBox) {
- return null;
- }
-
- protected Object initialSelectionValue(JComboBox comboBox) {
- return null;
- }
-
- /**
- * Convert the list of objects in the specified list model
- * into an array.
- */
- protected Object[] convertToArray(ListModel model) {
- int size = model.getSize();
- Object[] result = new Object[size];
- for (int i = 0; i < size; i++) {
- result[i] = model.getElementAt(i);
- }
- return result;
- }
-
-
- // ********** custom panel **********
-
- protected static class LocalFilteringListPanel<S> extends FilteringListPanel<S> {
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- protected LocalFilteringListPanel() {
- super(EMPTY_ARRAY, null);
- }
-
- /**
- * Disable the performance tweak because JOptionPane
- * will try open wide enough to disable the horizontal scroll bar;
- * and it looks a bit clumsy.
- */
- @Override
- protected String prototypeCellValue() {
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java
deleted file mode 100644
index af9a56dac8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Font;
-
-import javax.swing.AbstractListModel;
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListModel;
-import javax.swing.ListSelectionModel;
-import javax.swing.border.Border;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-import org.eclipse.jpt.utility.internal.SimpleStringMatcher;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.StringMatcher;
-
-/**
- * This panel presents an entry field and a list box of choices that
- * allows the user to filter the entries in the list box by entering
- * a pattern in the entry field.
- *
- * By default, two wildcards are allowed in the pattern:
- * '*' will match any set of zero or more characters
- * '?' will match any single character
- *
- * The panel consists of 4 components that can be customized:
- * - 1 text field
- * - 1 list box
- * - 2 labels, one for each of the above
- *
- * Other aspects of the panel's behavior can be changed:
- * - the string converter determines how the objects in the
- * list are converted to strings and compared to the pattern
- * entered in the text field; by default the converter simply
- * uses the result of the object's #toString() method
- * (if you replace the string converter, you will probably
- * want to replace the list box's cell renderer also)
- * - the string matcher can also be changed if you would
- * like different pattern matching behavior than that
- * described above
- * - you can specify the maximum size of the list - this may
- * force the user to enter a pattern restrictive enough
- * to result in a list smaller than the maximum size; the
- * default is -1, which disables the restriction
- *
- * This panel is not a typical panel, in the sense that it does not share
- * its model with clients via value models. Instead, this panel's model
- * is set and queried directly because it is designed to be used in a
- * dialog that directs the user's behavior (as opposed to a "normal"
- * window).
- */
-public class FilteringListPanel<T> extends JPanel {
-
- /**
- * The complete list of available choices
- * (as opposed to the partial list held by the list box).
- */
- private Object[] completeList;
-
- /**
- * An adapter used to convert the objects in the list
- * to strings so they can be run through the matcher
- * and displayed in the text field.
- */
- StringConverter<T> stringConverter;
-
- /** The text field. */
- private JTextField textField;
- private JLabel textFieldLabel;
- private DocumentListener textFieldListener;
-
- /** The list box. */
- private JList listBox;
- private JLabel listBoxLabel;
-
- /** The maximum number of entries displayed in the list box. */
- private int maxListSize;
-
- /**
- * The matcher used to filter the list against
- * the pattern entered in the text field. By default,
- * this allows the two wildcard characters described in
- * the class comment.
- */
- private StringMatcher stringMatcher;
-
- /**
- * Performance tweak: We use this buffer instead of
- * a temporary variable during filtering so we don't have
- * to keep re-allocating it.
- */
- private Object[] buffer;
-
- private static final Border TEXT_FIELD_LABEL_BORDER = BorderFactory.createEmptyBorder(0, 0, 5, 0);
- private static final Border LIST_BOX_LABEL_BORDER = BorderFactory.createEmptyBorder(5, 0, 5, 0);
-
-
- // ********** constructors **********
-
- /**
- * Construct a FilteringListPanel with the specified list of choices
- * and initial selection. Use the default string converter to convert the
- * choices and selection to strings (which simply calls #toString() on
- * the objects).
- */
- public FilteringListPanel(Object[] completeList, Object initialSelection) {
- this(completeList, initialSelection, StringConverter.Default.<T>instance());
- }
-
- /**
- * Construct a FilteringListPanel with the specified list of choices
- * and initial selection. Use the specified string converter to convert the
- * choices and selection to strings.
- */
- public FilteringListPanel(Object[] completeList, Object initialSelection, StringConverter<T> stringConverter) {
- super(new BorderLayout());
- this.completeList = completeList;
- this.stringConverter = stringConverter;
- this.initialize(initialSelection);
- }
-
-
- // ********** initialization **********
-
- private void initialize(Object initialSelection) {
- this.maxListSize = this.defaultMaxListSize();
- this.buffer = this.buildBuffer();
-
- this.textFieldListener = this.buildTextFieldListener();
-
- this.stringMatcher = this.buildStringMatcher();
-
- this.initializeLayout(initialSelection);
- }
-
- private Object[] buildBuffer() {
- return new Object[this.max()];
- }
-
- /**
- * Return the current max number of entries allowed in the list box.
- */
- private int max() {
- if (this.maxListSize == -1) {
- return this.completeList.length;
- }
- return Math.min(this.maxListSize, this.completeList.length);
- }
-
- /**
- * Build a listener that will listen to changes in the text field
- * and filter the list appropriately.
- */
- private DocumentListener buildTextFieldListener() {
- return new DocumentListener() {
- public void insertUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- public void changedUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- public void removeUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- @Override
- public String toString() {
- return "text field listener";
- }
- };
- }
-
- private int defaultMaxListSize() {
- return -1;
- }
-
- private StringMatcher buildStringMatcher() {
- return new SimpleStringMatcher<T>();
- }
-
- private void initializeLayout(Object initialSelection) {
- // text field
- JPanel textFieldPanel = new JPanel(new BorderLayout());
- this.textFieldLabel = new JLabel();
- this.textFieldLabel.setBorder(TEXT_FIELD_LABEL_BORDER);
- textFieldPanel.add(this.textFieldLabel, BorderLayout.NORTH);
-
- this.textField = new JTextField();
- this.textField.getDocument().addDocumentListener(this.textFieldListener);
- this.textFieldLabel.setLabelFor(this.textField);
- textFieldPanel.add(this.textField, BorderLayout.CENTER);
-
- this.add(textFieldPanel, BorderLayout.NORTH);
-
- // list box
- JPanel listBoxPanel = new JPanel(new BorderLayout());
- this.listBoxLabel = new JLabel();
- this.listBoxLabel.setBorder(LIST_BOX_LABEL_BORDER);
- listBoxPanel.add(this.listBoxLabel, BorderLayout.NORTH);
-
- this.listBox = new JList();
- this.listBox.setDoubleBuffered(true);
- this.listBox.setModel(this.buildPartialArrayListModel(this.completeList, this.max()));
- this.listBox.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- // performance tweak(?)
- this.listBox.setPrototypeCellValue(this.prototypeCellValue());
- this.listBox.setPrototypeCellValue(null);
- this.listBox.setCellRenderer(this.buildDefaultCellRenderer());
- this.listBoxLabel.setLabelFor(this.listBox);
- // bug 2777802 - scroll bars shouldn't be on the tab sequence
- JScrollPane listBoxScrollPane = new JScrollPane(this.listBox);
- listBoxScrollPane.getHorizontalScrollBar().setFocusable(false);
- listBoxScrollPane.getVerticalScrollBar().setFocusable(false);
- listBoxPanel.add(listBoxScrollPane, BorderLayout.CENTER);
-
- // initialize the widgets
- this.listBox.setSelectedValue(initialSelection, true);
- this.textField.select(0, this.textField.getText().length());
-
- this.add(listBoxPanel, BorderLayout.CENTER);
- }
-
-
- // ********** public API **********
-
- public Object selection() {
- return this.listBox.getSelectedValue();
- }
-
- public void setSelection(Object selection) {
- this.listBox.setSelectedValue(selection, true);
- }
-
- public Object[] completeList() {
- return this.completeList;
- }
-
- /**
- * rebuild the filtering buffer and re-apply the filter
- * to the new list
- */
- public void setCompleteList(Object[] completeList) {
- this.completeList = completeList;
- if (this.buffer.length < this.max()) {
- // the buffer will never shrink - might want to re-consider... ~bjv
- this.buffer = this.buildBuffer();
- }
- this.filterList();
- }
-
- public int maxListSize() {
- return this.maxListSize;
- }
-
- public void setMaxListSize(int maxListSize) {
- this.maxListSize = maxListSize;
- if (this.buffer.length < this.max()) {
- // the buffer will never shrink - might want to re-consider... ~bjv
- this.buffer = this.buildBuffer();
- }
- this.filterList();
- }
-
- public StringConverter<T> stringConverter() {
- return this.stringConverter;
- }
-
- /**
- * apply the new filter to the list
- */
- public void setStringConverter(StringConverter<T> stringConverter) {
- this.stringConverter = stringConverter;
- this.filterList();
- }
-
- /**
- * allow client code to access the text field
- * (so we can set the focus)
- */
- public JTextField textField() {
- return this.textField;
- }
-
- /**
- * allow client code to access the text field label
- */
- public JLabel textFieldLabel() {
- return this.textFieldLabel;
- }
-
- /**
- * convenience method
- */
- public void setTextFieldLabelText(String text) {
- this.textFieldLabel.setText(text);
- }
-
- /**
- * allow client code to access the list box
- * (so we can add mouse listeners for double-clicking)
- */
- public JList listBox() {
- return this.listBox;
- }
-
- /**
- * convenience method
- */
- public void setListBoxCellRenderer(ListCellRenderer renderer) {
- this.listBox.setCellRenderer(renderer);
- }
-
- /**
- * allow client code to access the list box label
- */
- public JLabel listBoxLabel() {
- return this.listBoxLabel;
- }
-
- /**
- * convenience method
- */
- public void setListBoxLabelText(String text) {
- this.listBoxLabel.setText(text);
- }
-
- /**
- * convenience method
- */
- public void setComponentsFont(Font font) {
- this.textFieldLabel.setFont(font);
- this.textField.setFont(font);
- this.listBoxLabel.setFont(font);
- this.listBox.setFont(font);
- }
-
- public StringMatcher stringMatcher() {
- return this.stringMatcher;
- }
-
- /**
- * re-apply the filter to the list
- */
- public void setStringMatcher(StringMatcher stringMatcher) {
- this.stringMatcher = stringMatcher;
- this.filterList();
- }
-
-
- // ********** internal methods **********
-
- /**
- * Allow subclasses to disable performance tweak
- * by returning null here.
- */
- protected String prototypeCellValue() {
- return "==========> A_STRING_THAT_IS_DEFINITELY_LONGER_THAN_EVERY_STRING_IN_THE_LIST <==========";
- }
-
- /**
- * By default, use the string converter to build the text
- * used by the list box's cell renderer.
- */
- protected ListCellRenderer buildDefaultCellRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- @SuppressWarnings("unchecked")
- protected String buildText(Object value) {
- return FilteringListPanel.this.stringConverter.convertToString((T) value);
- }
- };
- }
-
- /**
- * Something has changed that requires us to filter the list.
- *
- * This method is synchronized because a fast typist can
- * generate events quicker than we can filter the list. (? ~bjv)
- */
- synchronized void filterList() {
- // temporarily stop listening to the list box selection, since we will
- // be changing the selection during the filtering and don't want
- // that to affect the text field
- this.filterList(this.textField.getText());
- }
-
- /**
- * Filter the contents of the list box to match the
- * specified pattern.
- */
- private void filterList(String pattern) {
- if (pattern.length() == 0) {
- this.listBox.setModel(this.buildPartialArrayListModel(this.completeList, this.max()));
- } else {
- this.stringMatcher.setPatternString(pattern);
- int j = 0;
- int len = this.completeList.length;
- int max = this.max();
- for (int i = 0; i < len; i++) {
- if (this.stringMatcher.matches(this.stringConverter.convertToString(this.entry(i)))) {
- this.buffer[j++] = this.completeList[i];
- }
- if (j == max) {
- break;
- }
- }
- this.listBox.setModel(this.buildPartialArrayListModel(this.buffer, j));
- }
-
- // after filtering the list, determine the appropriate selection
- if (this.listBox.getModel().getSize() == 0) {
- this.listBox.getSelectionModel().clearSelection();
- } else {
- this.listBox.getSelectionModel().setAnchorSelectionIndex(0);
- this.listBox.getSelectionModel().setLeadSelectionIndex(0);
- this.listBox.ensureIndexIsVisible(0);
- }
- }
-
- /**
- * minimize scope of suppressed warnings
- */
- @SuppressWarnings("unchecked")
- private T entry(int index) {
- return (T) this.completeList[index];
- }
-
- /**
- * Build a list model that wraps only a portion of the specified array.
- * The model will include the array entries from 0 to (size - 1).
- */
- private ListModel buildPartialArrayListModel(final Object[] array, final int size) {
- return new AbstractListModel() {
- public int getSize() {
- return size;
- }
- public Object getElementAt(int index) {
- return array[index];
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java
deleted file mode 100644
index 2ddca8b367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.awt.AWTEvent;
-import java.awt.AWTException;
-import java.awt.Component;
-import java.awt.EventQueue;
-import java.awt.Point;
-import java.awt.Robot;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-import javax.swing.plaf.basic.BasicComboBoxUI;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-
-/**
- * This component provides a way to handle selecting an item from a
- * list that may grow too large to be handled conveniently by a combo-box.
- * If the list's size is less than the designated "long" list size,
- * the choice list will be displayed in a normal combo-box popup;
- * otherwise, a dialog will be used to prompt the user to choose a selection.
- *
- * To change the browse mechanism, subclasses may
- * - override the method #buildBrowser()
- * - override the method #browse(), in which case the method
- * #buildBrowser() may be ignored.
- */
-public class ListChooser
- extends JComboBox
-{
-
- /** the size of a "long" list - anything smaller is a "short" list */
- int longListSize = DEFAULT_LONG_LIST_SIZE;
-
- /** the default size of a "long" list, which is 20 (to match JOptionPane's behavior) */
- public static final int DEFAULT_LONG_LIST_SIZE = 20;
-
- /** property change associated with long list size */
- public static final String LONG_LIST_SIZE_PROPERTY = "longListSize";
-
- static JLabel prototypeLabel = new JLabel("Prototype", new EmptyIcon(17), SwingConstants.LEADING);
-
- /**
- * whether the chooser is choosable. if a chooser is not choosable,
- * it only serves as a display widget. a user may not change its
- * selected value.
- */
- boolean choosable = true;
-
- /** property change associated with choosable */
- public static final String CHOOSABLE_PROPERTY = "choosable";
-
- /** the browser used to make a selection from the long list - typically via a dialog */
- private ListBrowser browser;
-
- private NodeSelector nodeSelector;
-
- /** INTERNAL - The popup is being shown. Used to prevent infinite loop. */
- boolean popupAlreadyInProgress;
-
-
- // **************** Constructors ******************************************
-
- /**
- * Construct a list chooser for the specified model.
- */
- public ListChooser(ComboBoxModel model) {
- this(model, new NodeSelector.DefaultNodeSelector());
- }
-
- public ListChooser(CachingComboBoxModel model) {
- this(model, new NodeSelector.DefaultNodeSelector());
- }
-
- public ListChooser(ComboBoxModel model, NodeSelector nodeSelector) {
- this(new NonCachingComboBoxModel(model), nodeSelector);
- }
-
- public ListChooser(CachingComboBoxModel model, NodeSelector nodeSelector) {
- super(model);
- this.initialize();
- this.nodeSelector = nodeSelector;
- }
- // **************** Initialization ****************************************
-
- protected void initialize() {
- this.addPopupMenuListener(this.buildPopupMenuListener());
- this.setRenderer(new DefaultListCellRenderer());
- this.addKeyListener(buildF3KeyListener());
-
- //These are used to workaround problems with Swing trying to
- //determine the size of a comboBox with a large model
- setPrototypeDisplayValue(prototypeLabel);
- listBox().setPrototypeCellValue(prototypeLabel);
- }
-
-
- private JList listBox() {
- return (JList) ClassTools.fieldValue(this.ui, "listBox");
- }
-
- /**
- * When the popup is about to be shown, the event is consumed, and
- * PopupHandler determines whether to reshow the popup or to show
- * the long list browser.
- */
- private PopupMenuListener buildPopupMenuListener() {
- return new PopupMenuListener() {
- public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
- ListChooser.this.aboutToShowPopup();
- }
- public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
- // do nothing
- }
- public void popupMenuCanceled(PopupMenuEvent e) {
- // do nothing
- }
- @Override
- public String toString() {
- return "pop-up menu listener";
- }
- };
- }
-
- /**
- * If this code is being reached due to the PopupHandler already being in progress,
- * then do nothing. Otherwise, set the flag to true and launch the PopupHandler.
- */
- void aboutToShowPopup() {
- if (this.popupAlreadyInProgress) {
- return;
- }
-
- this.popupAlreadyInProgress = true;
- EventQueue.invokeLater(new PopupHandler());
- }
-
-
- private KeyListener buildF3KeyListener() {
- return new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_F3) {
- goToSelectedItem();
- }
- }
- @Override
- public String toString() {
- return "F3 key listener";
- }
- };
- }
-
- public void goToSelectedItem() {
- if (getSelectedItem() != null) {
- ListChooser.this.nodeSelector.selectNodeFor(getSelectedItem());
- }
- }
-
- // **************** Browsing **********************************************
-
- /**
- * Lazily initialize because subclasses may have further initialization to do
- * before browser can be built.
- */
- protected void browse() {
- if (this.browser == null) {
- this.browser = this.buildBrowser();
- }
-
- this.browser.browse(this);
- }
-
- /**
- * Return the "browser" used to make a selection from the long list,
- * typically via a dialog.
- */
- protected ListChooser.ListBrowser buildBrowser() {
- return new SimpleListBrowser();
- }
-
-
- // **************** Choosable functionality *******************************
-
- /** override behavior - consume selection if chooser is not choosable */
- @Override
- public void setSelectedIndex(int anIndex) {
- if (this.choosable) {
- super.setSelectedIndex(anIndex);
- }
- }
-
- private void updateArrowButton() {
- try {
- BasicComboBoxUI comboBoxUi = (BasicComboBoxUI) ListChooser.this.getUI();
- JButton arrowButton = (JButton) ClassTools.fieldValue(comboBoxUi, "arrowButton");
- arrowButton.setEnabled(this.isEnabled() && this.choosable);
- }
- catch (Exception e) {
- // this is a huge hack to try and make the combo box look right,
- // so if it doesn't work, just swallow the exception
- }
- }
-
-
- // **************** List Caching *******************************
-
- void cacheList() {
- ((CachingComboBoxModel) getModel()).cacheList();
- }
-
- void uncacheList() {
- ((CachingComboBoxModel) getModel()).uncacheList();
- }
-
- boolean listIsCached() {
- return ((CachingComboBoxModel) getModel()).isCached();
- }
-
- // **************** Public ************************************************
-
- public int longListSize() {
- return this.longListSize;
- }
-
- public void setLongListSize(int newLongListSize) {
- int oldLongListSize = this.longListSize;
- this.longListSize = newLongListSize;
- this.firePropertyChange(LONG_LIST_SIZE_PROPERTY, oldLongListSize, newLongListSize);
- }
-
- public boolean isChoosable() {
- return this.choosable;
- }
-
- public void setChoosable(boolean newValue) {
- boolean oldValue = this.choosable;
- this.choosable = newValue;
- this.firePropertyChange(CHOOSABLE_PROPERTY, oldValue, newValue);
- this.updateArrowButton();
- }
-
- // **************** Handle selecting null as a value **********************
-
- private boolean selectedIndexIsNoneSelectedItem(int index) {
- return index == -1 &&
- getModel().getSize() > 0 &&
- getModel().getElementAt(0) == null;
- }
-
- @Override
- public int getSelectedIndex() {
- boolean listNotCached = !listIsCached();
- if (listNotCached) {
- cacheList();
- }
-
- int index = super.getSelectedIndex();
-
- // Use index 0 to show the <none selected> item since the actual value is
- // null and JComboBox does not handle null values
- if (selectedIndexIsNoneSelectedItem(index)) {
- index = 0;
- }
-
- if (listNotCached) {
- uncacheList();
- }
- return index;
- }
-
- //wrap the renderer to deal with the prototypeDisplayValue
- @Override
- public void setRenderer(final ListCellRenderer aRenderer) {
- super.setRenderer(new ListCellRenderer(){
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if (value == prototypeLabel) {
- return prototypeLabel;
- }
- return aRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- });
- }
-
-
- // **************** Member classes ****************************************
-
- /**
- * Define the API required by this ListChooser when it must
- * prompt the user to select an item from the "long" list.
- */
- public interface ListBrowser
- {
- /**
- * Prompt the user to make a selection from the specified
- * combo-box's model.
- */
- void browse(ListChooser parentChooser);
- }
-
-
- /**
- * Runnable class that consumes popup window and determines whether
- * to reshow popup or to launch browser, based on the size of the list.
- */
- private class PopupHandler
- implements Runnable
- {
- /** The mouse event */
- private MouseEvent lastMouseEvent;
-
- /** The component from which the last mouse event was thrown */
- private JComponent eventComponent;
-
- /** The location of the component at the time the last mouse event was thrown */
- private Point componentLocation;
-
- /** The location of the mouse at the time the last mouse event was thrown */
- private Point mouseLocation;
-
-
- PopupHandler() {
- this.initialize();
- }
-
- private void initialize() {
- AWTEvent event = EventQueue.getCurrentEvent();
-
- if (event instanceof MouseEvent) {
- this.lastMouseEvent = (MouseEvent) event;
- this.eventComponent = (JComponent) this.lastMouseEvent.getSource();
- this.componentLocation = this.eventComponent.getLocationOnScreen();
- this.mouseLocation = this.lastMouseEvent.getPoint();
- }
- else {
- this.eventComponent = null;
- this.componentLocation = null;
- this.mouseLocation = null;
- }
- }
-
- public void run() {
- ListChooser.this.hidePopup();
-
- cacheList();
- if (ListChooser.this.choosable == true) {
- // If the combo box model is of sufficient length, the browser will be shown.
- // Asking the combo box model for its size should be enough to ensure that
- // its size is recalculated.
- if (ListChooser.this.getModel().getSize() > ListChooser.this.longListSize) {
- this.checkComboBoxButton();
- ListChooser.this.browse();
- }
- else {
- ListChooser.this.showPopup();
- this.checkMousePosition();
- }
- }
- if (listIsCached()) {
- uncacheList();
- }
-
- ListChooser.this.popupAlreadyInProgress = false;
- }
-
- /** If this is not done, the button never becomes un-pressed */
- private void checkComboBoxButton() {
- try {
- BasicComboBoxUI comboBoxUi = (BasicComboBoxUI) ListChooser.this.getUI();
- JButton arrowButton = (JButton) ClassTools.fieldValue(comboBoxUi, "arrowButton");
- arrowButton.getModel().setPressed(false);
- }
- catch (Exception e) {
- // this is a huge hack to try and make the combo box look right,
- // so if it doesn't work, just swallow the exception
- }
- }
-
- /**
- * Moves the mouse back to its original position before any jiggery pokery that we've done.
- */
- private void checkMousePosition() {
- if (this.eventComponent == null) {
- return;
- }
-
- final Point newComponentLocation = this.eventComponent.getLocationOnScreen();
- boolean componentMoved =
- newComponentLocation.x - this.componentLocation.x != 0
- || newComponentLocation.y - this.componentLocation.y != 0;
-
- if (componentMoved) {
- try {
- new Robot().mouseMove(
- newComponentLocation.x + this.mouseLocation.x,
- newComponentLocation.y + this.mouseLocation.y
- );
- }
- catch (AWTException ex) {
- // move failed - do nothing
- }
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java
deleted file mode 100644
index f8b4d148e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java
+++ /dev/null
@@ -1,32 +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.utility.internal.swing;
-
-/**
- * This will be called when the user presses F3 or chooses
- * 'Go To' in the context menu
- */
-public interface NodeSelector
-{
- /**
- * Select the appropriate Node in the tree or the editor panel.
- */
- void selectNodeFor(Object item);
-
- /**
- * This NodeSelector will do nothing when selectNodeFor(Object) is called
- */
- class DefaultNodeSelector implements NodeSelector {
-
- public void selectNodeFor(Object item) {
- //default is to do nothing
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java
deleted file mode 100644
index ee7226457f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java
+++ /dev/null
@@ -1,73 +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.utility.internal.swing;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.event.ListDataListener;
-
-/**
- * This implementation of the CachingComboBoxModel interface can be used
- * whenever there is no need for caching (i.e. the contents of the selection
- * list can be generated with little latency). All the normal ComboBoxModel
- * behavior is delegated to a client-supplied ComboBoxModel.
- */
-public class NonCachingComboBoxModel implements CachingComboBoxModel {
- private ComboBoxModel wrappedComboBoxModel;
-
- public NonCachingComboBoxModel(ComboBoxModel wrappedComboBoxModel) {
- this.wrappedComboBoxModel = wrappedComboBoxModel;
- }
-
-
- // ********** CachingComboBoxModel implementation **********
-
- public void cacheList() {
- //do nothing
- }
-
- public void uncacheList() {
- //do nothing
- }
-
- public boolean isCached() {
- return false;
- }
-
-
- // ********** ComboBoxModel implementation **********
-
- public void setSelectedItem(Object anItem) {
- this.wrappedComboBoxModel.setSelectedItem(anItem);
- }
-
- public Object getSelectedItem() {
- return this.wrappedComboBoxModel.getSelectedItem();
- }
-
-
- // ********** ListModel implementation **********
-
- public int getSize() {
- return this.wrappedComboBoxModel.getSize();
- }
-
- public Object getElementAt(int index) {
- return this.wrappedComboBoxModel.getElementAt(index);
- }
-
- public void addListDataListener(ListDataListener l) {
- this.wrappedComboBoxModel.addListDataListener(l);
- }
-
- public void removeListDataListener(ListDataListener l) {
- this.wrappedComboBoxModel.removeListDataListener(l);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
deleted file mode 100644
index d46d8e12e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
+++ /dev/null
@@ -1,178 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-/**
- * This implementation of Displayable converts any Object
- * to a Displayable. Subclass it to override #displayString() and
- * #icon() if necessary. Change notification will be fired if the
- * object is changed.
- *
- * This can be used for Strings - the display string
- * will simply be the String itself.
- */
-public class SimpleDisplayable
- extends AbstractModel
- implements Displayable
-{
- /** The object to be converted to a Displayable. */
- protected Object object;
-
-
- /**
- * Construct a displayable for the specified object.
- */
- public SimpleDisplayable(Object object) {
- super();
- this.object = object;
- }
-
- public SimpleDisplayable(boolean b) {
- this(Boolean.valueOf(b));
- }
-
- public SimpleDisplayable(char c) {
- this(new Character(c));
- }
-
- public SimpleDisplayable(byte b) {
- this(new Byte(b));
- }
-
- public SimpleDisplayable(short s) {
- this(new Short(s));
- }
-
- public SimpleDisplayable(int i) {
- this(new Integer(i));
- }
-
- public SimpleDisplayable(long l) {
- this(new Long(l));
- }
-
- public SimpleDisplayable(float f) {
- this(new Float(f));
- }
-
- public SimpleDisplayable(double d) {
- this(new Double(d));
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.object.toString();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
-
- // ********** accessors **********
-
- public Object getObject() {
- return this.object;
- }
-
- public void setObject(Object object) {
- String oldDisplayString = this.displayString();
- Icon oldIcon = this.icon();
- this.object = object;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, oldDisplayString, this.displayString());
- this.firePropertyChanged(ICON_PROPERTY, oldIcon, this.icon());
- }
-
- public boolean getBoolean() {
- return ((Boolean) this.object).booleanValue();
- }
-
- public void setBoolean(boolean b) {
- this.setObject(Boolean.valueOf(b));
- }
-
- public char getChar() {
- return ((Character) this.object).charValue();
- }
-
- public void setChar(char c) {
- this.setObject(new Character(c));
- }
-
- public byte getByte() {
- return ((Byte) this.object).byteValue();
- }
-
- public void setByte(byte b) {
- this.setObject(new Byte(b));
- }
-
- public short getShort() {
- return ((Short) this.object).shortValue();
- }
-
- public void setShort(short s) {
- this.setObject(new Short(s));
- }
-
- public int getInt() {
- return ((Integer) this.object).intValue();
- }
-
- public void setInt(int i) {
- this.setObject(new Integer(i));
- }
-
- public long getLong() {
- return ((Long) this.object).longValue();
- }
-
- public void setLong(long l) {
- this.setObject(new Long(l));
- }
-
- public float getFloat() {
- return ((Float) this.object).floatValue();
- }
-
- public void setFloat(float f) {
- this.setObject(new Float(f));
- }
-
- public double getDouble() {
- return ((Double) this.object).doubleValue();
- }
-
- public void setDouble(double d) {
- this.setObject(new Double(d));
- }
-
-
- // ********** override methods **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.object);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java
deleted file mode 100644
index 7215c6a387..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java
+++ /dev/null
@@ -1,86 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-import javax.swing.JComboBox;
-import javax.swing.JOptionPane;
-import javax.swing.ListModel;
-
-/**
- * This implementation of ListChooser.Browser uses a
- * JOptionPane to prompt the user for the selection. Subclasses
- * can change the dialog's title, message, and/or icon.
- */
-public class SimpleListBrowser
- implements ListChooser.ListBrowser
-{
- /** Default constructor */
- protected SimpleListBrowser() {
- super();
- }
-
- /**
- * Prompt the user using a JOptionPane.
- */
- public void browse(ListChooser chooser) {
- Object selection =
- JOptionPane.showInputDialog(
- chooser,
- this.message(chooser),
- this.title(chooser),
- this.messageType(chooser),
- this.icon(chooser),
- this.selectionValues(chooser),
- this.initialSelectionValue(chooser)
- );
-
- if (selection != null) {
- chooser.getModel().setSelectedItem(selection);
- }
- }
-
- protected Object message(JComboBox comboBox) {
- return null;
- }
-
- protected String title(JComboBox comboBox) {
- return null;
- }
-
- protected int messageType(JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(JComboBox comboBox) {
- return null;
- }
-
- protected Object[] selectionValues(JComboBox comboBox) {
- return this.convertToArray(comboBox.getModel());
- }
-
- protected Object initialSelectionValue(JComboBox comboBox) {
- return comboBox.getModel().getSelectedItem();
- }
-
- /**
- * Convert the list of objects in the specified list model
- * into an array.
- */
- protected Object[] convertToArray(ListModel model) {
- int size = model.getSize();
- Object[] result = new Object[size];
- for (int i = 0; i < size; i++) {
- result[i] = model.getElementAt(i);
- }
- return result;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java
deleted file mode 100644
index facf5d3c65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.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.utility.internal.swing;
-
-import java.awt.Component;
-
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.Icon;
-import javax.swing.JList;
-
-/**
- * This renderer should behave the same as the DefaultListCellRenderer;
- * but it slightly refactors the calculation of the icon and text of the list
- * cell so that subclasses can easily override the methods that build
- * the icon and text.
- *
- * In most cases, you need only override:
- * #buildIcon(Object value)
- * #buildText(Object value)
- */
-public class SimpleListCellRenderer
- extends DefaultListCellRenderer
-{
-
- /**
- * Construct a simple renderer.
- */
- public SimpleListCellRenderer() {
- super();
- }
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- // substitute null for the cell value so nothing is drawn initially...
- super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
- this.setOpaque(true);
-
- // ...then set the icon and text manually
- this.setIcon(this.buildIcon(list, value, index, isSelected, cellHasFocus));
- this.setText(this.buildText(list, value, index, isSelected, cellHasFocus));
-
- this.setToolTipText(this.buildToolTipText(list, value, index, isSelected, cellHasFocus));
-
- // the context will be initialized only if a reader is running
- if (this.accessibleContext != null) {
- this.accessibleContext.setAccessibleName(this.buildAccessibleName(list, value, index, isSelected, cellHasFocus));
- }
-
- return this;
- }
-
- /**
- * Return the icon representation of the specified cell
- * value and other settings. (Even more settings are
- * accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected Icon buildIcon(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- return this.buildIcon(value);
- }
-
- /**
- * Return the icon representation of the specified cell
- * value. The default is to display no icon at all unless the
- * value itself is an icon.
- */
- protected Icon buildIcon(Object value) {
- // replicate the default behavior
- return (value instanceof Icon) ? (Icon) value : null;
- }
-
- /**
- * Return the textual representation of the specified cell
- * value and other settings. (Even more settings are
- * accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildText(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- return this.buildText(value);
- }
-
- /**
- * Return the textual representation of the specified cell
- * value. The default is to display the object's default string
- * representation (as returned by #toString()); unless the
- * value itself is an icon, in which case no text is displayed.
- */
- protected String buildText(Object value) {
- return (value instanceof Icon) ? "" : ((value == null) ? "" : value.toString());
- }
-
- /**
- * Return the text displayed when the cursor lingers over the specified cell.
- * (Even more settings are accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildToolTipText(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- return this.buildToolTipText(value);
- }
-
- /**
- * Return the text displayed when the cursor lingers over the specified cell.
- */
- protected String buildToolTipText(Object value) {
- return null;
- }
-
- /**
- * Return the accessible name to be given to the component used to render
- * the given value and other settings. (Even more settings are accessible via
- * inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildAccessibleName(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- return this.buildAccessibleName(value);
- }
-
- /**
- * Return the accessible name to be given to the component used to render
- * the given value.
- */
- protected String buildAccessibleName(Object value) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
deleted file mode 100644
index ad071e4ac9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-
-import javax.swing.BorderFactory;
-import javax.swing.JComponent;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.SpinnerModel;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-/**
- * Make the cell look like a spinner.
- */
-public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /** the component used to paint the cell */
- protected JSpinner spinner;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a cell renderer that uses the default
- * spinner model, which is a "number" model.
- */
- public SpinnerTableCellRenderer() {
- super();
- this.initialize();
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * spinner model, which will determine how the values are displayed.
- */
- public SpinnerTableCellRenderer(SpinnerModel model) {
- this();
- this.setModel(model);
- }
-
- protected void initialize() {
- this.spinner = this.buildSpinner();
- }
-
- protected JSpinner buildSpinner() {
- JSpinner s = new JSpinner();
- s.addChangeListener(this.buildChangeListener());
- return s;
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeListener() {
- public void stateChanged(ChangeEvent e) {
- if (SpinnerTableCellRenderer.this.immediateEditListener != null) {
- SpinnerTableCellRenderer.this.immediateEditListener.immediateEdit();
- }
- }
- };
- }
-
-
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- this.spinner.setComponentOrientation(table.getComponentOrientation());
- this.spinner.setFont(table.getFont());
- this.spinner.setEnabled(table.isEnabled());
-
- JComponent editor = this.editor();
- editor.setForeground(this.foregroundColor(table, value, selected, hasFocus, row, column));
- editor.setBackground(this.backgroundColor(table, value, selected, hasFocus, row, column));
- this.spinner.setBorder(this.border(table, value, selected, hasFocus, row, column));
-
- this.setValue(value);
- return this.spinner;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground");
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground");
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (hasFocus) {
- return UIManager.getBorder("Table.focusCellHighlightBorder");
- }
- if (selected) {
- return BorderFactory.createLineBorder(table.getSelectionBackground(), 1);
- }
- return BorderFactory.createLineBorder(table.getBackground(), 1);
- }
-
- /**
- * Return the editor component whose colors should be set
- * by the renderer.
- */
- protected JComponent editor() {
- JComponent editor = this.spinner.getEditor();
- if (editor instanceof JSpinner.DefaultEditor) {
- // typically, the editor will be the default or one of its subclasses...
- editor = ((JSpinner.DefaultEditor) editor).getTextField();
- }
- return editor;
- }
-
- /**
- * Set the spinner's value
- */
- protected void setValue(Object value) {
- // CR#3999318 - This null check needs to be removed once JDK bug is fixed
- if (value == null) {
- value = new Integer(0);
- }
- this.spinner.setValue(value);
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return this.spinner.getValue();
- }
-
- public void setImmediateEditListener(TableCellEditorAdapter.ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
-
- // ********** public API **********
-
- /**
- * Set the spinner's model.
- */
- public void setModel(SpinnerModel model) {
- this.spinner.setModel(model);
- }
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the row height to something the spinner will look good in....
- */
- public int preferredHeight() {
- // add in space for the border top and bottom
- return (int) this.spinner.getPreferredSize().getHeight() + 2;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java
deleted file mode 100644
index 0118692cc8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java
+++ /dev/null
@@ -1,97 +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.utility.internal.swing;
-
-import java.awt.Component;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JTable;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
-
-/**
- * A table cell editor that wraps a table cell renderer.
- */
-public class TableCellEditorAdapter extends AbstractCellEditor implements TableCellEditor {
-
- /** delegate to a renderer */
- private Renderer renderer;
-
-
- // ********** constructors/initialization **********
-
- private TableCellEditorAdapter() {
- super();
- }
-
- /**
- * Construct a cell editor that behaves like the specified renderer.
- */
- public TableCellEditorAdapter(Renderer renderer) {
- this();
- this.initialize(renderer);
- }
-
- protected void initialize(Renderer r) {
- this.renderer = r;
- r.setImmediateEditListener(this.buildImmediateEditListener());
- }
-
- private ImmediateEditListener buildImmediateEditListener() {
- return new ImmediateEditListener() {
- public void immediateEdit() {
- TableCellEditorAdapter.this.stopCellEditing();
- }
- };
- }
-
-
- // ********** CellEditor implementation **********
-
- public Object getCellEditorValue() {
- return this.renderer.getValue();
- }
-
-
- // ********** TableCellEditor implementation **********
-
- public Component getTableCellEditorComponent(JTable table, Object value, boolean selected, int row, int column) {
- return this.renderer.getTableCellRendererComponent(table, value, selected, true, row, column);
- }
-
-
- // ********** Member classes **********************************************
-
- /**
- * This interface defines the methods that must be implemented by a renderer
- * that can be wrapped by a TableCellEditorAdapter.
- */
- public interface Renderer extends TableCellRenderer {
-
- /**
- * Return the current value of the renderer.
- */
- Object getValue();
-
- /**
- * Set the immediate edit listener
- */
- void setImmediateEditListener(ImmediateEditListener listener);
- }
-
-
- public interface ImmediateEditListener {
-
- /**
- * Called when the renderer does an "immediate edit"
- */
- void immediateEdit();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
deleted file mode 100644
index 33f2fd2afd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model;
-
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Interface to be implemented by models that notify listeners of
- * changes to bound properties, collections, lists, and/or trees.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Model {
-
- // ********** state change **********
-
- /**
- * Add a listener that listens to all state change events.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addStateChangeListener(StateChangeListener listener);
-
- /**
- * Remove the specified state change listener. If the listener
- * was added more than once, it will be notified one less time
- * after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeStateChangeListener(StateChangeListener listener);
-
-
- // ********** property change **********
-
- /**
- * Add a listener that listens to all property change events,
- * regardless of the property name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Add a listener that listens to all property change events with
- * the specified property name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
- /**
- * Remove a listener that listens to all property change events,
- * regardless of the property name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Remove a listener that listens to all property change events,
- * with the specified property name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
-
- // ********** collection change **********
-
- /**
- * Add a listener that listens to all collection change events,
- * regardless of the collection name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addCollectionChangeListener(CollectionChangeListener listener);
-
- /**
- * Add a listener that listens to all collection change events with
- * the specified collection name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addCollectionChangeListener(String collectionName, CollectionChangeListener listener);
-
- /**
- * Remove a listener that listens to all collection change events,
- * regardless of the collection name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeCollectionChangeListener(CollectionChangeListener listener);
-
- /**
- * Remove a listener that listens to all collection change events,
- * with the specified collection name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener);
-
-
- // ********** list change **********
-
- /**
- * Add a listener that listens to all list change events,
- * regardless of the list name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addListChangeListener(ListChangeListener listener);
-
- /**
- * Add a listener that listens to all list change events with
- * the specified list name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addListChangeListener(String listName, ListChangeListener listener);
-
- /**
- * Remove a listener that listens to all list change events,
- * regardless of the list name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeListChangeListener(ListChangeListener listener);
-
- /**
- * Remove a listener that listens to all list change events,
- * with the specified list name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeListChangeListener(String listName, ListChangeListener listener);
-
-
- // ********** tree change **********
-
- /**
- * Add a listener that listens to all tree change events,
- * regardless of the tree name associated with that event.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addTreeChangeListener(TreeChangeListener listener);
-
- /**
- * Add a listener that listens to all tree change events with
- * the specified tree name.
- * The same listener may be added more than once and will be called
- * as many times as it is added. The listener cannot be null.
- */
- void addTreeChangeListener(String treeName, TreeChangeListener listener);
-
- /**
- * Remove a listener that listens to all tree change events,
- * regardless of the tree name associated with that event.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeTreeChangeListener(TreeChangeListener listener);
-
- /**
- * Remove a listener that listens to all tree change events,
- * with the specified tree name.
- * If the listener was added more than once, it will be notified one less
- * time after being removed. An exception will be thrown if the
- * listener is null or if the listener was never added.
- */
- void removeTreeChangeListener(String treeName, TreeChangeListener listener);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java
deleted file mode 100644
index a45501d011..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import java.util.EventObject;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Abstract class for all the change events that can be fired by models.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class ChangeEvent extends EventObject {
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a new change event.
- *
- * @param source The object on which the event initially occurred.
- */
- protected ChangeEvent(Model source) {
- super(source);
- }
-
- /**
- * Covariant override.
- */
- @Override
- public Model getSource() {
- return (Model) super.getSource();
- }
-
- /**
- * Return the name of the aspect of the source that changed.
- * May be null if inappropriate.
- */
- public abstract String aspectName();
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public abstract ChangeEvent cloneWithSource(Model newSource);
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.aspectName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java
deleted file mode 100644
index 8ae2d57491..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection change" event gets delivered whenever a model changes a "bound"
- * or "constrained" collection. A CollectionChangeEvent is sent as an
- * argument to the CollectionChangeListener.
- *
- * Normally a CollectionChangeEvent is accompanied by the collection name and
- * the items that were added to or removed from the changed collection.
- *
- * Design options:
- * - create a collection to wrap a single added or removed item
- * (this is the option we implemented below and in collaborating code)
- * since there is no way to optimize downstream code for
- * single items, we take another performance hit by building
- * a collection each time (@see Collections#singleton(Object))
- * and forcing downstream code to use an iterator every time
- *
- * - fire a separate event for each item added or removed
- * eliminates any potential for optimizations to downstream code
- *
- * - add protocol to support both single items and collections
- * adds conditional logic to downstream code
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class CollectionChangeEvent extends ChangeEvent {
-
- /** Name of the collection that changed. */
- private final String collectionName;
-
- /** The items that were added to or removed from the collection. May be empty, if not known. */
- private final Collection<?> items;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new collection change event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- * @param items The items that were added to or removed from the collection.
- */
- public CollectionChangeEvent(Model source, String collectionName, Collection<?> items) {
- super(source);
- if ((collectionName == null) || (items == null)) {
- throw new NullPointerException();
- }
- this.collectionName = collectionName;
- this.items = Collections.unmodifiableCollection(items);
- }
-
- /**
- * Construct a new collection change event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- */
- public CollectionChangeEvent(Model source, String collectionName) {
- this(source, collectionName, Collections.emptySet());
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the collection that was changed.
- */
- public String collectionName() {
- return this.collectionName;
- }
-
- @Override
- public String aspectName() {
- return this.collectionName;
- }
-
- /**
- * Return an iterator on the items that were added to or
- * removed from the collection.
- * May be empty if inappropriate or unknown.
- */
- public Iterator<?> items() {
- return this.items.iterator();
- }
-
- /**
- * Return the number of items that were added to or
- * removed from the collection.
- * May be 0 if inappropriate or unknown.
- */
- public int itemsSize() {
- return this.items.size();
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- @Override
- public CollectionChangeEvent cloneWithSource(Model newSource) {
- return new CollectionChangeEvent(newSource, this.collectionName, this.items);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionChangeEvent cloneWithSource(Model newSource, String newCollectionName) {
- return new CollectionChangeEvent(newSource, newCollectionName, this.items);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java
deleted file mode 100644
index 152b268e95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list change" event gets delivered whenever a model changes a "bound"
- * or "constrained" list. A ListChangeEvent is sent as an
- * argument to the ListChangeListener.
- *
- * Normally a ListChangeEvent is accompanied by the list name,
- * the items that were added to or removed from the changed list,
- * and the index of where the items are or were in the list.
- *
- * Design options:
- * - create a list to wrap a single added or removed item
- * (this is the option we implemented below and in collaborating code)
- * since there is no way to optimize downstream code for
- * single items, we take another performance hit by building
- * a list each time (@see Collections#singletonList(Object))
- * and forcing downstream code to use a list iterator every time
- *
- * - fire a separate event for each item added or removed
- * eliminates any potential for optimizations to downstream code
- *
- * - add protocol to support both single items and collections
- * adds conditional logic to downstream code
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ListChangeEvent extends ChangeEvent {
-
- /**
- * Name of the list that changed.
- */
- private final String listName;
-
- /**
- * The index at which the items were added, removed, or replaced.
- * In the case of "moved" items, this will be the "target" index.
- * May be -1, if not known.
- */
- private final int index;
-
- /**
- * The items that were added to or removed from the list. In the case of
- * "replaced" items, these are the new items in the list.
- * In the case of "moved" items, this will be empty.
- * May be empty, if not known.
- */
- private final List<?> items;
-
- /**
- * The items in the list that were replaced by the items listed above,
- * in #items. May be empty, if not known.
- */
- private final List<?> replacedItems;
-
- /**
- * In the case of "moved" items, this will be the "source" index.
- * May be -1, if not known.
- */
- private final int sourceIndex;
-
- /**
- * In the case of "moved" items, this will be the number of items moved.
- * May be -1, if not known.
- */
- private final int moveLength;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- protected ListChangeEvent(Model source, String listName, int index, List<?> items, List<?> replacedItems, int sourceIndex, int moveLength) {
- super(source);
- if ((listName == null) || (items == null) || (replacedItems == null)) {
- throw new NullPointerException();
- }
- this.listName = listName;
- this.index = index;
- this.items = Collections.unmodifiableList(items);
- this.replacedItems = Collections.unmodifiableList(replacedItems);
- this.sourceIndex = sourceIndex;
- this.moveLength = moveLength;
- }
-
- /**
- * Construct a new list change event for a list of replaced items.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the items in the list were replaced.
- * @param items The new items in the list.
- * @param replacedItems The items in the list that were replaced.
- */
- public ListChangeEvent(Model source, String listName, int index, List<?> items, List<?> replacedItems) {
- this(source, listName, index, items, replacedItems, -1, -1);
- }
-
- /**
- * Construct a new list change event for a list of added or removed items.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the items were added to or removed from the list.
- * @param items The items that were added to or removed from the list.
- */
- public ListChangeEvent(Model source, String listName, int index, List<?> items) {
- this(source, listName, index, items, Collections.emptyList(), -1, -1);
- }
-
- /**
- * Construct a new list change event for a list of moved items.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param targetIndex The index to which the items were moved.
- * @param sourceIndex The index from which the items were moved.
- */
- public ListChangeEvent(Model source, String listName, int targetIndex, int sourceIndex, int length) {
- this(source, listName, targetIndex, Collections.emptyList(), Collections.emptyList(), sourceIndex, length);
- }
-
- /**
- * Construct a new list change event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- */
- public ListChangeEvent(Model source, String listName) {
- this(source, listName, -1, Collections.emptyList(), Collections.emptyList(), -1, -1);
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the list that was changed.
- */
- public String listName() {
- return this.listName;
- }
-
- @Override
- public String aspectName() {
- return this.listName;
- }
-
- /**
- * Return the index at which the items were added to, removed from,
- * or replaced in the list.
- * In the case of "moved" items, this will be the "target" index.
- * May be -1 if inappropriate or unknown.
- */
- public int index() {
- return this.index;
- }
-
- /**
- * Return a list iterator on the items that were added to or
- * removed from the list. In the case of "replaced" items, these
- * are the new items in the list.
- * May be empty if inappropriate or unknown.
- */
- public ListIterator<?> items() {
- return this.items.listIterator();
- }
-
- /**
- * Return the number of items that were added to,
- * removed from, or replaced in the list.
- * May be 0 if inappropriate or unknown.
- */
- public int itemsSize() {
- return this.items.size();
- }
-
-
- // ********** replace **********
-
- /**
- * Return a list iterator on the items in the list that were replaced.
- * May be empty if inappropriate or unknown.
- */
- public ListIterator<?> replacedItems() {
- return this.replacedItems.listIterator();
- }
-
-
- // ********** move **********
-
- /**
- * In the case of "moved" items, this will be the "target" index.
- * May be -1 if inappropriate or unknown.
- */
- public int targetIndex() {
- return this.index;
- }
-
- /**
- * In the case of "moved" items, this will be the "source" index.
- * May be -1 if inappropriate or unknown.
- */
- public int sourceIndex() {
- return this.sourceIndex;
- }
-
- /**
- * In the case of "moved" items, this will be the number of items moved.
- * May be -1 if inappropriate or unknown.
- */
- public int moveLength() {
- return this.moveLength;
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- @Override
- public ListChangeEvent cloneWithSource(Model newSource) {
- return new ListChangeEvent(newSource, this.listName, this.index, this.items, this.replacedItems, this.sourceIndex, this.moveLength);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListChangeEvent cloneWithSource(Model newSource, String newListName) {
- return new ListChangeEvent(newSource, newListName, this.index, this.items, this.replacedItems, this.sourceIndex, this.moveLength);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name and displacing
- * the index by the specified amount.
- */
- public ListChangeEvent cloneWithSource(Model newSource, String newListName, int offset) {
- return new ListChangeEvent(newSource, newListName, this.index + offset, this.items, this.replacedItems, this.sourceIndex + offset, this.moveLength);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java
deleted file mode 100644
index f25d0f98e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "property change" event gets delivered whenever a model changes a "bound"
- * or "constrained" property. A PropertyChangeEvent is sent as an
- * argument to the PropertyChangeListener.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class PropertyChangeEvent extends ChangeEvent {
-
- /** Name of the property that changed. */
- private final String propertyName;
-
- /** The property's old value, before the change. */
- private final Object oldValue;
-
- /** The property's new value, after the change. */
- private final Object newValue;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new property change event.
- *
- * @param source The object on which the event initially occurred.
- * @param propertyName The programmatic name of the property that was changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
- */
- public PropertyChangeEvent(Model source, String propertyName, Object oldValue, Object newValue) {
- super(source);
- if (propertyName == null) {
- throw new NullPointerException();
- }
- this.propertyName = propertyName;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the property that was changed.
- */
- public String propertyName() {
- return this.propertyName;
- }
-
- @Override
- public String aspectName() {
- return this.propertyName;
- }
-
- /**
- * Return the old value of the property.
- */
- public Object oldValue() {
- return this.oldValue;
- }
-
- /**
- * Return the new value of the property.
- */
- public Object newValue() {
- return this.newValue;
- }
-
-
- // ********** cloning **********
-
- @Override
- public PropertyChangeEvent cloneWithSource(Model newSource) {
- return new PropertyChangeEvent(newSource, this.propertyName, this.oldValue, this.newValue);
- }
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source and the property name.
- */
- public PropertyChangeEvent cloneWithSource(Model newSource, String newPropertyName) {
- return new PropertyChangeEvent(newSource, newPropertyName, this.oldValue, this.newValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java
deleted file mode 100644
index 2f2f66a3e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A generic "state change" event gets delivered whenever a model changes to
- * such extent that it cannot be delineated all aspects of it that have changed.
- * A StateChangeEvent is sent as an argument to the StateChangeListener.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class StateChangeEvent extends ChangeEvent {
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new state change event.
- *
- * @param source The object on which the event initially occurred.
- */
- public StateChangeEvent(Model source) {
- super(source);
- }
-
-
- // ********** standard state **********
-
- @Override
- public String aspectName() {
- return null; // the point of the event is that the name is unknown...
- }
-
-
- // ********** cloning **********
-
- @Override
- public StateChangeEvent cloneWithSource(Model newSource) {
- return new StateChangeEvent(newSource);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java
deleted file mode 100644
index 69551db6a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree change" event gets delivered whenever a model changes a "bound"
- * or "constrained" tree. A TreeChangeEvent is sent as an
- * argument to the TreeChangeListener.
- *
- * Normally a TreeChangeEvent is accompanied by the tree name and a path
- * to the part of the tree that was changed.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class TreeChangeEvent extends ChangeEvent {
-
- /** Name of the tree that changed. */
- private final String treeName;
-
- /**
- * Path to the parent of the part of the tree that was changed.
- * May be empty, if not known or if the entire tree changed.
- */
- protected final Object[] path;
-
- private static final Object[] EMPTY_PATH = new Object[0];
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new tree change event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- * @param path The path to the part of the tree that was changed.
- */
- public TreeChangeEvent(Model source, String treeName, Object[] path) {
- super(source);
- if ((treeName == null) || (path == null)) {
- throw new NullPointerException();
- }
- this.treeName = treeName;
- this.path = path;
- }
-
- /**
- * Construct a new tree change event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- */
- public TreeChangeEvent(Model source, String treeName) {
- this(source, treeName, EMPTY_PATH);
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the tree that was changed.
- */
- public String treeName() {
- return this.treeName;
- }
-
- @Override
- public String aspectName() {
- return this.treeName;
- }
-
- /**
- * Return the path to the part of the tree that was changed.
- * May be empty, if not known.
- */
- public Object[] path() {
- return this.path;
- }
-
-
- // ********** cloning **********
-
- @Override
- public TreeChangeEvent cloneWithSource(Model newSource) {
- return new TreeChangeEvent(newSource, this.treeName, this.path);
- }
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source and the tree name.
- */
- public TreeChangeEvent cloneWithSource(Model newSource, String newTreeName) {
- return new TreeChangeEvent(newSource, newTreeName, this.path);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java
deleted file mode 100644
index d29a7a7de2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import java.util.EventListener;
-
-/**
- * Marker interface.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ChangeListener extends EventListener {
- // nothing for now
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java
deleted file mode 100644
index 2cd636456b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-
-/**
- * Convenience implementation of CollectionChangeListener.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class CollectionChangeAdapter implements CollectionChangeListener {
-
- /**
- * Default constructor.
- */
- public CollectionChangeAdapter() {
- super();
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- // do nothing
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- // do nothing
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java
deleted file mode 100644
index 210388b923..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-
-/**
- * A "collection change" event gets fired whenever a model changes a "bound"
- * collection. You can register a CollectionChangeListener with a source
- * model so as to be notified of any bound collection updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface CollectionChangeListener extends ChangeListener {
-
- /**
- * This method gets called when items are added to a bound collection.
- *
- * @param event A CollectionChangeEvent describing the event source,
- * the collection that changed, and the items that were added.
- */
- void itemsAdded(CollectionChangeEvent event);
-
- /**
- * This method gets called when items are removed from a bound collection.
- *
- * @param event A CollectionChangeEvent describing the event source,
- * the collection that changed, and the items that were removed.
- */
- void itemsRemoved(CollectionChangeEvent event);
-
- /**
- * This method gets called when a bound collection is cleared.
- *
- * @param event A CollectionChangeEvent describing the event source
- * and the collection that changed.
- */
- void collectionCleared(CollectionChangeEvent event);
-
- /**
- * This method gets called when a bound collection is changed in a manner
- * that is not easily characterized by the other methods in this interface.
- *
- * @param event A CollectionChangeEvent describing the event source
- * and the collection that changed.
- */
- void collectionChanged(CollectionChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
deleted file mode 100644
index abcf871f56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-
-/**
- * Convenience implementation of ListChangeListener.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ListChangeAdapter implements ListChangeListener {
-
- /**
- * Default constructor.
- */
- public ListChangeAdapter() {
- super();
- }
-
- public void itemsAdded(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- // do nothing
- }
-
- public void itemsMoved(ListChangeEvent event) {
- // do nothing
- }
-
- public void listCleared(ListChangeEvent event) {
- // do nothing
- }
-
- public void listChanged(ListChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java
deleted file mode 100644
index 74eab3a002..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-
-/**
- * A "list change" event gets fired whenever a model changes a "bound"
- * list. You can register a ListChangeListener with a source
- * model so as to be notified of any bound list updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ListChangeListener extends ChangeListener {
-
- /**
- * This method gets called when items are added to a bound list.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, the items that were added, and the index
- * at which the items were added.
- */
- void itemsAdded(ListChangeEvent event);
-
- /**
- * This method gets called when items are removed from a bound list.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, the items that were removed, and the index
- * at which the items were removed.
- */
- void itemsRemoved(ListChangeEvent event);
-
- /**
- * This method gets called when items in a bound list are replaced.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, the items that were added, the items that were
- * replaced, and the index at which the items were replaced.
- */
- void itemsReplaced(ListChangeEvent event);
-
- /**
- * This method gets called when items in a bound list are moved.
- *
- * @param event A ListChangeEvent describing the event source,
- * the list that changed, and the indices of where items were moved
- * from and to.
- */
- void itemsMoved(ListChangeEvent event);
-
- /**
- * This method gets called when a bound list is cleared.
- *
- * @param event A ListChangeEvent object describing the event source
- * and the list that changed.
- */
- void listCleared(ListChangeEvent event);
-
- /**
- * This method gets called when a bound list is changed in a manner
- * that is not easily characterized by the other methods in this interface.
- *
- * @param event A ListChangeEvent object describing the event source
- * and the list that changed.
- */
- void listChanged(ListChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java
deleted file mode 100644
index 8fb5b6d2d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * This class is used by ReflectiveChangeListener when the requested listener
- * needs to implement multiple methods (i.e. CollectionChangeListener,
- * ListChangeListener, or TreeChangeListener).
- */
-class MultiMethodReflectiveChangeListener
- extends ReflectiveChangeListener
- implements CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- /** the methods we will invoke on the target object */
- private final Method addMethod;
- private final Method removeMethod;
- private final Method replaceMethod; // this can be null
- private final Method moveMethod; // this can be null
- private final Method clearMethod;
- private final Method changeMethod;
-
-
- /**
- * The "replace" and "move" methods are optional.
- */
- MultiMethodReflectiveChangeListener(Object target, Method addMethod, Method removeMethod, Method replaceMethod, Method moveMethod, Method clearMethod, Method changeMethod) {
- super(target);
- this.addMethod = addMethod;
- this.removeMethod = removeMethod;
- this.replaceMethod = replaceMethod;
- this.moveMethod = moveMethod;
- this.clearMethod = clearMethod;
- this.changeMethod = changeMethod;
- }
-
- /**
- * No "replace" or "move" methods.
- */
- MultiMethodReflectiveChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- this(target, addMethod, removeMethod, null, null, clearMethod, changeMethod);
- }
-
-
- // ********** CollectionChangeListener implementation **********
-
- private void invoke(Method method, CollectionChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_COLLECTION_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new CollectionChangeEvent[] {event});
- }
- }
-
- public void itemsAdded(CollectionChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(CollectionChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void collectionCleared(CollectionChangeEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- private void invoke(Method method, ListChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_LIST_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new ListChangeEvent[] {event});
- }
- }
-
- public void itemsAdded(ListChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(ListChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void itemsReplaced(ListChangeEvent event) {
- this.invoke(this.replaceMethod, event);
- }
-
- public void itemsMoved(ListChangeEvent event) {
- this.invoke(this.moveMethod, event);
- }
-
- public void listCleared(ListChangeEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void listChanged(ListChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** TreeChangeListener implementation **********
-
- private void invoke(Method method, TreeChangeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ClassTools.executeMethod(method, this.target, EMPTY_TREE_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(method, this.target, new TreeChangeEvent[] {event});
- }
- }
-
- public void nodeAdded(TreeChangeEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void treeCleared(TreeChangeEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void treeChanged(TreeChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java
deleted file mode 100644
index f76bed7d39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-
-/**
- * A "property change" event gets fired whenever a model changes a "bound"
- * property. You can register a PropertyChangeListener with a source
- * model so as to be notified of any bound property updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PropertyChangeListener extends ChangeListener {
-
- /**
- * This method gets called when a model has changed a bound property.
- *
- * @param event A StateChangeEvent describing the event source
- * and the property's old and new values.
- */
- void propertyChanged(PropertyChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java
deleted file mode 100644
index d7370b6967..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * This factory builds listeners that reflectively forward ChangeEvents.
- * If you are worried about having too many little classes that have to be
- * loaded and maintained by the class loader, you can use one of these.
- * Of course, this comes with the additional overhead of reflection....
- * Also note that the validity of the method name is not checked at compile
- * time, but at runtime; although we *do* check the method as soon as the
- * listener is instantiated.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public abstract class ReflectiveChangeListener {
-
- /** the target object on which we will invoke the method */
- protected final Object target;
-
-
- protected static final Class<StateChangeEvent> STATE_CHANGE_EVENT_CLASS = StateChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<StateChangeEvent>[] STATE_CHANGE_EVENT_CLASS_ARRAY = new Class[] {STATE_CHANGE_EVENT_CLASS};
- protected static final StateChangeEvent[] EMPTY_STATE_CHANGE_EVENT_ARRAY = new StateChangeEvent[0];
-
- protected static final Class<PropertyChangeEvent> PROPERTY_CHANGE_EVENT_CLASS = PropertyChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<PropertyChangeEvent>[] PROPERTY_CHANGE_EVENT_CLASS_ARRAY = new Class[] {PROPERTY_CHANGE_EVENT_CLASS};
- protected static final PropertyChangeEvent[] EMPTY_PROPERTY_CHANGE_EVENT_ARRAY = new PropertyChangeEvent[0];
-
- protected static final Class<CollectionChangeEvent> COLLECTION_CHANGE_EVENT_CLASS = CollectionChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionChangeEvent>[] COLLECTION_CHANGE_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_CHANGE_EVENT_CLASS};
- protected static final CollectionChangeEvent[] EMPTY_COLLECTION_CHANGE_EVENT_ARRAY = new CollectionChangeEvent[0];
-
- protected static final Class<ListChangeEvent> LIST_CHANGE_EVENT_CLASS = ListChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListChangeEvent>[] LIST_CHANGE_EVENT_CLASS_ARRAY = new Class[] {LIST_CHANGE_EVENT_CLASS};
- protected static final ListChangeEvent[] EMPTY_LIST_CHANGE_EVENT_ARRAY = new ListChangeEvent[0];
-
- protected static final Class<TreeChangeEvent> TREE_CHANGE_EVENT_CLASS = TreeChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeChangeEvent>[] TREE_CHANGE_EVENT_CLASS_ARRAY = new Class[] {TREE_CHANGE_EVENT_CLASS};
- protected static final TreeChangeEvent[] EMPTY_TREE_CHANGE_EVENT_ARRAY = new TreeChangeEvent[0];
-
-
-
- // ********** helper methods **********
-
- /**
- * Find and return a method implemented by the target that can be invoked
- * reflectively when a change event occurs.
- */
- private static Method findChangeListenerMethod(Object target, String methodName, Class<? extends ChangeEvent>[] eventClassArray) {
- Method method;
- try {
- method = ClassTools.method(target, methodName, eventClassArray);
- } catch (NoSuchMethodException ex1) {
- try {
- method = ClassTools.method(target, methodName);
- } catch (NoSuchMethodException ex2) {
- throw new RuntimeException(ex2); // "checked" exceptions bite
- }
- }
- return method;
- }
-
- /**
- * Check whether the specified method is suitable for being invoked when a
- * change event has occurred. Throw an exception if it is not suitable.
- */
- private static void checkChangeListenerMethod(Method method, Class<? extends ChangeEvent> eventClass) {
- Class<?>[] parmTypes = method.getParameterTypes();
- int parmTypesLength = parmTypes.length;
- if (parmTypesLength == 0) {
- return;
- }
- if ((parmTypesLength == 1) && parmTypes[0].isAssignableFrom(eventClass)) {
- return;
- }
- throw new IllegalArgumentException(method.toString());
- }
-
-
- // ********** factory methods: StateChangeListener **********
-
- /**
- * Construct a state change listener that will invoke the specified method
- * on the specified target.
- */
- public static StateChangeListener buildStateChangeListener(Object target, Method method) {
- checkChangeListenerMethod(method, STATE_CHANGE_EVENT_CLASS);
- return new SingleMethodReflectiveChangeListener(target, method);
- }
-
- /**
- * Construct a state change listener that will invoke the specified method
- * on the specified target. If a single-argument method with the specified
- * name and appropriate argument is found, it will be invoked; otherwise,
- * a zero-argument method with the specified name will be invoked.
- */
- public static StateChangeListener buildStateChangeListener(Object target, String methodName) {
- return buildStateChangeListener(target, findChangeListenerMethod(target, methodName, STATE_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: PropertyChangeListener **********
-
- /**
- * Construct a property change listener that will invoke the specified method
- * on the specified target.
- */
- public static PropertyChangeListener buildPropertyChangeListener(Object target, Method method) {
- checkChangeListenerMethod(method, PROPERTY_CHANGE_EVENT_CLASS);
- return new SingleMethodReflectiveChangeListener(target, method);
- }
-
- /**
- * Construct a property change listener that will invoke the specified method
- * on the specified target. If a single-argument method with the specified
- * name and appropriate argument is found, it will be invoked; otherwise,
- * a zero-argument method with the specified name will be invoked.
- */
- public static PropertyChangeListener buildPropertyChangeListener(Object target, String methodName) {
- return buildPropertyChangeListener(target, findChangeListenerMethod(target, methodName, PROPERTY_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: CollectionChangeListener **********
-
- /**
- * Construct a collection change listener that will invoke the specified methods
- * on the specified target.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, COLLECTION_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, COLLECTION_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, COLLECTION_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, COLLECTION_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a collection change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, Method method) {
- return buildCollectionChangeListener(target, method, method, method, method);
- }
-
- /**
- * Construct a collection change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, String addMethodName, String removeMethodName, String clearMethodName, String changeMethodName) {
- return buildCollectionChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a collection change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, String methodName) {
- return buildCollectionChangeListener(target, findChangeListenerMethod(target, methodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: ListChangeListener **********
-
- /**
- * Construct a list change listener that will invoke the specified methods
- * on the specified target.
- */
- public static ListChangeListener buildListChangeListener(Object target, Method addMethod, Method removeMethod, Method replaceMethod, Method moveMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(replaceMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(moveMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, LIST_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, LIST_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, replaceMethod, moveMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a list change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static ListChangeListener buildListChangeListener(Object target, Method method) {
- return buildListChangeListener(target, method, method, method, method, method, method);
- }
-
- /**
- * Construct a list change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static ListChangeListener buildListChangeListener(Object target, String addMethodName, String removeMethodName, String replaceMethodName, String moveMethodName, String clearMethodName, String changeMethodName) {
- return buildListChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, replaceMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, moveMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a list change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static ListChangeListener buildListChangeListener(Object target, String methodName) {
- return buildListChangeListener(target, findChangeListenerMethod(target, methodName, LIST_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: TreeChangeListener **********
-
- /**
- * Construct a tree change listener that will invoke the specified methods
- * on the specified target.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, TREE_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, TREE_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, TREE_CHANGE_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, TREE_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a tree change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, Method method) {
- return buildTreeChangeListener(target, method, method, method, method);
- }
-
- /**
- * Construct a tree change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, String addMethodName, String removeMethodName, String clearMethodName, String changeMethodName) {
- return buildTreeChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a tree change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, String methodName) {
- return buildTreeChangeListener(target, findChangeListenerMethod(target, methodName, TREE_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** constructor **********
-
- /**
- * Construct a listener that will invoke the specified method
- * on the specified target.
- */
- protected ReflectiveChangeListener(Object target) {
- super();
- this.target = target;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java
deleted file mode 100644
index b7cc753aa2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * This class is used by ReflectiveChangeListener when the requested listener
- * need only implement a single method (i.e. StateChangeListener or
- * PropertyChangeListener).
- */
-class SingleMethodReflectiveChangeListener
- extends ReflectiveChangeListener
- implements StateChangeListener, PropertyChangeListener
-{
-
- /** the method we will invoke on the target object */
- private final Method method;
- /** cache the number of arguments */
- private final boolean methodIsZeroArgument;
-
- SingleMethodReflectiveChangeListener(Object target, Method method) {
- super(target);
- this.method = method;
- this.methodIsZeroArgument = method.getParameterTypes().length == 0;
- }
-
-
- // ********** StateChangeListener implementation **********
-
- public void stateChanged(StateChangeEvent event) {
- if (this.methodIsZeroArgument) {
- ClassTools.executeMethod(this.method, this.target, EMPTY_STATE_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(this.method, this.target, new StateChangeEvent[] {event});
- }
- }
-
-
- // ********** PropertyChangeListener implementation **********
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.methodIsZeroArgument) {
- ClassTools.executeMethod(this.method, this.target, EMPTY_PROPERTY_CHANGE_EVENT_ARRAY);
- } else {
- ClassTools.executeMethod(this.method, this.target, new PropertyChangeEvent[] {event});
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java
deleted file mode 100644
index 1ce6ba5d69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * A generic "state change" event gets delivered whenever a model changes to
- * such extent that it cannot be delineated all aspects of it that have changed.
- * You can register a StateChangeListener with a source model so as to be notified
- * of any such changes.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface StateChangeListener extends ChangeListener {
-
- /**
- * This method gets called when a model has changed in some general fashion.
- *
- * @param event A StateChangeEvent describing the event source.
- */
- void stateChanged(StateChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java
deleted file mode 100644
index dac880c1fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * Convenience implementation of TreeChangeListener.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class TreeChangeAdapter implements TreeChangeListener {
-
- /**
- * Default constructor.
- */
- public TreeChangeAdapter() {
- super();
- }
-
- public void nodeAdded(TreeChangeEvent event) {
- // do nothing
- }
-
- public void nodeRemoved(TreeChangeEvent event) {
- // do nothing
- }
-
- public void treeCleared(TreeChangeEvent event) {
- // do nothing
- }
-
- public void treeChanged(TreeChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java
deleted file mode 100644
index 7591f9df78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-
-/**
- * A "tree change" event gets fired whenever a model changes a "bound"
- * tree. You can register a TreeChangeListener with a source
- * model so as to be notified of any bound tree updates.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TreeChangeListener extends ChangeListener {
-
- /**
- * This method gets called when a node is added to a bound tree.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the node that was added.
- */
- void nodeAdded(TreeChangeEvent event);
-
- /**
- * This method gets called when a node is removed from a bound tree.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the node that was removed.
- */
- void nodeRemoved(TreeChangeEvent event);
-
- /**
- * This method gets called when a bound tree is cleared.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and an empty path.
- */
- void treeCleared(TreeChangeEvent event);
-
- /**
- * This method gets called when a portion of a bound tree is changed in
- * a manner that is not easily characterized by the other methods in this
- * interface.
- *
- * @param event A TreeChangeEvent describing the event source,
- * the tree that changed, and the path to the branch of the
- * tree that changed.
- */
- void treeChanged(TreeChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java
deleted file mode 100644
index dfa8377b3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract collection accessing and
- * change notification and make it more pluggable.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface CollectionValueModel<E>
- extends Model, Iterable<E>
-{
-
- /**
- * Return the collection's values.
- */
- Iterator<E> iterator();
- String VALUES = "values";
-
- /**
- * Return the size of the collection value.
- */
- int size();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java
deleted file mode 100644
index 013504fbbb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract list accessing and
- * change notification and make it more pluggable.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ListValueModel<E>
- extends Model, Iterable<E>
-{
- /**
- * Return the list's values.
- */
- Iterator<E> iterator();
- String LIST_VALUES = "list values";
-
- /**
- * Return the list's values.
- */
- ListIterator<E> listIterator();
-
- /**
- * Return the size of the list.
- */
- int size();
-
- /**
- * Return the item at the specified index of the list.
- */
- E get(int index);
-
- /**
- * Return the list's values.
- */
- Object[] toArray();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java
deleted file mode 100644
index 39579083b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract property accessing and
- * change notification and make it more pluggable.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PropertyValueModel<T>
- extends Model
-{
-
- /**
- * Return the property's value.
- */
- T value();
- String VALUE = "value";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java
deleted file mode 100644
index a6bcea8cdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-/**
- * Extend WritablePropertyValueModel to better support TreeModelAdapter.
- *
- * Implementors of this interface should fire a "state change" event
- * whenever the node's internal state changes in a way that the
- * tree listeners should be notified.
- *
- * Implementors of this interface should also fire a "value property change"
- * event whenever the node's value changes. Typically, only nodes that
- * hold "primitive" data will fire this event.
- *
- * @see org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TreeNodeValueModel<T>
- extends WritablePropertyValueModel<T>
-{
-
- /**
- * Return the node's parent node; null if the node
- * is the root.
- */
- TreeNodeValueModel<T> parent();
-
- /**
- * Return the path to the node.
- */
- TreeNodeValueModel<T>[] path();
-
- /**
- * Return a list value model of the node's child nodes.
- */
- ListValueModel<TreeNodeValueModel<T>> childrenModel();
-
- /**
- * Return the node's child at the specified index.
- */
- TreeNodeValueModel<T> child(int index);
-
- /**
- * Return the size of the node's list of children.
- */
- int childrenSize();
-
- /**
- * Return the index in the node's list of children of the specified child.
- */
- int indexOfChild(TreeNodeValueModel<T> child);
-
- /**
- * Return whether the node is a leaf (i.e. it has no children)
- */
- boolean isLeaf();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java
deleted file mode 100644
index a76542525a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract tree accessing and
- * change notification and make it more pluggable.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface TreeValueModel<E>
- extends Model
-{
- /**
- * Return the tree's nodes.
- */
- Iterator<E> nodes();
- String NODES = "nodes";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java
deleted file mode 100644
index c2ddacebe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.model.value;
-
-/**
- * Extend ValueModel to allow the setting of the property's value.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface WritablePropertyValueModel<T>
- extends PropertyValueModel<T>
-{
-
- /**
- * Set the value and fire a property change notification.
- * @see PropertyValueModel#VALUE
- */
- void setValue(T value);
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.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.core.tests.extension.resource/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
deleted file mode 100644
index bb6561e95f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests.extension.resource</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.extension.resource/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index f4e23a9800..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/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.extension.resource;singleton:=true
-Bundle-Version: 2.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin
-Bundle-Localization: plugin
-Eclipse-LazyStart: true
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.jpt.core,
- org.eclipse.jpt.ui,
- org.eclipse.wst.validation,
- org.eclipse.jpt.core,
- org.eclipse.jpt.gen,
- org.eclipse.jface,
- org.eclipse.jpt.db,
- org.eclipse.jdt.core,
- org.eclipse.emf.ecore,
- org.eclipse.jpt.utility,
- org.eclipse.core.resources,
- org.eclipse.ui.navigator;bundle-version="3.3.100",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.core.tests.extension.resource;x-friends:="org.eclipse.jpt.ui.tests,org.eclipse.jpt.core.tests"
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
deleted file mode 100644
index f5e3f40ad8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
+++ /dev/null
@@ -1,19 +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
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties
deleted file mode 100644
index 83f727f621..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/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 - ExtensionTestPlugin
-providerName = Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
deleted file mode 100644
index 3902b4ad9d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.jpt.core.jpaPlatform">
- <jpaPlatform
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform"
- id="core.testJpaPlatform"
- label="Test Jpa Platform">
- </jpaPlatform>
- </extension>
- <extension
- point="org.eclipse.jpt.ui.jpaPlatform">
- <jpaPlatform
- class="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi"
- id="core.testJpaPlatform">
- </jpaPlatform>
- </extension>
-
-</plugin>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
deleted file mode 100644
index 7a73d2011a..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ExtensionTestPlugin extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.core.tests.extension.resource";
-
- // The shared instance
- private static ExtensionTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ExtensionTestPlugin() {
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ExtensionTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
deleted file mode 100644
index edbdc8f686..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-
-public class JavaTestAttributeMapping extends AbstractJavaAttributeMapping
-{
- public static final String TEST_ATTRIBUTE_MAPPING_KEY = "testAttribute";
- public static final String TEST_ATTRIBUTE_ANNOTATION_NAME = "test.TestAttribute";
-
-
- public JavaTestAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
deleted file mode 100644
index 05c6f708f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-public class JavaTestAttributeMappingProvider
- implements JavaAttributeMappingProvider
-{
- // singleton
- private static final JavaTestAttributeMappingProvider INSTANCE = new JavaTestAttributeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaTestAttributeMappingProvider() {
- super();
- }
-
- public String key() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public JavaTestAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestAttributeMapping(parent);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
deleted file mode 100644
index 048465e4cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTypeMapping;
-
-public class JavaTestTypeMapping extends AbstractJavaTypeMapping
-{
- public static final String TEST_TYPE_MAPPING_KEY = "test";
- public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test";
-
-
- public JavaTestTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- public String annotationName() {
- return TEST_TYPE_ANNOTATION_NAME;
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public Iterator<String> correspondingAnnotationNames() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isMapped() {
- return true;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java
deleted file mode 100644
index ba83480551..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-
-/**
- *
- */
-public class JavaTestTypeMappingProvider
- implements JavaTypeMappingProvider
-{
- // singleton
- private static final JavaTestTypeMappingProvider INSTANCE = new JavaTestTypeMappingProvider();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure non-instantiability.
- */
- private JavaTestTypeMappingProvider() {
- super();
- }
-
- public String key() {
- return JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY;
- }
-
- public String annotationName() {
- return JavaTestTypeMapping.TEST_TYPE_ANNOTATION_NAME;
- }
-
- public JavaTestTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestTypeMapping(parent);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
deleted file mode 100644
index ccd2f6ae1d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaBasicMapping;
-
-public class TestJavaBasicMapping extends GenericJavaBasicMapping
-{
- public TestJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
deleted file mode 100644
index ecffe3a2b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaEntity;
-
-public class TestJavaEntity extends GenericJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
deleted file mode 100644
index b23aada30d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.platform.GenericJpaFactory;
-
-public class TestJpaFactory extends GenericJpaFactory
-{
- @Override
- public JavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new TestJavaEntity(parent);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new TestJavaBasicMapping(parent);
- }
-
- public JavaTestTypeMapping buildJavaTestTypeMapping(JavaPersistentType parent) {
- return new JavaTestTypeMapping(parent);
- }
-
- public JavaTestAttributeMapping buildJavaTestAttributeMapping(JavaPersistentAttribute parent) {
- return new JavaTestAttributeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
deleted file mode 100644
index cb7b185b22..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatform.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.Collection;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingProvider;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingProvider;
-import org.eclipse.jpt.core.internal.platform.GenericJpaPlatform;
-
-public class TestJpaPlatform extends GenericJpaPlatform
-{
- public static final String ID = "core.testJpaPlatform";
-
- @Override
- public String getId() {
- return ID;
- }
-
- @Override
- protected JpaFactory buildJpaFactory() {
- return new TestJpaFactory();
- }
-
- @Override
- public JpaAnnotationProvider annotationProvider() {
- return super.annotationProvider();
- }
-
- @Override
- protected void addJavaTypeMappingProvidersTo(Collection<JavaTypeMappingProvider> providers) {
- super.addJavaTypeMappingProvidersTo(providers);
- providers.add(JavaTestTypeMappingProvider.instance());
- }
-
- @Override
- protected void addJavaAttributeMappingProvidersTo(Collection<JavaAttributeMappingProvider> providers) {
- super.addJavaAttributeMappingProvidersTo(providers);
- providers.add(JavaTestAttributeMappingProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java
deleted file mode 100644
index cb20f6893c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUi.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import java.util.List;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.JpaUiFactory;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.java.details.AttributeMappingUiProvider;
-import org.eclipse.jpt.ui.java.details.TypeMappingUiProvider;
-
-public class TestJpaPlatformUi extends BaseJpaPlatformUi
-{
- public TestJpaPlatformUi() {
- super();
- }
-
- @Override
- protected JpaUiFactory createJpaUiFactory() {
- return new TestJpaUiFactory();
- }
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- protected void addJavaAttributeMappingUiProvidersTo(List<AttributeMappingUiProvider<? extends AttributeMapping>> providers) {
- super.addJavaAttributeMappingUiProvidersTo(providers);
-
- }
-
- @Override
- protected void addJavaTypeMappingUiProvidersTo(List<TypeMappingUiProvider<? extends TypeMapping>> providers) {
- super.addJavaTypeMappingUiProvidersTo(providers);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
deleted file mode 100644
index 29fa8b4b58..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaUiFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.ui.internal.BaseJpaUiFactory;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JpaUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class TestJpaUiFactory extends BaseJpaUiFactory
-{
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java
index b7d5e4ca60..1f16911802 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/model/JpaModelTests.java
@@ -170,47 +170,49 @@ public class JpaModelTests extends TestCase {
// assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/META-INF/orm.xml")));
}
- public void testEditFacetSettingsFile() throws Exception {
- TestFacetedProject testProject = this.buildTestProject();
- assertNull(JptCorePlugin.jpaProject(testProject.getProject()));
-
- // add the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.file(testProject, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"jst.utility\" version=\"1.0\"/>";
- String newString = oldString + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
-
- assertEquals(1, JptCorePlugin.jpaModel().jpaProjectsSize());
- JpaProject jpaProject = JptCorePlugin.jpaProject(testProject.getProject());
- assertNotNull(jpaProject);
- // persistence.xml and orm.xml do not get created in this situation (?)
- assertEquals(2, jpaProject.jpaFilesSize());
- assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/test.pkg/TestEntity.java")));
- assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/test.pkg/TestEntity2.java")));
- // assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/META-INF/persistence.xml")));
- // assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/META-INF/orm.xml")));
-
- // now remove the JPA facet
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
-// TODO moved this stuff to the error console until we can figure out why it fails intermittently ~bjv
-// assertEquals(0, JptCorePlugin.jpaModel().jpaProjectsSize());
-// jpaProject = JptCorePlugin.jpaProject(testProject.getProject());
-// assertNull(jpaProject);
- int size = JptCorePlugin.jpaModel().jpaProjectsSize();
- if (size != 0) {
- System.err.println("bogus size: " + size);
- System.err.println("bogus project: " + JptCorePlugin.jpaProject(testProject.getProject()));
- }
- }
+ //TODO - Commented out this test, since it was failing in the I-Build and we're not sure why.
+ //See bug 221757
+// public void testEditFacetSettingsFile() throws Exception {
+// TestFacetedProject testProject = this.buildTestProject();
+// assertNull(JptCorePlugin.jpaProject(testProject.getProject()));
+//
+// // add the JPA facet by modifying the facet settings file directly
+// IFile facetSettingsFile = this.file(testProject, ".settings/org.eclipse.wst.common.project.facet.core.xml");
+// InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
+// int fileSize = inStream.available();
+// byte[] buf = new byte[fileSize];
+// inStream.read(buf);
+// inStream.close();
+//
+// String oldDocument = new String(buf);
+// String oldString = "<installed facet=\"jst.utility\" version=\"1.0\"/>";
+// String newString = oldString + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
+// String newDocument = oldDocument.replaceAll(oldString, newString);
+//
+// facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
+//
+// assertEquals(1, JptCorePlugin.jpaModel().jpaProjectsSize());
+// JpaProject jpaProject = JptCorePlugin.jpaProject(testProject.getProject());
+// assertNotNull(jpaProject);
+// // persistence.xml and orm.xml do not get created in this situation (?)
+// assertEquals(2, jpaProject.jpaFilesSize());
+// assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/test.pkg/TestEntity.java")));
+// assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/test.pkg/TestEntity2.java")));
+// // assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/META-INF/persistence.xml")));
+// // assertNotNull(jpaProject.jpaFile(this.file(testProject, "src/META-INF/orm.xml")));
+//
+// // now remove the JPA facet
+// facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
+//// TODO moved this stuff to the error console until we can figure out why it fails intermittently ~bjv
+//// assertEquals(0, JptCorePlugin.jpaModel().jpaProjectsSize());
+//// jpaProject = JptCorePlugin.jpaProject(testProject.getProject());
+//// assertNull(jpaProject);
+// int size = JptCorePlugin.jpaModel().jpaProjectsSize();
+// if (size != 0) {
+// System.err.println("bogus size: " + size);
+// System.err.println("bogus project: " + JptCorePlugin.jpaProject(testProject.getProject()));
+// }
+// }
/**
* make sure the DEBUG constants are 'false' before checking in the code
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 52f3036201..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.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/jpt/db/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <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/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index b23d0c7038..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:11 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
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 de87ac8d1b..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +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;x-internal:=true,
- org.eclipse.jpt.db.tests.internal.platforms;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
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 1d97add8dd..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/derby101.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-# Driver class name - org.apache.derby.jdbc.EmbeddedDriver
-#
-profileName = derby101
-profileDescription = Derby Embedded JDBC Profile for Testing
-# set user name
-userName =
-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/mysql41.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/mysql41.properties
deleted file mode 100644
index 4ac94784bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/mysql41.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-#
-# Driver class (jconn3.jar) - com.mysql.jdbc.Driver
-#
-profileName = mysq41
-profileDescription = MySql 4.1.16 JDBC Profile for Testing
-# set user name
-userName =
-userPassword =
-# set path to Derby driver here (example: databasedriverJarList = C:/jlib/mysql-connector-java-3.1.7-bin.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:sybase:Tds:localhost:5000/testdb )
-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 603e56d7db..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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)
-# Driver: oracle.jdbc.OracleDriver
-#
-profileName = Oracle10g_10_1_0_4
-profileDescription = Oracle10g (10.1.0.4) Thin JDBC Profile for Testing
-userName =
-userPassword =
-# set path to Oracle driver here (example: databasedriverJarList = c:/oracle/jdbc/lib/ojdbc14.jar )
-databasedriverJarList =
-databaseName =
-# set database URL here (example: databaseUrl = jdbc:oracle:thin:@localhost:1521:testdb )
-databaseUrl =
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties
deleted file mode 100644
index 8d72946e2a..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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)
-# Driver: oracle.jdbc.OracleDriver
-#
-profileName = oracleXE10g
-profileDescription = Oracle10g XE 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 = XE
-# set database URL here (example: databaseUrl = jdbc:oracle:thin:@localhost:1521:XE )
-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 8357e15c58..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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)
-# Driver: oracle.jdbc.OracleDriver
-#
-profileName = oracle9i
-profileDescription = Oracle Thin JDBC Profile for Testing
-userName =
-userPassword =
-# 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/postgresql824.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql824.properties
deleted file mode 100644
index f529359523..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql824.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-# Driver class (postgresql-8.2-505.jdbc2.jar) - org.postgresql.Driver
-#
-profileName = postgresql
-profileDescription = PostgreSQL 8.2.4 JDBC Profile for Testing
-# set user name
-userName =
-userPassword =
-# set path to Derby driver here (example: databasedriverJarList = c:/jlib/postgresql-8.2-505.jdbc2.jar)
-databasedriverJarList =
-databaseName = postgres
-# set database URL here (example: databaseUrl = jdbc:postgresql:postgres )
-databaseUrl = jdbc:postgresql:postgres
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/config/sybase12.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sybase12.properties
deleted file mode 100644
index 34aab2556b..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/config/sybase12.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Platform Property names & Default
-#
-# profileName - jpatest
-# profileDescription - JDBC Profile for JPA Testing
-# userName - jpatest
-# userPassword - (empty)
-# databasedriverJarList - (mandatory)
-# databaseName - testdb
-# databaseUrl - (mandatory)
-# Driver class (jconn3.jar) - com.sybase.jdbc3.jdbc.SybDriver
-#
-profileName = jconnect6
-profileDescription = Sybase 12.x jConnect JDBC Profile for Testing
-# set user name
-userName =
-userPassword =
-# set path to Derby driver here (example: databasedriverJarList = c:/sybase/lib/jconn3.jar )
-databasedriverJarList =
-databaseName = testdb
-# set database URL here (example: databaseUrl = jdbc:sybase:Tds:localhost:5000/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 ecb2b84188..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 org.eclipse.jpt.db.tests.internal.platforms.AllPlatformTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * 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(JptDbTests.class.getPackage().getName());
-
- 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 a5fe382da0..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- 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 d76ac11cdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.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.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * 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(AllPlatformTests.class.getPackage().getName());
-
-// TODO - Uncomment the platform to test.
-// suite.addTestSuite(Derby101Tests.class);
-// suite.addTestSuite(Oracle9iTests.class);
-// suite.addTestSuite(Oracle10gTests.class);
-// suite.addTestSuite(Oracle10gXETests.class);
-// suite.addTestSuite(SQLServer2005Tests.class);
-// suite.addTestSuite(MySQL41Tests.class);
-// suite.addTestSuite(PostgreSQL824Tests.class);
-// suite.addTestSuite(Sybase12Tests.class);
-
- return suite;
- }
-
- private AllPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-} \ 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 11622031bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.IStatus;
-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.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();
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connectionRepository.start();
-
- 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());
- }
-
- @Override
- protected void tearDown() throws Exception {
-
- this.connectionRepository.stop();
- super.tearDown();
- }
-
- // ********** tests **********
-
- public void testConnection() throws Exception {
-
- this.connect();
-
- this.verifyDatabaseVersionNumber();
- 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 = this.getDTPProfile();
- 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()));
- }
-
- public void testWorkingOffline() {
-
- if( this.getProfile().supportsWorkOfflineMode()) {
-
- if( ! this.getProfile().canWorkOffline()) {
- this.connect();
- this.saveWorkOfflineData();
- this.disconnect();
-
- Assert.assertTrue( this.getProfile().canWorkOffline());
- }
- this.workOffline();
-
- Assert.assertTrue( this.getProfile().isConnected());
- Assert.assertTrue( this.getProfile().isWorkingOffline());
-
- this.disconnect();
- }
- }
-
- // ********** 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 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( "Could not connect.", this.getProfile().isConnected());
- Assert.assertFalse( "Connection corrupted.", this.getProfile().isWorkingOffline());
- }
-
- protected void disconnect() {
-
- this.getProfile().disconnect();
- Assert.assertFalse( "Disconnect failed.", this.getProfile().isConnected());
- }
-
- private void workOffline() {
- IStatus status = this.getProfile().workOffline();
-
- Assert.assertTrue( "Could not work offline.", status.isOK());
- }
-
- private void saveWorkOfflineData() {
- IStatus status = this.getProfile().saveWorkOfflineData();
-
- Assert.assertTrue( "Could not save offline data.", status.isOK());
- }
-
- // ********** queries **********
-
- protected Schema getSchemaNamed( String schemaName) {
-
- return this.getProfile().getDatabase().schemaNamed( schemaName);
- }
-
- protected Collection<Table> getTables() {
-
- Schema schema = this.getSchemaNamed( this.getProfile().getUserName());
- if( schema == null) {
- return new ArrayList<Table>();
- }
- 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 IConnectionProfile getDTPProfile() {
- return ProfileManager.getInstance().getProfileByName( this.profileName());
- }
-
- 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;
- }
-
- protected 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 dtpProfile = this.getDTPProfile();
- if( dtpProfile == 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 2244b0e623..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Derby101Tests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Derby 10.1 Embedded Driver Test
- */
-public class Derby101Tests extends DTPPlatformTests {
-
- public Derby101Tests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "Derby";
- }
-
- @Override
- protected String databaseVersion() {
- return "10.1";
- }
-
- @Override
- protected String providerId() {
- return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile";
- }
-
- @Override
- protected String driverName() {
- return "Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String driverClass() {
- return "org.apache.derby.jdbc.EmbeddedDriver";
- }
-
- @Override
- protected String getConfigName() {
- return "derby101.properties";
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQL41Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQL41Tests.java
deleted file mode 100644
index 37c190f113..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQL41Tests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * SQL Server 2005 Driver Test
- */
-public class MySQL41Tests extends DTPPlatformTests {
-
- public MySQL41Tests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "MySql";
- }
-
- @Override
- protected String databaseVersion() {
- return "4.1";
- }
-
- @Override
- protected String driverClass() {
- return "com.mysql.jdbc.Driver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.MySQL JDBC Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.mysql.4_1.driverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "MySQL JDBC Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "mysql41.properties";
- }
-
-} \ No newline at end of file
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 4fa85b4db8..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-public class Oracle10gTests extends DTPPlatformTests {
-
- public Oracle10gTests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String databaseVersion() {
- return "10";
- }
-
- @Override
- protected String driverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "oracle10g.properties";
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java
deleted file mode 100644
index 78e0548b1b..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-public class Oracle10gXETests extends DTPPlatformTests {
-
- public Oracle10gXETests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String databaseVersion() {
- return "10";
- }
-
- @Override
- protected String driverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "oracle10gXE.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 8e1795dc24..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 9i Thin Driver Test
- */
-public class Oracle9iTests extends DTPPlatformTests {
-
- public Oracle9iTests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String databaseVersion() {
- return "9";
- }
-
- @Override
- protected String driverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.9.driverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "Oracle 9i Thin Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "oracle9i.properties";
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQL824Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQL824Tests.java
deleted file mode 100644
index 8e011ad987..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQL824Tests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-public class PostgreSQL824Tests extends DTPPlatformTests {
-
- public PostgreSQL824Tests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "postgres";
- }
-
- @Override
- protected String databaseVersion() {
- return "8.x";
- }
-
- @Override
- protected String driverClass() {
- return "org.postgresql.Driver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.postgresql.postgresqlDriverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "postgresql824.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 350d844d56..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServer2005Tests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * SQL Server 2005 Driver Test
- */
-public class SQLServer2005Tests extends DTPPlatformTests {
-
- public SQLServer2005Tests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "SQLServer";
- }
-
- @Override
- protected String databaseVersion() {
- return "2005";
- }
-
- @Override
- protected String providerId() {
- return "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
- }
-
- @Override
- protected String driverName() {
- return "Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String driverClass() {
- return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- }
-
- @Override
- protected String getConfigName() {
- return "sqlserver2005.properties";
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Sybase12Tests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Sybase12Tests.java
deleted file mode 100644
index c6c7eb3e89..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Sybase12Tests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-public class Sybase12Tests extends DTPPlatformTests {
-
- public Sybase12Tests( String name) {
- super( name);
- }
-
- @Override
- protected String databaseVendor() {
- return "Sybase";
- }
-
- @Override
- protected String databaseVersion() {
- return "12.x";
- }
-
- @Override
- protected String driverClass() {
- return "com.sybase.jdbc3.jdbc.SybDriver";
- }
-
- @Override
- protected String driverDefinitionId() {
- return "DriverDefn.Sybase JDBC Driver";
- }
-
- @Override
- protected String driverDefinitionType() {
- return "org.eclipse.datatools.enablement.sybase.ase.12_x.driverTemplate";
- }
-
- @Override
- protected String driverName() {
- return "Sybase JDBC Driver";
- }
-
- @Override
- protected String getConfigName() {
- return "sybase12.properties";
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
deleted file mode 100644
index 370877baf6..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.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"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.project b/jpa/tests/org.eclipse.jpt.ui.tests/.project
deleted file mode 100644
index 0240774761..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui.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.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 4d1a5023be..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.ui.tests
-Bundle-Version: 1.0.0
-Require-Bundle: org.junit,
- org.junit4;bundle-version="4.3.1",
- org.eclipse.core.runtime,
- org.eclipse.jface,
- org.eclipse.jpt.core.tests,
- org.eclipse.jpt.core.tests.extension.resource,
- org.eclipse.jpt.utility,
- org.eclipse.jpt.core,
- org.eclipse.jpt.ui,
- org.eclipse.ui.workbench;bundle-version="3.4.0",
- org.eclipse.ui.forms;bundle-version="3.3.100"
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.jpt.ui.tests;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.jface;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.swt;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.util;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
deleted file mode 100644
index 34d2e4d2da..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
deleted file mode 100644
index ca8ab879ff..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.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 UI Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
deleted file mode 100644
index 09aac1629d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.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.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.ui.tests.internal.platform.JptUiPlatformTests;
-import org.eclipse.jpt.ui.tests.internal.util.JptUiUtilTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiTests.class.getPackage().getName());
- suite.addTest(JptUiPlatformTests.suite());
- suite.addTest(JptUiUtilTests.suite());
- return suite;
- }
-
- private JptUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
deleted file mode 100644
index 57fb10c297..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.jface;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-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.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class DelegatingLabelProviderUiTest extends ApplicationWindow
-{
- private TreeViewer tree;
-
- private WritablePropertyValueModel<Vehicle> selectedVehicle;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingLabelProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
-
- private DelegatingLabelProviderUiTest(String[] args) {
- super(null);
- this.selectedVehicle = new SimplePropertyValueModel<Vehicle>();
- }
-
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.NONE);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText("My Vehicles");
-
- tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- DelegatingContentAndLabelProvider contentAndLabelProvider =
- new DelegatingTreeContentAndLabelProvider(
- new VehicleContentProviderFactory(),
- new VehicleLabelProviderFactory());
- tree.setContentProvider(contentAndLabelProvider);
- tree.setLabelProvider(contentAndLabelProvider);
- tree.setInput(new Root());
- tree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle.setValue((Vehicle) ((IStructuredSelection) event.getSelection()).getFirstElement());
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout());
- buildUpperControlPanel(panel);
- buildLowerControlPanel(panel);
- }
-
- private void buildUpperControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(2, true));
- buildVehicleCombo(panel);
- buildColorCombo(panel);
- }
-
- private void buildVehicleCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new VehicleTypeLabelProvider());
- combo.setInput(
- new VehicleType[] {
- VehicleType.BICYCLE, VehicleType.CAR,
- VehicleType.TRUCK, VehicleType.BOAT
- });
- combo.getCombo().setEnabled(false);
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setVehicleType((VehicleType) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.vehicleType()));
- }
- });
- }
-
- private void buildColorCombo(Composite parent) {
- final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
- combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- combo.setContentProvider(new ArrayContentProvider());
- combo.setLabelProvider(new ColorLabelProvider());
- combo.setInput(new Color[] {Color.RED, Color.BLUE, Color.YELLOW, Color.GREEN});
- combo.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setColor((Color) ((StructuredSelection) event.getSelection()).getFirstElement());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.color()));
- }
- });
- }
-
- private void buildLowerControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- panel.setLayout(new GridLayout(3, false));
- buildEffectsLabel(panel);
- buildGreyedCheckBox(panel);
- buildTranslucentCheckBox(panel);
- buildActionPanel(panel);
- }
-
- private void buildEffectsLabel(Composite parent) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText("Color effects: ");
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
- }
-
- private void buildGreyedCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- button.setText("greyed");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setGreyed(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isGreyed());
- }
- });
- }
-
- private void buildTranslucentCheckBox(Composite parent) {
- final Button button = new Button(parent, SWT.CHECK);
- button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
- button.setText("translucent");
- button.setEnabled(false);
- button.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setTranslucent(button.getSelection());
- }
- });
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
- button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isTranslucent());
- }
- });
- }
-
- private void buildActionPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.END, GridData.FILL, false, false));
- panel.setLayout(new GridLayout());
- buildRefreshTreeACI().fill(panel);
- }
-
- private ActionContributionItem buildRefreshTreeACI() {
- Action action = new Action("Refresh tree", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- refreshTree();
- }
- };
- action.setToolTipText("Refresh the tree's labels");
- return new ActionContributionItem(action);
- }
-
- void refreshTree() {
- tree.refresh();
- }
-
- private Vehicle selectedVehicle() {
- return selectedVehicle.value();
- }
-
-
- private static class VehicleTypeLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((VehicleType) element).description();
- }
- }
-
-
- private static class ColorLabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((Color) element).description();
- }
- }
-
-
- private static class VehicleContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Root) {
- return new RootContentProvider(
- (Root) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return new VehicleContentProvider(
- (Vehicle) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class RootContentProvider extends AbstractTreeItemContentProvider<Vehicle>
- {
- public RootContentProvider(Root item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Object getParent() {
- return null;
- }
-
- @Override
- protected ListValueModel<Vehicle> buildChildrenModel() {
- return new StaticListValueModel<Vehicle>(CollectionTools.list(((Root) model()).vehicles()));
- }
- }
-
- @SuppressWarnings("unchecked")
- private static class VehicleContentProvider extends AbstractTreeItemContentProvider
- {
- public VehicleContentProvider(Vehicle item, DelegatingTreeContentAndLabelProvider contentAndLabelProvider) {
- super(item, contentAndLabelProvider);
- }
-
- @Override
- public Object getParent() {
- return ((Vehicle) model()).parent();
- }
-
- @Override
- protected ListValueModel buildChildrenModel() {
- return new NullListValueModel();
- }
- }
-
-
- private static class VehicleLabelProviderFactory
- implements ItemLabelProviderFactory
- {
- public ItemLabelProvider buildItemLabelProvider(Object element, DelegatingContentAndLabelProvider labelProvider) {
- return new VehicleLabelProvider((Vehicle) element, labelProvider);
- }
- }
-
-
- private static class VehicleLabelProvider extends AbstractItemLabelProvider
- {
- public VehicleLabelProvider(Vehicle vehicle, DelegatingContentAndLabelProvider labelProvider) {
- super(vehicle, labelProvider);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new PropertyAspectAdapter<Vehicle, String>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) model()),
- Vehicle.VEHICLE_TYPE_PROPERTY, Vehicle.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.color().description() + ' ' + subject.vehicleType().description();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<Vehicle, Image>(
- new StaticPropertyValueModel<Vehicle>((Vehicle) model()),
- Vehicle.COLOR_PROPERTY, Vehicle.GREYED_PROPERTY, Vehicle.TRANSLUCENT_PROPERTY) {
- @Override
- protected Image buildValue_() {
- return subject.image();
- }
- };
- }
- }
-
-
- private static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
-
- public TreeNode(TreeNode parent) {
- this.parent = parent;
- }
-
-
- public TreeNode parent() {
- return parent;
- }
- }
-
-
- private static class Root extends TreeNode
- {
- protected final Vehicle[] vehicles;
-
-
- public Root() {
- super(null);
- vehicles = new Vehicle[] {
- new Vehicle(this, VehicleType.BICYCLE, Color.BLUE),
- new Vehicle(this, VehicleType.CAR, Color.YELLOW),
- new Vehicle(this, VehicleType.TRUCK, Color.RED),
- new Vehicle(this, VehicleType.BOAT, Color.GREEN)};
- }
-
- public Vehicle[] vehicles() {
- return vehicles;
- }
- }
-
-
- private static class Vehicle extends TreeNode
- {
- private VehicleType vehicleType;
- public final static String VEHICLE_TYPE_PROPERTY = "vehicleType";
-
- private Color color;
- public final static String COLOR_PROPERTY = "color";
-
- private boolean greyed = false;
- public final static String GREYED_PROPERTY = "greyed";
-
- private boolean translucent = false;
- public final static String TRANSLUCENT_PROPERTY = "translucent";
-
- private Image image;
-
-
- public Vehicle(TreeNode parent, VehicleType vehicleType, Color color) {
- super(parent);
- this.vehicleType = vehicleType;
- this.color = color;
- }
-
- public VehicleType vehicleType() {
- return vehicleType;
- }
-
- public void setVehicleType(VehicleType newVehicleType) {
- VehicleType oldVehicleType = vehicleType;
- vehicleType = newVehicleType;
- firePropertyChanged(VEHICLE_TYPE_PROPERTY, oldVehicleType, newVehicleType);
- }
-
- public Color color() {
- return color;
- }
-
- public void setColor(Color newColor) {
- Color oldColor = color;
- color = newColor;
- firePropertyChanged(COLOR_PROPERTY, oldColor, newColor);
- }
-
- public boolean isGreyed() {
- return greyed;
- }
-
- public void setGreyed(boolean newGreyed) {
- boolean oldGreyed = greyed;
- greyed = newGreyed;
- firePropertyChanged(GREYED_PROPERTY, oldGreyed, newGreyed);
- }
-
- public boolean isTranslucent() {
- return translucent;
- }
-
- public void setTranslucent(boolean newTranslucent) {
- boolean oldTranslucent = translucent;
- translucent = newTranslucent;
- firePropertyChanged(TRANSLUCENT_PROPERTY, oldTranslucent, newTranslucent);
- }
-
- public Image image() {
- if (image != null) {
- image.dispose();
- }
-
- return ImageFactory.image(color(), greyed, translucent);
- }
- }
-
-
- private static enum VehicleType
- {
- BICYCLE("bicycle"),
- CAR("car"),
- TRUCK("truck"),
- BOAT("boat");
-
- private final String description;
-
- private VehicleType(String description) {
- this.description = description;
- }
-
- public String description() {
- return description;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static enum Color
- {
- RED("red", new RGB(255, 0, 0)),
- BLUE("blue", new RGB(0, 0, 255)),
- YELLOW("yellow", new RGB(255, 255, 0)),
- GREEN("green", new RGB(0, 255, 0));
-
- private final String description;
-
- private final RGB rgb;
-
- private Color(String description, RGB rgb) {
- this.description = description;
- this.rgb = rgb;
- }
-
- public String description() {
- return description;
- }
-
- public RGB rgb() {
- return rgb;
- }
-
- @Override
- public String toString() {
- return description();
- }
- }
-
-
- private static class ImageFactory
- {
- private static RGB rgb(Color color, boolean greyed, boolean translucent) {
- RGB rgb = (greyed) ? new RGB(127, 127, 127) : color.rgb();
- if (translucent) {
- rgb = new RGB(translucify(rgb.red), translucify(rgb.green), translucify(rgb.blue));
- }
- return rgb;
- }
-
- private static int translucify(int color) {
- return 255 - (int) ((255 - color) * 0.3);
- }
-
- public static Image image(Color color, boolean greyed, boolean translucent) {
- PaletteData pd = new PaletteData(new RGB[] {rgb(color, greyed, translucent)});
- ImageData id = new ImageData(20, 20, 1, pd);
- for (int x = 0; x < 20; x ++) {
- for (int y = 0; y < 20; y ++) {
- id.setPixel(x, y, 0);
- }
- }
- return new Image(Display.getCurrent(), id);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
deleted file mode 100644
index d2b90e7aa8..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.jface;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-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;
-import org.eclipse.swt.widgets.Text;
-
-public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
-{
- private final Root root;
-
- private WritablePropertyValueModel<TreeNode> selectedNode;
-
- private TreeViewer controlTree;
-
- private TreeViewer viewTree;
-
- private Text nodeNameText;
-
-
- public static void main(String[] args) {
- Window window = new DelegatingTreeContentProviderUiTest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private DelegatingTreeContentProviderUiTest(String[] args) {
- super(null);
- this.root = new Root();
- this.root.addChild("Parent_1");
- this.selectedNode = new SimplePropertyValueModel<TreeNode>(this.root);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(800, 400);
- parent.setLayout(new GridLayout());
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
- mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
- return mainPanel;
- }
-
- private void buildTreePanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout(2, true));
- buildControlTreePanel(panel);
- buildViewTreePanel(panel);
- }
-
- private void buildControlTreePanel(Composite parent) {
- controlTree = buildTreePanel(
- parent, "Control tree",
- new DelegatingTreeContentAndLabelProvider(new ControlTreeItemContentProviderFactory()),
- new LabelProvider());
- controlTree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- controlTree.setSelection(new StructuredSelection(event.newValue()));
- }
- }
- );
- }
-
- private void buildViewTreePanel(Composite parent) {
- viewTree = buildTreePanel(
- parent, "View tree",
- new DelegatingTreeContentAndLabelProvider(new ViewTreeItemContentProviderFactory()),
- new LabelProvider());
- }
-
- private TreeViewer buildTreePanel(Composite parent, String labelText, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL_BOTH));
- panel.setLayout(new GridLayout());
-
- Label label = new Label(panel, SWT.LEFT);
- label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- label.setText(labelText);
-
- final TreeViewer tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- tree.setContentProvider(contentProvider);
- tree.setLabelProvider(labelProvider);
- tree.setInput(root);
-
- return tree;
- }
-
- private ISelectionChangedListener buildTreeSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- TreeNode selection = (TreeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
- selectedNode.setValue((selection == null) ? root : selection);
- }
- };
- }
-
- private void buildControlPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
- panel.setLayout(new GridLayout(6, false));
- buildNodeNameText(panel);
- buildAddChildACI().fill(panel);
- buildAddNestedChildACI().fill(panel);
- buildRemoveACI().fill(panel);
- buildClearModelACI().fill(panel);
- buildRestoreModelACI().fill(panel);
- }
-
- private void buildNodeNameText(Composite parent) {
- nodeNameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
- nodeNameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- }
-
- private ActionContributionItem buildAddChildACI() {
- final Action action = new Action("Add child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addChild();
- }
- };
- action.setToolTipText("Add a child with the given name");
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.newValue()).canHaveChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddNestedChildACI() {
- final Action action = new Action("Add nested child", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- addNestedChild();
- }
- };
- action.setToolTipText("Add a nested child with the given name");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(((TreeNode) event.newValue()).canHaveNestedChildren());
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemoveACI() {
- final Action action = new Action("Remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- remove();
- }
- };
- action.setToolTipText("Remove the selected node");
- action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(event.newValue() != root);
- }
- }
- );
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("Clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- clearModel();
- }
- };
- action.setToolTipText("Clear the model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("Restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- restoreModel();
- }
- };
- action.setToolTipText("Restore the model");
- return new ActionContributionItem(action);
- }
-
- void addChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.value().addChild(nodeName);
- }
- }
-
- void addNestedChild() {
- String nodeName = nodeNameText.getText();
- if (nodeName.length() != 0) {
- selectedNode.value().addNestedChild(nodeName);
- }
- }
-
- void remove() {
- TreeNode node = selectedNode.value();
- node.parent().removeChild(node);
- }
-
- void clearModel() {
- controlTree.setInput(null);
- viewTree.setInput(null);
- }
-
- void restoreModel() {
- controlTree.setInput(root);
- viewTree.setInput(root);
- }
-
-
- private static abstract class AbstractTreeItemContentProviderFactory
- implements TreeItemContentProviderFactory
- {
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- return new GenericTreeItemContentProvider(
- (TreeNode) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- }
-
-
- private static class ControlTreeItemContentProviderFactory extends AbstractTreeItemContentProviderFactory
- {
-
- }
-
-
- private static class ViewTreeItemContentProviderFactory
- extends AbstractTreeItemContentProviderFactory
- {
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- if (item instanceof Parent) {
- return new ViewTreeParentItemContentProvider(
- (Parent) item, (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider);
- }
- return super.buildItemContentProvider(item, contentAndLabelProvider);
- }
- }
-
-
- private static class GenericTreeItemContentProvider extends AbstractTreeItemContentProvider<TreeNode>
- {
- public GenericTreeItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- protected TreeNode treeNode() {
- return (TreeNode) model();
- }
-
- @Override
- public TreeNode getParent() {
- return treeNode().parent();
- }
-
- @Override
- protected ListValueModel<TreeNode> buildChildrenModel() {
- return new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, treeNode()) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return treeNode().children();
- }
- };
- }
- }
-
- private static class ViewTreeParentItemContentProvider extends GenericTreeItemContentProvider
- {
- public ViewTreeParentItemContentProvider(
- TreeNode treeNode, DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider) {
- super(treeNode, treeContentAndLabelProvider);
- }
-
- @Override
- public TreeNode getParent() {
- TreeNode parent = super.getParent();
- if (parent instanceof Nest) {
- parent = parent.parent();
- }
- return parent;
- }
-
- @Override
- protected ListValueModel<TreeNode> buildChildrenModel() {
- return buildChildrenModel(
- new CompositeCollectionValueModel<TreeNode, TreeNode>(super.buildChildrenModel()) {
- @Override
- protected CollectionValueModel<TreeNode> transform(TreeNode value) {
- if (value instanceof Nest) {
- final Nest nest = (Nest) value;
- return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, nest) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return nest.children();
- }
- }
- );
- }
- else {
- return new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
- }
- }
- }
- );
- }
- }
-
-
- private static class LabelProvider extends BaseLabelProvider
- implements ILabelProvider
- {
- public Image getImage(Object element) {
- return null;
- }
-
- public String getText(Object element) {
- return ((TreeNode) element).getName();
- }
- }
-
-
- private static abstract class TreeNode extends AbstractModel
- {
- private TreeNode parent;
-
- protected final List<TreeNode> children;
- public final static String CHILDREN_LIST = "children";
-
- protected String name;
- public final static String NAME_PROPERTY = "name";
-
-
- public TreeNode(TreeNode parent, String name) {
- this.parent = parent;
- this.children = new ArrayList<TreeNode>();
- this.name = name;
- }
-
- public TreeNode parent() {
- return parent;
- }
-
- public ListIterator<TreeNode> children() {
- return new ReadOnlyListIterator<TreeNode>(children);
- }
-
- protected void addChild(TreeNode child) {
- addItemToList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(TreeNode child) {
- removeItemFromList(child, children, CHILDREN_LIST);
- }
-
- public void removeChild(int index) {
- removeItemFromList(index, children, CHILDREN_LIST);
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public boolean canHaveChildren() {
- return false;
- }
-
- public void addChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- public boolean canHaveNestedChildren() {
- return false;
- }
-
- public void addNestedChild(String name) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(getName());
- }
- }
-
-
- private static class Root extends TreeNode
- {
- public Root() {
- super(null, null);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Parent(this, name));
- }
- }
-
-
- private static class Parent extends TreeNode
- {
- public Parent(TreeNode parent, String name) {
- super(parent, name);
- }
-
- @Override
- public boolean canHaveChildren() {
- return true;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- @Override
- public boolean canHaveNestedChildren() {
- return true;
- }
-
- @Override
- public void addNestedChild(String name) {
- TreeNode nest = new Nest(this);
- addChild(nest);
- nest.addChild(name);
- }
-
- public Iterator<Child> nestlessChildren() {
- return new FilteringIterator<Child, Child>(
- new TransformationIterator<TreeNode, Child>(children()) {
- @Override
- protected Child transform(TreeNode next) {
- if (next instanceof Nest) {
- return ((Nest) next).child();
- }
- return (Child) next;
- }
- }) {
- @Override
- protected boolean accept(Child c) {
- return c != null;
- }
- };
- }
- }
-
-
- private static class Nest extends TreeNode
- {
- public Nest(TreeNode parent) {
- super(parent, "nest");
- }
-
- @Override
- public boolean canHaveChildren() {
- return children.size() == 0;
- }
-
- @Override
- public void addChild(String name) {
- addChild(new Child(this, name));
- }
-
- /* can only have one child */
- public Child child() {
- return (children.isEmpty()) ? null : (Child) children.get(0);
- }
- }
-
-
- private static class Child extends TreeNode
- {
- public Child(TreeNode parent, String name) {
- super(parent, name);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
deleted file mode 100644
index 3b6f3e3731..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.eclipse.jpt.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.platform.JpaPlatformRegistry;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatform;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUi;
-import org.eclipse.jpt.core.tests.internal.ProjectUtility;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-
-public class JpaPlatformUiExtensionTests extends TestCase
-{
- protected TestJpaProject testProject;
-
- protected static final String PROJECT_NAME = "ExtensionTestProject";
- protected static final String PACKAGE_NAME = "extension.test";
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = ExtensionTestPlugin.PLUGIN_ID;
-
- public static final String TEST_PLATFORM_ID = TestJpaPlatform.ID;
- public static final String TEST_PLATFORM_CLASS = TestJpaPlatform.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
- public static final String TEST_UI_PLATFORM_CLASS = TestJpaPlatformUi.class.getName();
-
- public JpaPlatformUiExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testProject = 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 {
- //testProject.dispose();
- ProjectUtility.deleteAllProjects();
- this.testProject = null;
- super.tearDown();
- }
-
- protected JpaProject jpaProject() {
- return this.testProject.getJpaProject();
- }
-
- public void testJpaPlatform() {
- assertNotNull(JpaPlatformRegistry.instance().jpaPlatform(jpaProject().jpaPlatform().getId()));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
deleted file mode 100644
index 50bcc99cfc..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.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.ui.tests.internal.platform;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUiPlatformTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiPlatformTests.class.getPackage().getName());
- suite.addTestSuite(JpaPlatformUiExtensionTests.class);
- return suite;
- }
-
- private JptUiPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index d2cf139f45..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.BooleanButtonModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-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.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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.Shell;
-
-/**
- * Play around with a set of check boxes.
- */
-public class CheckBoxModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new CheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private CheckBoxModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 1");
- BooleanButtonModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("flag 2");
- BooleanButtonModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("not flag 2");
- BooleanButtonModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText("unattached");
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildNotFlag2ToggleButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("flip flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.flipFlag1();
- }
- };
- action.setToolTipText("flip flag 1");
- return new ActionContributionItem(action);
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private void buildNotFlag2ToggleButton(Composite parent) {
- Button checkBox = new Button(parent, SWT.TOGGLE);
- checkBox.setText("not flag 2");
- BooleanButtonModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- CheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
deleted file mode 100644
index b3efc50bfa..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ListBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ListBoxModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * an example UI for testing various permutations of the
- * StructuredContentProviderAdapter
- */
-public class ListBoxModelAdapterUITest
- extends ApplicationWindow
-{
- final TaskList taskList;
- private final WritablePropertyValueModel<TaskList> taskListHolder;
- private Text taskTextField;
-
- public static void main(String[] args) throws Exception {
- Window window = new ListBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private ListBoxModelAdapterUITest(String[] args) {
- super(null);
- this.taskList = new TaskList();
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(this.taskList);
- this.taskList.addTask("swim");
- this.taskList.addTask("bike");
- this.taskList.addTask("run");
- Task rest = this.taskList.addTask("rest");
- this.taskList.addPriorityTask(rest);
- Task repeat = this.taskList.addTask("repeat");
- this.taskList.addPriorityTask(repeat);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(800, 400);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control taskListPanel = this.buildTaskListPanel(mainPanel);
- this.buildControlPanel(mainPanel, taskListPanel);
- return mainPanel;
- }
-
- private Control buildTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -30);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- this.buildPrimitiveTaskListPanel(panel);
- this.buildObjectTaskListPanel(panel);
-
- return panel;
- }
-
- private void buildPrimitiveTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(50);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedPrimitiveListPanel(panel);
- this.buildStandardSortedPrimitiveListPanel(panel);
- this.buildCustomSortedPrimitiveListPanel(panel);
- }
-
- private void buildObjectTaskListPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(50);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildUnsortedObjectListPanel(panel);
- this.buildStandardSortedObjectListPanel(panel);
- this.buildCustomSortedObjectListPanel(panel);
- }
-
- private void buildUnsortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive unsorted", this.buildUnsortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildStandardSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive sorted", this.buildStandardSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildCustomSortedPrimitiveListPanel(Composite parent) {
- this.buildListPanel(parent, "primitive reverse sorted", this.buildCustomSortedPrimitiveListModel(), new SimpleCollectionValueModel<String>());
- }
-
- private void buildUnsortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object unsorted", this.buildUnsortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildStandardSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object sorted", this.buildStandardSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private void buildCustomSortedObjectListPanel(Composite parent) {
- this.buildListPanel2(parent, "object reverse sorted", this.buildCustomSortedObjectListModel(), this.buildPriorityTaskListAdapter());
- }
-
- private ListValueModel<String> buildUnsortedPrimitiveListModel() {
- return this.buildPrimitiveTaskListAdapter();
- }
-
- private ListValueModel<String> buildStandardSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListValueModel<String> buildCustomSortedPrimitiveListModel() {
- return new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator());
- }
-
- private ListValueModel<Task> buildUnsortedObjectListModel() {
- return this.buildObjectTaskListAdapter();
- }
-
- private ListValueModel<Task> buildStandardSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter());
- }
-
- private ListValueModel<Task> buildCustomSortedObjectListModel() {
- return new SortedListValueModelAdapter<Task>(this.buildObjectTaskListAdapter(), this.buildCustomTaskComparator());
- }
-
- private <E> ListBoxModelAdapter<E> buildListPanel(Composite parent, String label, ListValueModel<E> model, CollectionValueModel<E> selectedItemsModel) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new FormLayout());
-
- Label listLabel = new Label(panel, SWT.LEFT | SWT.VERTICAL);
- listLabel.setText(label);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0, 3);
- fd.bottom = new FormAttachment(0, 20);
- fd.left = new FormAttachment(0, 5);
- fd.right = new FormAttachment(100);
- listLabel.setLayoutData(fd);
-
- org.eclipse.swt.widgets.List listBox = new org.eclipse.swt.widgets.List(panel, SWT.MULTI | SWT.BORDER);
- fd = new FormData();
- fd.top = new FormAttachment(listLabel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- listBox.setLayoutData(fd);
- return ListBoxModelAdapter.adapt(model, selectedItemsModel, listBox); // use #toString()
- }
-
- private void buildListPanel2(Composite parent, String label, ListValueModel<Task> model, CollectionValueModel<Task> selectedItemsModel) {
- ListBoxModelAdapter<Task> adapter = this.buildListPanel(parent, label, model, selectedItemsModel);
- adapter.addDoubleClickListener(this.buildDoubleClickListener());
- adapter.addSelectionChangeListener(this.buildSelectionChangeListener());
- }
-
- private ListBoxModelAdapter.DoubleClickListener<Task> buildDoubleClickListener() {
- return new ListBoxModelAdapter.DoubleClickListener<Task>() {
- public void doubleClick(ListBoxModelAdapter.DoubleClickEvent<Task> event) {
- System.out.println("double-click: " + event.selection());
- }
- };
- }
-
- private ListBoxModelAdapter.SelectionChangeListener<Task> buildSelectionChangeListener() {
- return new ListBoxModelAdapter.SelectionChangeListener<Task>() {
- public void selectionChanged(SelectionChangeEvent<Task> event) {
- ListBoxModelAdapterUITest.this.taskList.setPriorityTasks(event.selection());
- }
- };
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(this.taskListHolder, TaskList.TASK_NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildObjectTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.TASKS_LIST) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private CollectionValueModel<Task> buildPriorityTaskListAdapter() {
- return new CollectionAspectAdapter<TaskList, Task>(this.taskListHolder, TaskList.PRIORITY_TASKS_COLLECTION) {
- @Override
- protected Iterator<Task> iterator_() {
- return this.subject.priorityTasks();
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control taskListPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(taskListPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control misc = this.buildMiscTaskPanel(panel);
- this.buildAddRemoveTaskPanel(panel, misc);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildMiscTaskPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -400);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildClearListACI().fill(panel);
- this.buildClearModelACI().fill(panel);
- this.buildRestoreModelACI().fill(panel);
- this.buildAddPriorityTaskACI().fill(panel);
- this.buildRemovePriorityTaskACI().fill(panel);
- this.buildClearPriorityTasksACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildClearListACI() {
- Action action = new Action("clear list", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearTasks();
- }
- };
- action.setToolTipText("clear all the tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore the task list model");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildAddPriorityTaskACI() {
- Action action = new Action("add priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.addPriorityTask();
- }
- };
- action.setToolTipText("add a task to the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildRemovePriorityTaskACI() {
- Action action = new Action("remove priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.removePriorityTask();
- }
- };
- action.setToolTipText("remove a task from the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private ActionContributionItem buildClearPriorityTasksACI() {
- Action action = new Action("clear priority", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.clearPriorityTasks();
- }
- };
- action.setToolTipText("clear the priority tasks");
- return new ActionContributionItem(action);
- }
-
- private void buildAddRemoveTaskPanel(Composite parent, Control clearButton) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(clearButton);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FormLayout());
- Control addButton = this.buildAddButton(panel);
- Control removeButton = this.buildRemoveButton(panel);
- this.buildTaskTextField(panel, addButton, removeButton);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildAddButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(0, 50);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildAddACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildAddACI() {
- Action action = new Action("add", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.addTask();
- }
- };
- action.setToolTipText("add a task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- // is there a better way to associate an ACI with form data?
- private Control buildRemoveButton(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(100, -50);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildRemoveACI().fill(panel);
- return panel;
- }
-
- private ActionContributionItem buildRemoveACI() {
- Action action = new Action("remove", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- ListBoxModelAdapterUITest.this.removeTask();
- }
- };
- action.setToolTipText("remove the task with the name in the entry field");
- return new ActionContributionItem(action);
- }
-
- private void buildTaskTextField(Composite parent, Control addButton, Control removeButton) {
- this.taskTextField = new Text(parent, SWT.SINGLE | SWT.BORDER);
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(addButton);
- fd.right = new FormAttachment(removeButton);
- this.taskTextField.setLayoutData(fd);
- }
-
- private String taskTextFieldText() {
- return this.taskTextField.getText();
- }
-
- void addTask() {
- String taskText = this.taskTextFieldText();
- if (taskText.length() != 0) {
- this.taskList.addTask(taskText);
- }
- }
-
- void removeTask() {
- String task = this.taskTextFieldText();
- if (task.length() != 0) {
- this.taskList.removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList.clearTasks();
- }
-
- void clearModel() {
- this.taskListHolder.setValue(null);
- }
-
- void restoreModel() {
- this.taskListHolder.setValue(this.taskList);
- }
-
- void addPriorityTask() {
- Iterator<Task> tasks = this.taskList.tasks();
- while (tasks.hasNext()) {
- if (this.taskList.addPriorityTask(tasks.next())) {
- return;
- }
- }
- }
-
- void removePriorityTask() {
- Iterator<Task> pTasks = this.taskList.priorityTasks();
- if (pTasks.hasNext()) {
- this.taskList.removePriorityTask(pTasks.next());
- }
- }
-
- void clearPriorityTasks() {
- this.taskList.clearPriorityTasks();
- }
-
-
- // ********** TaskList **********
-
- // note absence of validation...
- private class TaskList extends AbstractModel {
- private final List<String> taskNames = new ArrayList<String>();
- public static final String TASK_NAMES_LIST = "taskNames";
- private final List<Task> tasks = new ArrayList<Task>();
- public static final String TASKS_LIST = "tasks";
- private final Collection<Task> priorityTasks = new HashSet<Task>();
- public static final String PRIORITY_TASKS_COLLECTION = "priorityTasks";
- TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.tasks.listIterator();
- }
- public Iterator<Task> priorityTasks() {
- return this.priorityTasks.iterator();
- }
- public Task addTask(String taskName) {
- this.addItemToList(taskName, this.taskNames, TASK_NAMES_LIST);
- Task task = new Task(taskName);
- this.addItemToList(task, this.tasks, TASKS_LIST);
- return task;
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- this.removeItemFromList(index, this.taskNames, TASK_NAMES_LIST);
- // assume the indexes match...
- Task removedTask = this.removeItemFromList(index, this.tasks, TASKS_LIST);
- this.removeItemFromCollection(removedTask, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- }
- public void clearTasks() {
- this.taskNames.clear();
- this.fireListCleared(TASK_NAMES_LIST);
- this.tasks.clear();
- this.fireListCleared(TASKS_LIST);
- }
- public boolean addPriorityTask(Task task) {
- return this.addItemToCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void removePriorityTask(Task task) {
- this.removeItemFromCollection(task, this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void clearPriorityTasks() {
- this.clearCollection(this.priorityTasks, PRIORITY_TASKS_COLLECTION);
- }
- public void setPriorityTasks(Iterator<Task> tasks) {
- this.priorityTasks.clear();
- while (tasks.hasNext()) {
- this.priorityTasks.add(tasks.next());
- }
- this.fireCollectionChanged(PRIORITY_TASKS_COLLECTION);
- }
- }
-
-
- // ********** Task **********
-
- private class Task extends AbstractModel implements Displayable {
- private String name;
- private Date creationTimeStamp;
- public Task(String name) {
- this.name = name;
- this.creationTimeStamp = new Date();
- }
- public String displayString() {
- return this.name + ": " + this.creationTimeStamp.getTime();
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return this.displayString();
- }
- }
-
- public interface Displayable extends Model, Comparable<Displayable> {
-
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString";
-
-
- // ********** helper implementations **********
-
- Collator DEFAULT_COLLATOR = Collator.getInstance();
-
- Comparator<Displayable> DEFAULT_COMPARATOR =
- new Comparator<Displayable>() {
- public int compare(Displayable d1, Displayable d2) {
- // disallow duplicates based on object identity
- if (d1 == d2) {
- return 0;
- }
-
- // first compare display strings using the default collator
- int result = DEFAULT_COLLATOR.compare(d1.displayString(), d2.displayString());
- if (result != 0) {
- return result;
- }
-
- // then compare using object-id
- result = System.identityHashCode(d1) - System.identityHashCode(d2);
- if (result != 0) {
- return result;
- }
-
- // It's unlikely that we get to this point; but, just in case, we will return -1.
- // Unfortunately, this introduces some mild unpredictability to the sort order
- // (unless the objects are always passed into this method in the same order).
- return -1; // if all else fails, indicate that o1 < o2
- }
- @Override
- public String toString() {
- return "Displayable.DEFAULT_COMPARATOR";
- }
- };
-
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
deleted file mode 100644
index 6f812805de..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TextFieldModelAdapterUITest.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.TextFieldModelAdapter;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Play around with a set of entry fields.
- */
-public class TextFieldModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<String> nameHolder;
- private final WritablePropertyValueModel<String> allCapsNameHolder;
-
-
- public static void main(String[] args) throws Exception {
- Window window = new TextFieldModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TextFieldModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.allCapsNameHolder = this.buildAllCapsNameHolder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildAllCapsNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.name().toUpperCase();
- }
- @Override
- protected void setValue_(String value) {
- // do nothing
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control textFieldPanel = this.buildTextFieldPanel(mainPanel);
- this.buildControlPanel(mainPanel, textFieldPanel);
- return mainPanel;
- }
-
- private Control buildTextFieldPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildNameTextField(panel);
- this.buildReadOnlyNameTextField(panel);
- this.buildAllCapsNameTextField(panel);
-
- return panel;
- }
-
- private void buildNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildReadOnlyNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(this.nameHolder, textField);
- }
-
- private void buildAllCapsNameTextField(Composite parent) {
- Text textField = new Text(parent, SWT.SINGLE);
- textField.setEnabled(false);
- TextFieldModelAdapter.adapt(this.allCapsNameHolder, textField);
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildResetNameButton(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildResetNameButton(Composite parent) {
- this.buildResetNameACI().fill(parent);
- }
-
- private ActionContributionItem buildResetNameACI() {
- Action action = new Action("reset name", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.resetName();
- }
- };
- action.setToolTipText("reset name");
- return new ActionContributionItem(action);
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TextFieldModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.name());
- }
-
-
- // ********** model class **********
-
- class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String name() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
deleted file mode 100644
index 80b8840a85..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.swt;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.widgets.DefaultWidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-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.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Play around with a set of tri-state check boxes.
- */
-public class TriStateCheckBoxModelAdapterUITest
- extends ApplicationWindow
-{
- private final TestModel testModel;
- private final WritablePropertyValueModel<TestModel> testModelHolder;
- private final WritablePropertyValueModel<Boolean> flag1Holder;
- private final WritablePropertyValueModel<Boolean> flag2Holder;
- private final WritablePropertyValueModel<Boolean> notFlag2Holder;
-
- public static void main(String[] args) throws Exception {
- Window window = new TriStateCheckBoxModelAdapterUITest(args);
- window.setBlockOnOpen(true);
- window.open();
- Display.getCurrent().dispose();
- System.exit(0);
- }
-
- private TriStateCheckBoxModelAdapterUITest(String[] args) {
- super(null);
- this.testModel = new TestModel(Boolean.TRUE, Boolean.FALSE);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag1();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Boolean>(subjectHolder, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.isNotFlag2();
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value);
- }
- };
- }
-
- @Override
- protected Control createContents(Composite parent) {
- ((Shell) parent).setText(ClassTools.shortClassNameForObject(this));
- parent.setSize(400, 100);
- Composite mainPanel = new Composite(parent, SWT.NONE);
- mainPanel.setLayout(new FormLayout());
- Control checkBoxPanel = this.buildCheckBoxPanel(mainPanel);
- this.buildControlPanel(mainPanel, checkBoxPanel);
- return mainPanel;
- }
-
- private Control buildCheckBoxPanel(Composite parent) {
- Composite panel = new Composite(parent, SWT.NONE);
-
- FormData fd = new FormData();
- fd.top = new FormAttachment(0);
- fd.bottom = new FormAttachment(100, -35);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlag1CheckBox(panel);
- this.buildFlag2CheckBox(panel);
- this.buildNotFlag2CheckBox(panel);
- this.buildUnattachedCheckBox(panel);
-
- return panel;
- }
-
- private void buildFlag1CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 1", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag1Holder, checkBox);
- }
-
- private void buildFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.flag2Holder, checkBox);
- }
-
- private void buildNotFlag2CheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "next flag 2", DefaultWidgetFactory.instance());
- TriStateCheckBoxModelAdapter.adapt(this.notFlag2Holder, checkBox);
- }
-
- private void buildUnattachedCheckBox(Composite parent) {
- TriStateCheckBox checkBox = new TriStateCheckBox(parent, "unattached", DefaultWidgetFactory.instance());
- checkBox.addSelectionListener(this.buildUnattachedSelectionListener());
- }
-
- private SelectionListener buildUnattachedSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- System.out.println("unattached default selected: " + e);
- }
- public void widgetSelected(SelectionEvent e) {
- System.out.println("unattached selected: " + e);
- }
- };
- }
-
- private void buildControlPanel(Composite parent, Control checkBoxPanel) {
- Composite panel = new Composite(parent, SWT.NONE);
- FormData fd = new FormData();
- fd.top = new FormAttachment(checkBoxPanel);
- fd.bottom = new FormAttachment(100);
- fd.left = new FormAttachment(0);
- fd.right = new FormAttachment(100);
- panel.setLayoutData(fd);
-
- panel.setLayout(new FillLayout());
- this.buildFlipFlag1Button(panel);
- this.buildClearModelButton(panel);
- this.buildRestoreModelButton(panel);
- this.buildPrintModelButton(panel);
- }
-
- private void buildFlipFlag1Button(Composite parent) {
- this.buildFlipFlag1ACI().fill(parent);
- }
-
- private ActionContributionItem buildFlipFlag1ACI() {
- Action action = new Action("next flag 1", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.nextFlag1();
- }
- };
- action.setToolTipText("next flag 1");
- return new ActionContributionItem(action);
- }
-
- void nextFlag1() {
- this.testModel.nextFlag1();
- }
-
- private void buildClearModelButton(Composite parent) {
- this.buildClearModelACI().fill(parent);
- }
-
- private ActionContributionItem buildClearModelACI() {
- Action action = new Action("clear model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setToolTipText("clear model");
- return new ActionContributionItem(action);
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private void buildRestoreModelButton(Composite parent) {
- this.buildRestoreModelACI().fill(parent);
- }
-
- private ActionContributionItem buildRestoreModelACI() {
- Action action = new Action("restore model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setToolTipText("restore model");
- return new ActionContributionItem(action);
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private void buildPrintModelButton(Composite parent) {
- this.buildPrintModelACI().fill(parent);
- }
-
- private ActionContributionItem buildPrintModelACI() {
- Action action = new Action("print model", IAction.AS_PUSH_BUTTON) {
- @Override
- public void run() {
- TriStateCheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setToolTipText("print model");
- return new ActionContributionItem(action);
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private Boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private Boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private Boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(Boolean flag1, Boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = this.next(flag2);
- }
- private Boolean next(Boolean b) {
- return (b == null) ? Boolean.TRUE : b.booleanValue() ? Boolean.FALSE : null;
- }
- public Boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(Boolean flag1) {
- Boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public void nextFlag1() {
- this.setFlag1(this.next(this.flag1));
- }
- public Boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(Boolean flag2) {
- Boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = this.next(flag2);
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public void nextFlag2() {
- this.setFlag2(this.next(this.flag2));
- }
- public Boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(Boolean notFlag2) {
- this.setFlag2(this.next(flag2));
- }
- public void nextNotFlag2() {
- this.setNotFlag2(this.next(this.notFlag2));
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
deleted file mode 100644
index 0f3477dafe..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
+++ /dev/null
@@ -1,674 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlAlignerTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout(1, false));
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testAddControl1() throws Exception {
-
- Label label = new Label(parent, SWT.NULL);
- updateGridData(label);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(label);
-
- assertEquals(
- "The maximum width should be 0,",
- 0,
- controlAligner.getMaximumWidth()
- );
-
- label.setText("This is a ControlAligner");
- parent.layout(true, true);
-
- Point size = label.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl2() throws Exception {
-
- Button button = new Button(parent, SWT.NULL);
- updateGridData(button);
- button.setText("This is a ControlAligner");
- parent.layout(true, true);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(button);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControl3() throws Exception {
-
- Label label = new Label(parent, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(parent, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- parent.layout(true, true);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- ControlAligner controlAligner1 = new ControlAligner();
- controlAligner1.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner1.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
- parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testAddControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- ControlAligner controlAligner1 = new ControlAligner();
- controlAligner1.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
-
- controlAligner1.add(controlAligner2);
- parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test(expected=IllegalArgumentException.class)
- public void testAddControlAlignerToItself() throws Exception {
- ControlAligner aligner = new ControlAligner();
- aligner.add(aligner);
- fail("A ControlAligner can't be added to itself");
- }
-
- @Test
- public void testDialog_AddControl1() throws Exception {
-
- final ControlAligner controlAligner = new ControlAligner();
- final int[] maximumWidth = new int[1];
- final int[] size = new int[1];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- label = new Label(parent, SWT.LEFT);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- size[0] = label.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- assertEquals(
- "The width should be " + size[0] + ",",
- size[0],
- maximumWidth[0]
- );
- }
-
- @Test
- public void testDialog_AddControl2() throws Exception {
-
- final ControlAligner controlAligner = new ControlAligner();
- final int[] maximumWidth = new int[1];
- final int[] sizes = new int[2];
-
- TitleAreaDialog dialog = new TitleAreaDialog(SWTUtil.getShell()) {
-
- private Button button;
- private Label label;
-
- @Override
- protected Control createDialogArea(Composite parent) {
-
- label = new Label(parent, SWT.NULL);
- label.setText("This is a ControlAligner");
- updateGridData(label);
-
- controlAligner.add(label);
-
- button = new Button(parent, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
-
- controlAligner.add(button);
-
- return parent;
- }
-
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
- sizes[0] = label.getSize().x;
- sizes[1] = button.getSize().x;
- maximumWidth[0] = controlAligner.getMaximumWidth();
- }
- };
-
- dialog.create();
- dialog.close();
-
- int labelSize = sizes[0];
- int buttonSize = sizes[1];
- int max = Math.max(labelSize, buttonSize);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- maximumWidth[0]
- );
- }
-
- @Test
- public void testHierarchyOfControlAligners() throws Exception {
-
- // Aligner1
- // ^
- // |-Aligner2
- // ^
- // |-Aligner3
- ControlAligner aligner1 = new ControlAligner();
-
- ControlAligner aligner2 = new ControlAligner();
- aligner1.add(aligner2);
-
- ControlAligner aligner3 = new ControlAligner();
- aligner2.add(aligner3);
-
- // Test 1
- Label label1 = new Label(parent, SWT.NULL);
- label1.setText("This is a label widget");
- parent.layout(true);
-
- int labelWidth1 = label1.getSize().x;
- aligner3.add(label1);
-
- assertEquals(aligner3.getMaximumWidth(), labelWidth1);
- assertEquals(aligner2.getMaximumWidth(), labelWidth1);
- assertEquals(aligner1.getMaximumWidth(), labelWidth1);
-
- // Test 2
- Label label2 = new Label(parent, SWT.NULL);
- label2.setText("ShortLabel");
- parent.layout(true);
- aligner2.add(label2);
-
- int newLabelWidth1 = label1.getSize().x;
- int newLabelWidth2 = label2.getSize().x;
-
- assertEquals(aligner3.getMaximumWidth(), aligner2.getMaximumWidth());
- assertEquals(aligner2.getMaximumWidth(), aligner1.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth1, aligner1.getMaximumWidth());
-
- // Test 3
- Label label3 = new Label(parent, SWT.NULL);
- label3.setText("A very long label that takes a lot of horizontal space");
- parent.layout(true);
- aligner1.add(label3);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- int newLabelWidth3 = label3.getSize().x;
-
- assertEquals(aligner3.getMaximumWidth(), aligner2.getMaximumWidth());
- assertEquals(aligner2.getMaximumWidth(), aligner1.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, aligner1.getMaximumWidth());
-
- // Make sure all the locked are removed
- assertEquals(ClassTools.attemptToGetFieldValue(aligner1, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label2
- label2.setText("mm");
- parent.layout(true);
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(aligner3.getMaximumWidth(), aligner2.getMaximumWidth());
- assertEquals(aligner2.getMaximumWidth(), aligner1.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, aligner1.getMaximumWidth());
-
- assertEquals(ClassTools.attemptToGetFieldValue(aligner1, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("a");
- parent.layout(true);
-
- Composite parent1 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent1.setLayout(new GridLayout());
-
- Label tempLabel = new Label(parent1, SWT.NULL);
- tempLabel.setText("a");
- parent1.layout(true);
-
- int realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(aligner3.getMaximumWidth(), aligner2.getMaximumWidth());
- assertEquals(aligner2.getMaximumWidth(), aligner1.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(newLabelWidth1, aligner1.getMaximumWidth());
- assertFalse(newLabelWidth1 == realWidth);
-
- assertEquals(ClassTools.attemptToGetFieldValue(aligner1, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner3, "locked"), Boolean.FALSE);
-
- // Change the text of label1
- label1.setText("Yes another big long long text so that all the labels will have to take the size of this label to make sure ControlAligner works correctly");
- parent.layout(true);
-
- // Weird: It seems no notification is sent, fire one manually
- Event event = new Event();
- event.widget = label1;
- event.type = SWT.Resize;
- label1.notifyListeners(SWT.Resize, event);
-
- Composite parent2 = new Composite(SWTUtil.getShell(), SWT.NULL);
- parent2.setLayout(new GridLayout());
-
- tempLabel = new Label(parent2, SWT.NULL);
- tempLabel.setText(label1.getText());
- parent2.layout(true);
-
- realWidth = tempLabel.getSize().x;
-
- newLabelWidth1 = label1.getSize().x;
- newLabelWidth2 = label2.getSize().x;
- newLabelWidth3 = label3.getSize().x;
-
- assertEquals(aligner3.getMaximumWidth(), aligner2.getMaximumWidth());
- assertEquals(aligner2.getMaximumWidth(), aligner1.getMaximumWidth());
- assertEquals(newLabelWidth1, newLabelWidth2);
- assertEquals(newLabelWidth2, newLabelWidth3);
- assertEquals(aligner1.getMaximumWidth(), newLabelWidth1);
- assertEquals(realWidth, newLabelWidth1);
-
- assertEquals(ClassTools.attemptToGetFieldValue(aligner1, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner2, "locked"), Boolean.FALSE);
- assertEquals(ClassTools.attemptToGetFieldValue(aligner3, "locked"), Boolean.FALSE);
- }
-
- @Test
- public void testRemoveControl1() throws Exception {
-
- Button button = new Button(parent, SWT.NULL);
- button.setText("This is a ControlAligner");
- updateGridData(button);
- parent.layout(true, true);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(button);
-
- Point size = button.getSize();
-
- assertEquals(
- "The width should be " + size.x + ",",
- size.x,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(button);
-
- assertEquals(
- "The width should be -1, ",
- -1,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl2() throws Exception {
-
- Label label = new Label(parent, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(parent, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
- parent.layout(true, true);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- controlAligner.remove(label);
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControl3() throws Exception {
-
- Label label = new Label(parent, SWT.NULL);
- label.setText("This is very long text");
- updateGridData(label);
-
- Button button = new Button(parent, SWT.NULL);
- button.setText("Short text");
- updateGridData(button);
- parent.layout(true, true);
-
- ControlAligner controlAligner = new ControlAligner();
- controlAligner.add(label);
- controlAligner.add(button);
-
- Point labelSize = label.getSize();
- Point buttonSize = button.getSize();
- int max = Math.max(labelSize.x, buttonSize.x);
-
- assertEquals(
- "The width should be " + max + ",",
- max,
- controlAligner.getMaximumWidth()
- );
-
- label.dispose();
-
- Point newButtonSize = button.getSize();
-
- assertNotSame(
- "The old max and new max should not be the same",
- max,
- newButtonSize.x
- );
-
- assertEquals(
- "The ControlAligner doesn't have the right maximum width",
- newButtonSize.x,
- controlAligner.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControlAligner1() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- ControlAligner controlAligner1 = new ControlAligner();
- controlAligner1.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner1.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
- parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner1.remove(label1);
-
- width = label2.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- @Test
- public void testRemoveControlAligner2() throws Exception {
-
- Label label1 = new Label(parent, SWT.NULL);
- Label label2 = new Label(parent, SWT.NULL);
-
- updateGridData(label1);
- updateGridData(label2);
-
- ControlAligner controlAligner1 = new ControlAligner();
- controlAligner1.add(label1);
-
- ControlAligner controlAligner2 = new ControlAligner();
- controlAligner1.add(controlAligner2);
- controlAligner2.add(label2);
-
- label1.setText("This is a ControlAligner");
- label2.setText("This is a very long ControlAligner");
- parent.layout(true, true);
-
- Point size1 = label1.getSize();
- Point size2 = label2.getSize();
- int width = Math.max(size1.x, size2.x);
-
- // Test 1
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
-
- // Test 2
- controlAligner2.remove(label2);
-
- width = label1.getSize().x;
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner1.getMaximumWidth()
- );
-
- assertEquals(
- "The width should be " + width + ",",
- width,
- controlAligner2.getMaximumWidth()
- );
- }
-
- private void updateGridData(Control control) {
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = false;
- control.setLayoutData(data);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
deleted file mode 100644
index 7062cc92f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- new ControlEnabler(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be enabled",
- combo.isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be enabled",
- combo.isEnabled()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
deleted file mode 100644
index f43e2bcf63..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-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.Text;
-import org.eclipse.ui.part.PageBook;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlSwitcherTest {
-
- private PageBook pageBook;
- private Composite pane1;
- private Composite pane2;
- private Composite parent;
-
- private Composite buildPane1() {
-
- if (pane1 == null) {
-
- pane1 = new Composite(pageBook, SWT.NULL);
- pane1.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane1, SWT.NULL);
- label.setText("&Test2:");
-
- Text text = new Text(pane1, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo combo = new Combo(pane1, SWT.BORDER);
-
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- combo.setLayoutData(data);
- }
-
- return pane1;
- }
-
- private Composite buildPane2() {
-
- if (pane2 == null) {
-
- pane2 = new Composite(pageBook, SWT.NULL);
- pane2.setLayout(new GridLayout(2, false));
-
- Label label = new Label(pane2, SWT.NULL);
- label.setText("&Test1:");
-
- Text text = new Text(pane2, SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
-
- return pane2;
- }
-
- private Transformer<Boolean, Control> buildTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean value) {
- return (value == null) ? null : (value ? pane1 : pane2);
- }
- };
- }
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
-
- pageBook = new PageBook(parent, SWT.NULL);
- pageBook.setLayoutData(new GridData());
- }
-
- @After
- public void tearDown() {
-
- if (parent != null) {
-
- parent.dispose();
-
- parent = null;
- pageBook = null;
- }
- }
-
- @Test
- public void testSwitch() {
-
- SimplePropertyValueModel<Boolean> switchHolder = new SimplePropertyValueModel<Boolean>();
- Transformer<Boolean, Control> transformer = buildTransformer();
-
- pane1 = buildPane1();
- pane1.setVisible(false);
-
- pane2 = buildPane2();
- pane2.setVisible(false);
-
- new ControlSwitcher(
- switchHolder,
- transformer,
- pageBook
- );
-
- // Test 1
- switchHolder.setValue(true);
- Control control = (Control) ClassTools.fieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane1",
- pane1,
- control
- );
-
- Point pane1Size = pane1.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane1",
- pane1Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane1",
- pane1Size.y,
- pageBookSize.y
- );
-
- // Test 2
- switchHolder.setValue(false);
- control = (Control) ClassTools.fieldValue(pageBook, "currentPage");
-
- assertNotNull(
- "The page book's page shouldn't be null",
- control
- );
-
- assertSame(
- "The current pane should be pane2",
- pane2,
- control
- );
-
- Point pane2Size = pane2.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- pageBookSize = pageBook.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- assertEquals(
- "The width of the PageBook should be the same as the width of pane2",
- pane2Size.x,
- pageBookSize.x
- );
-
- assertEquals(
- "The height of the PageBook should be the same as the height of pane2",
- pane2Size.y,
- pageBookSize.y
- );
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
deleted file mode 100644
index 3eaff35309..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.ControlVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class ControlVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- Combo combo = new Combo(parent, SWT.BORDER);
-
- new ControlVisibilityEnabler(booleanHolder, combo);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The Combo should be visible",
- combo.isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The Combo should not be visible",
- combo.isVisible()
- );
-
- // Dispose
- combo.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java
deleted file mode 100644
index 81cfb08253..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@SuiteClasses
-({
- ControlAlignerTest.class,
- ControlSwitcherTest.class,
- ControlEnablerTest.class,
- ControlVisibilityEnablerTest.class,
- LabeledButtonTest.class,
- LabeledLabelTest.class,
- LabeledControlUpdaterTest.class,
- PaneEnablerTest.class,
- PaneVisibilityEnablerTest.class,
-})
-@RunWith(Suite.class)
-public final class JptUiUtilTests {
-
- private JptUiUtilTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new JUnit4TestAdapter(JptUiUtilTests.class));
- return suite;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java
deleted file mode 100644
index 8057d1b29d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledButtonTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Button button = new Button(parent, SWT.NULL);
- new LabeledButton(button);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledButton(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- labeledButton.setImage(expected);
-
- assertEquals(
- "The Button didn't receive the Image",
- expected,
- button.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- labeledButton.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- String expected = "This is a test";
- labeledButton.setText(expected);
-
- assertEquals(
- "The Button didn't receive the text",
- expected,
- button.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Button button = new Button(parent, SWT.NULL);
- LabeledButton labeledButton = new LabeledButton(button);
-
- button.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledButton.setText(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java
deleted file mode 100644
index bb1385264f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledControlUpdaterTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<Image> imageHolder = new SimplePropertyValueModel<Image>();
- new LabeledControlUpdater(labeledLabel, null, imageHolder);
-
- label.dispose();
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- String expected = "This is a test";
- textHolder.setValue(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
-
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- WritablePropertyValueModel<String> textHolder = new SimplePropertyValueModel<String>();
- new LabeledControlUpdater(labeledLabel, textHolder);
-
- label.dispose();
-
- String expected = "This is a test";
- textHolder.setValue(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java
deleted file mode 100644
index 5440d3c21d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class LabeledLabelTest {
-
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- parent = null;
- }
- }
-
- @Test
- public void testLabeledButton1() {
- Label label = new Label(parent, SWT.NULL);
- new LabeledLabel(label);
- }
-
- @Test(expected=AssertionFailedException.class)
- public void testLabeledButton2() {
- new LabeledLabel(null);
- }
-
- @Test
- public void testSetImage() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- labeledLabel.setImage(expected);
-
- assertEquals(
- "The Label didn't receive the Image",
- expected,
- label.getImage()
- );
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetImageDispose() {
-
- Image expected = new Image(parent.getDisplay(), 16, 16);
-
- try {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- labeledLabel.setImage(expected);
- }
- finally {
- expected.dispose();
- }
- }
-
- @Test
- public void testSetText() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- String expected = "This is a test";
- labeledLabel.setText(expected);
-
- assertEquals(
- "The Label didn't receive the text",
- expected,
- label.getText()
- );
- }
-
- @Test
- public void testSetTextDispose() {
- Label label = new Label(parent, SWT.NULL);
- LabeledLabel labeledLabel = new LabeledLabel(label);
-
- label.dispose();
-
- // This should not fail but simply do nothing
- String expected = "This is a test";
- labeledLabel.setText(expected);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
deleted file mode 100644
index 53637277fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class PaneEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- AbstractDialogPane<Node> pane = new AbstractDialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- pane.populate();
- new PaneEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be enabled",
- pane.getControl().isEnabled()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be enabled",
- pane.getControl().isEnabled()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
deleted file mode 100644
index 2d88c9c114..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.ui.tests.internal.util;
-
-import org.eclipse.jpt.ui.internal.util.PaneVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.AbstractDialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-@SuppressWarnings("nls")
-public final class PaneVisibilityEnablerTest {
- private Composite parent;
-
- @Before
- public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
- }
-
- @After
- public void tearDown() {
- if (parent != null) {
- parent.dispose();
- }
- }
-
- @Test
- public void testSwitchState() {
-
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
-
- AbstractDialogPane<Node> pane = new AbstractDialogPane<Node>(
- new SimplePropertyValueModel<Node>(),
- parent)
- {
- @Override
- protected void initializeLayout(Composite container) {
- }
- };
-
- pane.populate();
- new PaneVisibilityEnabler(booleanHolder, pane);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (null)
- booleanHolder.setValue(null);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (true)
- booleanHolder.setValue(true);
-
- assertTrue(
- "The pane should be visible",
- pane.getControl().isVisible()
- );
-
- // Change state (false)
- booleanHolder.setValue(false);
-
- assertFalse(
- "The pane should not be visible",
- pane.getControl().isVisible()
- );
-
- // Dispose
- pane.dispose();
- booleanHolder.setValue(true);
- }
-}
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 ef8d91ca94..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
+++ /dev/null
@@ -1,11 +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/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <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 c4ba612bad..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args \ No newline at end of file
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 f68f9c2597..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:26 EST 2008
-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 80cdca5ccf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +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.2.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,
- org.eclipse.jpt.utility.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.listener;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.prefs;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.swing;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.node;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 8f2e9b8492..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
+++ /dev/null
@@ -1,243 +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 testFlagIsSetIntInt() {
- assertTrue(BitTools.flagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.flagIsSet(0x0303, 0x0103));
-
- assertFalse(BitTools.flagIsSet(0x0303, 0x1103));
- assertFalse(BitTools.flagIsSet(0x0000, 0x1103));
- }
-
- public void testFlagIsOffIntInt() {
- assertFalse(BitTools.flagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0001));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0101));
- assertFalse(BitTools.flagIsOff(0x0303, 0x0103));
-
- assertTrue(BitTools.flagIsOff(0x2204, 0x1103));
- assertTrue(BitTools.flagIsOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagIsSetIntInt() {
- assertFalse(BitTools.onlyFlagIsSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagIsSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagIsSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagIsOffIntInt() {
- assertFalse(BitTools.onlyFlagIsOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagIsOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagIsOff(0xFFFFEEFC, 0x1103));
- }
-
- 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 testAllFlagsAreOffIntInt() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0001));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0101));
- assertFalse(BitTools.allFlagsAreOff(0x0303, 0x0103));
-
- assertTrue(BitTools.allFlagsAreOff(0x2204, 0x1103));
- assertTrue(BitTools.allFlagsAreOff(0x0000, 0x1103));
- }
-
- public void testOnlyFlagsAreSetIntInt() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, 0x1103));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, 0x1103));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, 0x0103));
- }
-
- public void testOnlyFlagsAreOffIntInt() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, 0x0001));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0001));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, 0x0001));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0101));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, 0x0101));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x0103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, 0x0103));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, 0x1103));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, 0x1103));
- }
-
- 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 testAnyFlagsAreOffIntInt() {
- assertTrue(BitTools.anyFlagsAreOff(0x333E, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0xFFFE, 0x0001));
- assertTrue(BitTools.anyFlagsAreOff(0x0003, 0xFFFF));
-
- assertFalse(BitTools.anyFlagsAreOff(0x7373, 0x1010));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, 0xFFFF));
- }
-
- 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 testAllFlagsAreOffIntIntArray() {
- assertFalse(BitTools.allFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0001 }));
- assertFalse(BitTools.allFlagsAreOff(0x0303, new int[] { 0x0100, 0x0002, 0x0001 }));
-
- assertTrue(BitTools.allFlagsAreOff(0x0303, new int[] { 0x1000, 0x0400, 0x0020, 0x0000 }));
- assertTrue(BitTools.allFlagsAreOff(0x0000, new int[] { 0x1000, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreSetIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreSet(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0001, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0101, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0303, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x1103, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreSet(0x0000, new int[] { 0x011, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreSet(0x0103, new int[] { 0x0101, 0x0100, 0x0002, 0x0001 }));
- }
-
- public void testOnlyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.onlyFlagsAreOff(0x0003, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFFFE, new int[] { 0x001, 0x0000, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFE, new int[] { 0x001, 0x0100, 0x0000, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFFEFC, new int[] { 0x001, 0x0100, 0x0002, 0x0001 }));
-
- assertFalse(BitTools.onlyFlagsAreOff(0x0303, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- assertTrue(BitTools.onlyFlagsAreOff(0xFFFFEEFC, new int[] { 0x1100, 0x0100, 0x0002, 0x0001 }));
- }
-
- 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 }));
- }
-
- public void testAnyFlagsAreOffIntIntArray() {
- assertFalse(BitTools.anyFlagsAreOff(0x0003, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0xFFFF, new int[] { 0x0001 }));
- assertFalse(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0200, 0x0003, 0x0002 }));
-
- assertTrue(BitTools.anyFlagsAreOff(0x0303, new int[] { 0x0100, 0x0010 }));
- assertTrue(BitTools.anyFlagsAreOff(0x0000, new int[] { 0xF000, 0x0F00, 0x00F0, 0x000F }));
- }
-
- public void testOrFlags() {
- assertEquals(0x0001, BitTools.orFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0011, BitTools.orFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF011, BitTools.orFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- }
-
- public void testAndFlags() {
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0001 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0x0000, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0x0001, BitTools.andFlags(new int[] { 0x0001, 0x0011, 0xF001 }));
- }
-
- public void testXorFlags() {
- assertEquals(0x0001, BitTools.xorFlags(new int[] { 0x0001, 0x0000 }));
- assertEquals(0x0010, BitTools.xorFlags(new int[] { 0x0001, 0x0011 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000 }));
- assertEquals(0xFF11, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01 }));
- assertEquals(0xF010, BitTools.xorFlags(new int[] { 0x0001, 0x0011, 0xF000, 0x0F01, 0x0F01 }));
- }
-
-}
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 f2e4eae173..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassToolsTests.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.fieldValue(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.fieldValue(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 testFieldValue() {
- int initialCapacity = 200;
- Vector<?> v = new Vector<Object>(initialCapacity);
- Object[] elementData = (Object[]) ClassTools.fieldValue(v, "elementData");
- assertEquals(initialCapacity, elementData.length);
-
- // test inherited field
- Integer modCountInteger = (Integer) ClassTools.fieldValue(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 testClassIsPrimitiveWrapperClass() {
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Void.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsPrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsPrimitiveWrapperClass(int.class));
- }
-
- public void testClassIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Void.class));
-
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Boolean.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Integer.class));
- assertTrue(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.Float.class));
-
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(java.lang.String.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(void.class));
- assertFalse(ClassTools.classIsVariablePrimitiveWrapperClass(int.class));
- }
-
- public void testClassNamedIsPrimitive() {
- assertTrue(void.class.isPrimitive());
-
- assertTrue(ClassTools.classNamedIsPrimitive(void.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsPrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Boolean.class.getName()));
- assertFalse(ClassTools.classNamedIsPrimitive(java.lang.Integer.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitive() {
- assertFalse(ClassTools.classNamedIsVariablePrimitive(void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitive(int.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitive(boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitive(java.lang.Boolean.class.getName()));
- }
-
- public void testClassNamedIsVariablePrimitiveWrapperClass() {
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Void.class.getName()));
-
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Integer.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Float.class.getName()));
- assertTrue(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Boolean.class.getName()));
-
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Number.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.String.class.getName()));
- assertFalse(ClassTools.classNamedIsVariablePrimitiveWrapperClass(java.lang.Object.class.getName()));
- }
-
- public void testClassForTypeDeclarationStringInt() 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 testClassNameForTypeDeclarationString() throws Exception {
- assertEquals("int", ClassTools.classNameForTypeDeclaration("int"));
- assertEquals("[I", ClassTools.classNameForTypeDeclaration("int[]"));
- assertEquals("[[I", ClassTools.classNameForTypeDeclaration("int [ ] [ ]"));
-
- assertEquals("java.lang.Object", ClassTools.classNameForTypeDeclaration("java.lang.Object"));
- assertEquals("[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]"));
- assertEquals("[[Ljava.lang.Object;", ClassTools.classNameForTypeDeclaration("java.lang.Object\t[]\t[]"));
- }
-
- public void testArrayDepthForTypeDeclarationString() throws Exception {
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("java.lang.Object[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("int"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("int[]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("int[][][]"));
-
- assertEquals(0, ClassTools.arrayDepthForTypeDeclaration("float"));
- assertEquals(1, ClassTools.arrayDepthForTypeDeclaration("float [ ]"));
- assertEquals(3, ClassTools.arrayDepthForTypeDeclaration("float[] [] []"));
- }
-
- public void testClassNameForTypeDeclarationStringInt() 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 4e19dac30c..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.entries();
- 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.entries();
- 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 a9c4ef3268..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,3881 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.LinkedList;
-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.EmptyIterable;
-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;
-import org.eclipse.jpt.utility.internal.iterators.EmptyEnumeration;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-public class CollectionToolsTests extends TestCase {
-
- public CollectionToolsTests(String name) {
- super(name);
- }
-
- public void testAddObjectArrayObject_Object() {
- Object[] a = CollectionTools.add(this.buildObjectArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_String() {
- String[] a = CollectionTools.add(this.buildStringArray1(), "twenty");
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[a.length-1]);
- }
-
- public void testAddObjectArrayObject_EmptyArray() {
- String[] a = new String[0];
- a = CollectionTools.add(a, "twenty");
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, "twenty"));
- assertEquals("twenty", a[0]);
- }
-
- public void testAddObjectArrayIntObject_Object() {
- 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 testAddObjectArrayIntObject_String() {
- 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 testAddObjectArrayIntObject_End() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 4, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "a", "b", "c", "d", "X" }, a));
- }
-
- public void testAddObjectArrayIntObject_Zero() {
- String[] a = new String[] { "a", "b", "c", "d" };
- a = CollectionTools.add(a, 0, "X");
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new String[] { "X", "a", "b", "c", "d" }, a));
- }
-
- public void testAddObjectArrayIntObject_Exception() {
- 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 testAddCharArrayChar_Empty() {
- char[] a = new char[0];
- a = CollectionTools.add(a, 'd');
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 'd'));
- assertTrue(Arrays.equals(new char[] { 'd' }, a));
- }
-
- 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 testAddCharArrayIntChar_Zero() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 0, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'a', 'b', 'c', 'd' }, a));
- }
-
- public void testAddCharArrayIntChar_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.add(a, 4, 'X');
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X' }, a));
- }
-
- public void testAddIntArrayInt() {
- int[] a = CollectionTools.add(this.buildIntArray(), 30);
- assertEquals(4, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- }
-
- public void testAddIntArrayInt_Empty() {
- int[] a = new int[0];
- a = CollectionTools.add(a, 30);
- assertEquals(1, a.length);
- assertTrue(CollectionTools.contains(a, 30));
- assertTrue(Arrays.equals(new int[] { 30 }, a));
- }
-
- 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 testAddIntArrayIntInt_Zero() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 0, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 1, 2, 3, 4 }, a));
- }
-
- public void testAddIntArrayIntInt_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.add(a, 4, 99);
- assertEquals(5, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99 }, a));
- }
-
- public void testAddAllCollectionIterable_StringModified() {
- List<String> list1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterable_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterable_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- Iterable<String> iterable2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, iterable2));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll((List<String>) iterable2));
- }
-
- public void testAddAllCollectionIterable_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- Iterable<String> iterable3 = this.buildStringList1(); // same elements as set1
- assertFalse(CollectionTools.addAll(set1, iterable3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll((List<String>) iterable3));
- }
-
- public void testAddAllCollectionIterable_EmptyIterable() {
- Set<Object> set1 = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set1, EmptyIterable.instance()));
- assertEquals(3, set1.size());
- }
-
- public void testAddAllCollectionIterableInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- Iterable<String> iterable2 = list2;
- assertTrue(CollectionTools.addAll(list1, iterable2.iterator(), list2.size()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(this.buildStringList2()));
- }
-
- public void testAddAllCollectionIterableInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list1 = this.buildStringList1(); // same elements as set1
- Iterable<String> iterable3 = list1;
- assertFalse(CollectionTools.addAll(set1, iterable3.iterator(), list1.size()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(this.buildStringList1()));
- }
-
- public void testAddAllCollectionIterator_StringModified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_StringUnmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_ObjectModified() {
- List<Object> list1 = this.buildObjectList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator()));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIterator_ObjectUnmodified() {
- Set<Object> set1 = this.buildObjectSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator()));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIterator_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance()));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionIteratorInt_Modified() {
- List<String> list1 = this.buildStringList1();
- List<String> list2 = this.buildStringList2();
- assertTrue(CollectionTools.addAll(list1, list2.iterator(), 3));
- assertEquals(6, list1.size());
- assertTrue(list1.containsAll(list2));
- }
-
- public void testAddAllCollectionIteratorInt_Unmodified() {
- Set<String> set1 = this.buildStringSet1();
- List<String> list3 = this.buildStringList1(); // same elements as s1
- assertFalse(CollectionTools.addAll(set1, list3.iterator(), 3));
- assertEquals(3, set1.size());
- assertTrue(set1.containsAll(list3));
- }
-
- public void testAddAllCollectionIteratorInt_EmptyIterator() {
- List<String> list1 = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list1, EmptyIterator.<String>instance(), 0));
- assertEquals(3, list1.size());
- }
-
- public void testAddAllCollectionObjectArray_StringModified() {
- List<String> list = this.buildStringList1();
- String[] a = this.buildStringArray1();
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_StringListEmptyArray() {
- List<String> list = this.buildStringList1();
- assertFalse(CollectionTools.addAll(list, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringUnmodified() {
- Set<String> set = this.buildStringSet1();
- String[] a = this.buildStringArray1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
-
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_StringSetEmptyArray() {
- Set<String> set = this.buildStringSet1();
- assertFalse(CollectionTools.addAll(set, new String[0]));
- }
-
- public void testAddAllCollectionObjectArray_ObjectModified() {
- List<Object> list = this.buildObjectList1();
- String[] a = this.buildStringArray1();
-
- assertTrue(CollectionTools.addAll(list, a));
- assertEquals(6, list.size());
- assertTrue(list.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllCollectionObjectArray_ObjectUnmodified() {
- String[] a = this.buildStringArray1();
- Set<Object> set = this.buildObjectSet1();
- assertFalse(CollectionTools.addAll(set, a));
- assertEquals(3, set.size());
- assertTrue(set.containsAll(CollectionTools.collection(a)));
- }
-
- public void testAddAllListIntObjectArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[] { "X", "X", "X" });
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_Zero() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, 0, new String[] { "X", "X", "X" });
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntObjectArray_EmptyArray() {
- List<String> list = this.buildStringList1();
- CollectionTools.addAll(list, 2, new String[0]);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterable_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 2, iterable, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterable<String> iterable = Arrays.asList(new String[] { "X", "X", "X" });
- CollectionTools.addAll(list, 0, iterable, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterableInt_EmptyIterable() {
- List<String> list = this.buildStringList1();
- Iterable<String> iterable = EmptyIterable.instance();
- CollectionTools.addAll(list, 2, iterable, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIterator_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 2, iterator, 3);
- assertEquals(6, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "X", "X", "X", "two" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_Zero() {
- List<String> list = new ArrayList<String>();
- Iterator<String> iterator = Arrays.asList(new String[] { "X", "X", "X" }).iterator();
- CollectionTools.addAll(list, 0, iterator, 3);
- assertEquals(3, list.size());
- assertTrue(list.contains("X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, list.toArray()));
- }
-
- public void testAddAllListIntIteratorInt_EmptyIterator() {
- List<String> list = this.buildStringList1();
- Iterator<String> iterator = EmptyIterator.instance();
- CollectionTools.addAll(list, 2, iterator, 0);
- assertEquals(3, list.size());
- assertTrue(Arrays.equals(new Object[] { "zero", "one", "two" }, list.toArray()));
- }
-
- public void testAddAllObjectArrayCollection_String() {
- 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 testAddAllObjectArrayCollection_Object() {
- 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 testAddAllObjectArrayCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntCollection_String() {
- String[] a = this.buildStringArray1();
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyArray() {
- String[] a = new String[0];
- Collection<String> c = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, c);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, c));
- }
-
- public void testAddAllObjectArrayIntCollection_EmptyCollection() {
- String[] a = this.buildStringArray1();
- Collection<String> c = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, c);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterable_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterable_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, iterable);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterableInt_String() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 1, iterable, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyArray() {
- String[] a = new String[0];
- Iterable<String> iterable = this.buildStringList2();
- String[] newArray = CollectionTools.addAll(a, 0, iterable, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, iterable));
- }
-
- public void testAddAllObjectArrayIntIterableInt_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = new ArrayList<String>();
- String[] newArray = CollectionTools.addAll(a, 1, iterable, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIterator_EmptyIterable() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIntIteratorInt_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyArray() {
- String[] a = new String[0];
- Iterator<String> iterator = this.buildStringList2().iterator();
- String[] newArray = CollectionTools.addAll(a, 0, iterator, 3);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList2()));
- }
-
- public void testAddAllObjectArrayIntIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, 1, iterator, 0);
-
- assertEquals(3, newArray.length);
- }
-
- public void testAddAllObjectArrayIterable() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterableInt() {
- String[] a = this.buildStringArray1();
- Iterable<String> iterable = this.buildStringList1();
- String[] newArray = CollectionTools.addAll(a, iterable, 33);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_String() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = this.buildStringList1().iterator();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIterator_Object() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIterator_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt() {
- String[] a = this.buildStringArray1();
- Iterator<Object> iterator = this.buildObjectList1().iterator();
- Object[] newArray = CollectionTools.addAll(a, iterator, 3);
-
- assertEquals(6, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildObjectList1()));
- }
-
- public void testAddAllObjectArrayIteratorInt_EmptyIterator() {
- String[] a = this.buildStringArray1();
- Iterator<String> iterator = EmptyIterator.instance();
- String[] newArray = CollectionTools.addAll(a, iterator, 0);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, this.buildStringList1()));
- }
-
- public void testAddAllObjectArrayObjectArray_Object() {
- 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 testAddAllObjectArrayObjectArray_String() {
- 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 testAddAllObjectArrayObjectArray_ObjectString() {
- 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 testAddAllObjectArrayObjectArray_EmptyArray1() {
- Object[] a1 = new Object[0];
- Object[] a2 = this.buildObjectArray2();
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a2));
- }
-
- public void testAddAllObjectArrayObjectArray_EmptyArray2() {
- Object[] a1 = this.buildObjectArray1();
- Object[] a2 = new Object[0];
- Object[] newArray = CollectionTools.addAll(a1, a2);
-
- assertEquals(3, newArray.length);
- assertTrue(CollectionTools.containsAll(newArray, a1));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Object() {
- 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 testAddAllObjectArrayIntObjectArray_String() {
- 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 testAddAllObjectArrayIntObjectArray_ObjectString() {
- 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 testAddAllObjectArrayIntObjectArray_End() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 4, new String[] { "X", "X", "X" });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d", "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_Zero() {
- Object[] a = new Object[0];
- a = CollectionTools.addAll(a, 0, new String[] { "X", "X", "X" });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, "X"));
- assertTrue(Arrays.equals(new Object[] { "X", "X", "X" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray2() {
- Object[] a = new Object[] { "a", "b", "c", "d" };
- a = CollectionTools.addAll(a, 4, new String[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "c", "d" }, a));
- }
-
- public void testAddAllObjectArrayIntObjectArray_EmptyArray1() {
- Object[] a = new String[0];
- a = CollectionTools.addAll(a, 0, new Object[] { "a", "b", "c", "d" });
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new Object[] { "a", "b", "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 testAddAllCharArrayCharArray_EmptyArray2() {
- char[] a = CollectionTools.addAll(this.buildCharArray(), new char[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllCharArrayCharArrayEmptyArray1() {
- char[] a = CollectionTools.addAll(new char[0], new char[] { 'd', 'e' });
- assertEquals(2, 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 testAddAllCharArrayIntCharArray_End() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 4, new char[] { 'X', 'X', 'X' });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray1() {
- char[] a = new char[0];
- a = CollectionTools.addAll(a, 0, new char[] { 'X', 'X', 'X' });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, 'X'));
- assertTrue(Arrays.equals(new char[] { 'X', 'X', 'X' }, a));
- }
-
- public void testAddAllCharArrayIntCharArray_EmptyArray2() {
- char[] a = new char[] { 'a', 'b', 'c', 'd' };
- a = CollectionTools.addAll(a, 2, new char[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new char[] { 'a', 'b', '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 testAddAllIntArrayIntArray_EmptyArray2() {
- int[] a = CollectionTools.addAll(this.buildIntArray(), new int[0]);
- assertEquals(3, a.length);
- }
-
- public void testAddAllIntArrayIntArray_EmptyArray1() {
- int[] a = CollectionTools.addAll(new int[0], new int[] { 30, 40 });
- assertEquals(2, 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 testAddAllIntArrayIntIntArray_End() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 4, new int[] { 99, 99, 99 });
- assertEquals(7, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4, 99, 99, 99 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray2() {
- int[] a = new int[] { 1, 2, 3, 4 };
- a = CollectionTools.addAll(a, 2, new int[0]);
- assertEquals(4, a.length);
- assertTrue(Arrays.equals(new int[] { 1, 2, 3, 4 }, a));
- }
-
- public void testAddAllIntArrayIntIntArray_EmptyArray1() {
- int[] a = new int[0];
- a = CollectionTools.addAll(a, 0, new int[] { 99, 99, 99 });
- assertEquals(3, a.length);
- assertTrue(CollectionTools.contains(a, 99));
- assertTrue(Arrays.equals(new int[] { 99, 99, 99 }, a));
- }
-
- public void testArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_String() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableObjectArray_Object() {
- Iterable<String> iterable = this.buildStringList1();
- Object[] a = CollectionTools.array(iterable, new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- String[] a = CollectionTools.array(iterable, 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator());
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIterator_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance());
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorInt() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), 3);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorInt_Empty() {
- Object[] a = CollectionTools.array(EmptyIterator.instance(), 3);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_String() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testArrayIteratorObjectArray_Object() {
- Object[] a = CollectionTools.array(this.buildStringList1().iterator(), new Object[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray() {
- String[] a = CollectionTools.array(this.buildStringList1().iterator(), 3, new String[0]);
- assertEquals(3, a.length);
- assertTrue(CollectionTools.containsAll(a, this.buildStringList1().iterator()));
- }
-
- public void testArrayIteratorIntObjectArray_Empty() {
- String[] a = CollectionTools.array(EmptyIterator.<String>instance(), 3, new String[0]);
- assertEquals(0, a.length);
- }
-
- public void testBagEnumeration_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Object() {
- Bag<Object> b = CollectionTools.<Object>bag(this.buildStringVector1().elements());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumeration_Empty() {
- Bag<Object> b = CollectionTools.<Object>bag(EmptyEnumeration.instance());
- assertEquals(0, b.size());
- }
-
- public void testBagEnumerationInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringVector1().elements(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringVector1()));
- }
-
- public void testBagEnumerationInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyEnumeration.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Bag<String> b = CollectionTools.bag(iterable, 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_String() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator());
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIterator_StringObject() {
- 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 testBagIterator_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance());
- assertEquals(0, b.size());
- }
-
- public void testBagIteratorInt() {
- Bag<String> b = CollectionTools.bag(this.buildStringList1().iterator(), 3);
- assertEquals(3, b.size());
- assertTrue(b.containsAll(this.buildStringList1()));
- }
-
- public void testBagIteratorInt_Empty() {
- Bag<String> b = CollectionTools.bag(EmptyIterator.<String>instance(), 3);
- assertEquals(0, b.size());
- }
-
- public void testBagObjectArray() {
- Bag<String> b = CollectionTools.bag(this.buildStringArray1());
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, this.buildStringArray1()));
- }
-
- public void testBagObjectArray_Vararg() {
- Bag<String> b = CollectionTools.bag("foo", "bar", "baz");
- assertEquals(3, b.size());
- assertTrue(CollectionTools.containsAll(b, new Object[]{"foo", "bar", "baz"}));
- }
-
- public void testBagObjectArray_Empty() {
- Bag<String> b = CollectionTools.bag(Bag.Empty.<String>instance());
- assertEquals(0, b.size());
- }
-
- public void testCollectionEnumeration() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumeration_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringVector1().elements());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionEnumerationInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringVector1().elements(), 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringVector1()));
- }
-
- public void testCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Collection<String> c = CollectionTools.collection(iterable, 3);
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIterator_ObjectString() {
- Collection<Object> c = CollectionTools.<Object>collection(this.buildStringList1().iterator());
- assertEquals(3, c.size());
- assertTrue(c.containsAll(this.buildStringList1()));
- }
-
- public void testCollectionIteratorInt() {
- Collection<String> c = CollectionTools.collection(this.buildStringList1().iterator(), 3);
- 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 testContainsEnumerationObject_String() {
- 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 testContainsEnumerationObject_Object() {
- 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 testContainsIterableObject() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = c;
- assertTrue(CollectionTools.contains(iterable, "one"));
- assertFalse(CollectionTools.contains(iterable, null));
- c.add(null);
- assertTrue(CollectionTools.contains(iterable, null));
- }
-
- public void testContainsIteratorObject_String() {
- 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 testContainsIteratorObject_Object() {
- 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 testContainsAllCollectionIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), iterable));
- }
-
- public void testContainsAllCollectionIterator_String() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildStringList1().iterator()));
- }
-
- public void testContainsAllCollectionIterator_Object() {
- 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 testContainsAllCollectionObjectArray_StringObject() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), this.buildObjectArray1()));
- }
-
- public void testContainsAllCollectionObjectArray() {
- Object[] a = new Object[] { "zero", "one", "two" };
- assertTrue(CollectionTools.containsAll(this.buildStringList1(), a));
- }
-
- public void testContainsAllIterableCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIntCollection() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1()));
- }
-
- public void testContainsAllIterableIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, iterable2));
- }
-
- public void testContainsAllIterableIntIterable() {
- Iterable<String> iterable1 = this.buildStringList1();
- Iterable<String> iterable2 = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable1, 3, iterable2));
- }
-
- public void testContainsAllIterableIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableIntIterator() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildStringList1().iterator()));
- }
-
- public void testContainsAllIterableObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, this.buildObjectArray1()));
- }
-
- public void testContainsAllIterableIntObjectArray() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(iterable, 3, this.buildObjectArray1()));
- }
-
- public void testContainsAllIteratorCollection_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2()));
- }
-
- public void testContainsAllIteratorCollection_ObjectString() {
- 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 testContainsAllIteratorIntCollection() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 5, this.buildStringList2()));
- }
-
- public void testContainsAllIteratorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), iterable));
- }
-
- public void testContainsAllIteratorIntIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, iterable));
- }
-
- public void testContainsAllIteratorIterator_StringString() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorIterator_ObjectString() {
- 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 testContainsAllIteratorIntIterator() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildStringList2().iterator()));
- }
-
- public void testContainsAllIteratorObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), this.buildObjectArray2()));
- }
-
- public void testContainsAllIteratorIntObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildStringList1().iterator(), 3, this.buildObjectArray2()));
- }
-
- public void testContainsAllObjectArrayCollection() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2()));
- }
-
- public void testContainsAllObjectArrayIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), iterable));
- }
-
- public void testContainsAllObjectArrayIterator() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList1().iterator()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildStringList2().iterator()));
- }
-
- public void testContainsAllObjectArrayIterator_Empty() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), EmptyIterator.instance()));
- }
-
- public void testContainsAllObjectArrayObjectArray() {
- assertTrue(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray1()));
- assertFalse(CollectionTools.containsAll(this.buildObjectArray1(), this.buildObjectArray2()));
- }
-
- public void testContainsAllCharArrayCharArray() {
- assertTrue(CollectionTools.containsAll(this.buildCharArray(), this.buildCharArray()));
- assertFalse(CollectionTools.containsAll(this.buildCharArray(), new char[] { 'x', 'y' }));
- }
-
- public void testContainsAllIntArrayIntArray() {
- assertTrue(CollectionTools.containsAll(this.buildIntArray(), this.buildIntArray()));
- assertFalse(CollectionTools.containsAll(this.buildIntArray(), new int[] { 444, 888 }));
- }
-
- 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 testEqualsIteratorIterator() {
- 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 testIdenticalObjectArrayObjectArray_BothNull() {
- Object[] a1 = null;
- Object[] a2 = null;
- assertTrue(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_OneNull() {
- Object[] a1 = null;
- Object[] a2 = new Object[0];
- assertFalse(CollectionTools.identical(a1, a2));
- }
-
- public void testIdenticalObjectArrayObjectArray_DifferentLengths() {
- Object[] a1 = new String[] {"foo", "bar"};
- Object[] a2 = new String[] {"foo", "bar", "baz"};
- assertFalse(CollectionTools.identical(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 testIdenticalListIteratorListIterator_Not() {
- 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);
- }
- list2.remove(0);
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(CollectionTools.equals(list1.listIterator(), list2.listIterator()));
- }
-
- public void testIdenticalListIteratorListIterator_DifferentSizes() {
- 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);
- }
- list2.remove(3);
- assertFalse(CollectionTools.identical(list1.listIterator(), list2.listIterator()));
- assertFalse(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 testIndexOfListIteratorObject_String() {
- List<String> list = this.buildStringList1();
- assertEquals(1, CollectionTools.indexOf(list.listIterator(), "one"));
- }
-
- public void testIndexOfListIteratorObject_Null() {
- List<String> list = this.buildStringList1();
- list.add(null);
- assertEquals(list.size() - 1, CollectionTools.indexOf(list.listIterator(), null));
- }
-
- public void testIndexOfListIteratorObject_Object() {
- 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"));
- }
-
- public void testIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- 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 testIterableIterator() {
- Iterator<Object> emptyIterator = EmptyIterator.instance();
- Iterable<Object> emptyIterable = CollectionTools.iterable(emptyIterator);
-
- assertFalse(emptyIterable.iterator().hasNext());
-
- boolean exceptionThrown = false;
- try {
- emptyIterator = emptyIterable.iterator();
- fail("invalid iterator: " + emptyIterator);
- } catch (IllegalStateException ise) {
- exceptionThrown = true;
- }
- assertTrue("IllegalStateException not thrown.", exceptionThrown);
-
- }
-
- public void testIterableObjectArray() {
- String[] strings = this.buildStringArray1();
- int i = 0;
- for (String string : CollectionTools.iterable(strings)) {
- assertEquals(strings[i++], string);
- }
- }
-
- 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 testLastIndexOfIteratorObject() {
- 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 testLastIndexOfIteratorObject_Empty() {
- assertEquals(-1, CollectionTools.lastIndexOf(EmptyIterator.instance(), "foo"));
- }
-
- public void testLastIndexOfObjectArrayObject() {
- Object[] a = this.buildObjectArray1();
- assertEquals(1, CollectionTools.lastIndexOf(a, "one"));
- }
-
- public void testLastIndexOfObjectArrayObject_Null() {
- Object[] a = this.buildObjectArray1();
- 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 testListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable));
- }
-
- public void testListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- assertEquals(this.buildStringList1(), CollectionTools.list(iterable, 3));
- }
-
- public void testListIterator_String() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator());
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIterator_StringObject() {
- 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 testListIterator_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance()).size());
- }
-
- public void testListIteratorInt() {
- List<String> list = CollectionTools.list(this.buildStringList1().iterator(), 3);
- assertEquals(this.buildStringList1(), list);
- }
-
- public void testListIteratorInt_Empty() {
- assertEquals(0, CollectionTools.list(EmptyIterator.instance(), 5).size());
- }
-
- 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 testMoveObjectArrayIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = CollectionTools.move(array, 4, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
- }
-
- public void testMoveObjectArrayIntIntInt() {
- String[] array = new String[] { "0", "1", "2", "3", "4", "5" };
-
- String[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result));
- }
-
- public void testMoveIntArrayIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = CollectionTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
- }
-
- public void testMoveIntArrayIntIntInt() {
- int[] array = new int[] { 0, 1, 2, 3, 4, 5 };
-
- int[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 1, 3, 4, 2, 5 }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 1, 3, 4, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 4, 1, 3, 2 }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 0, 3, 2, 4, 5, 1 }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new int[] { 5, 0, 3, 2, 4, 1 }, result));
- }
-
- public void testMoveCharArrayIntInt() {
- char[] array = new char[] { 'a', 'b', 'c', 'd', 'e', 'f' };
-
- char[] result = CollectionTools.move(array, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'd', 'e', 'c', 'f' }, result));
-
- result = CollectionTools.move(array, 0, 5);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'b', 'd', 'e', 'c' }, result));
-
- result = CollectionTools.move(array, 2, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
-
- result = CollectionTools.move(array, 2, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'f', 'a', 'e', 'b', 'd', 'c' }, result));
- }
-
- public void testMoveCharArrayIntIntInt() {
- char[] array = new char[] { 'a', 'b', 'b', 'c', 'd', 'e' };
-
- char[] result = CollectionTools.move(array, 4, 2, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'b', 'c', 'd', 'b', 'e' }, result));
-
- result = CollectionTools.move(array, 0, 5, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'b', 'c', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 2, 4, 1);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'd', 'b', 'c', 'b' }, result));
-
- result = CollectionTools.move(array, 2, 4, 2);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 0, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'a', 'c', 'b', 'd', 'e', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 0, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 1, 4);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
-
- result = CollectionTools.move(array, 1, 0, 0);
- assertSame(array, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new char[] { 'e', 'a', 'c', 'b', 'd', 'b' }, result));
- }
-
- public void testMoveListIntIntRandomAccess() {
- List<String> list = new ArrayList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>();
- CollectionTools.addAll(list, new String[] { "0", "1", "2", "3", "4", "5" });
-
- List<String> result = CollectionTools.move(list, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntRandomAccess() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
- public void testMoveListIntIntIntSequentialAccess() {
- List<String> list = new LinkedList<String>(Arrays.asList(new String[] { "0", "1", "2", "3", "4", "5" }));
-
- List<String> result = CollectionTools.move(list, 4, 2, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "1", "3", "4", "2", "5" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 5, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "1", "3", "4", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 1);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "4", "1", "3", "2" }, result.toArray()));
-
- result = CollectionTools.move(list, 2, 4, 2);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 0, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "0", "3", "2", "4", "5", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 1, 4);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
-
- result = CollectionTools.move(list, 1, 0, 0);
- assertSame(list, result); // the array is modified in place and returned
- assertTrue(Arrays.equals(new String[] { "5", "0", "3", "2", "4", "1" }, result.toArray()));
- }
-
- 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 testRemoveAllObjectArrayObjectArray_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayObjectArray_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- String[] a2 = new String[] { "X", "Y", "Z" };
- String[] a3 = CollectionTools.removeAll(a1, a2);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable, 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable.iterator());
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<?> iterable = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, iterable.iterator(), 7);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B" });
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(new String[] { "A", "A", "C", "C", "D", "D", "F", "F" }, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_Empty() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, a3));
- }
-
- public void testRemoveAllObjectArrayCollection_NoMatches() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "X", "Y", "Z" });
- String[] a3 = CollectionTools.removeAll(a1, collection);
- assertTrue(Arrays.equals(a1, 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 testRemoveAllCharArrayCharArray_Empty() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[0];
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllCharArrayCharArray_NoMatches() {
- char[] a1 = new char[] { 'A', 'A', 'B', 'B', 'C', 'C', 'D', 'D', 'E', 'E', 'F', 'F' };
- char[] a2 = new char[] { 'X', 'Z' };
- assertTrue(Arrays.equals(a1, 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 testRemoveAllIntArrayIntArray_Empty() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[0];
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveAllIntArrayIntArray_NoMatches() {
- int[] a1 = new int[] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6 };
- int[] a2 = new int[] { 52, 67 };
- assertTrue(Arrays.equals(a1, CollectionTools.removeAll(a1, a2)));
- }
-
- public void testRemoveObjectArrayObject_Object() {
- 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 testRemoveObjectArrayObject_String() {
- 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 testRemoveAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertTrue(CollectionTools.removeAll(c, iterable, 3));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
-
- c = this.buildStringList1();
- iterable = this.buildStringList2();
- assertFalse(CollectionTools.removeAll(c, iterable, 3));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
- }
-
- public void testRemoveAllCollectionIterator_Empty() {
- 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 testRemoveAllCollectionIterator_Duplicates() {
- 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" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionIterator_ObjectString() {
- 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" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionIteratotInt() {
- 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" };
- Iterator<String> iterator = new ArrayIterator<String>(a);
- assertTrue(CollectionTools.removeAll(c, iterator, 2));
- assertEquals(2, c.size());
- assertFalse(c.contains("a"));
- assertTrue(c.contains("b"));
- assertTrue(c.contains("c"));
- assertFalse(c.contains("d"));
-
- iterator = new ArrayIterator<String>(a);
- assertFalse(CollectionTools.removeAll(c, iterator));
- }
-
- public void testRemoveAllCollectionObjectArray_Empty() {
- 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 testRemoveAllCollectionObjectArray_Duplicates() {
- 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 testRemoveAllCollectionObjectArray_MoreDuplicates() {
- 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.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexListIntInt() {
- List<String> list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "A", "C", "A", "D" }));
- List<String> removed = CollectionTools.removeElementsAtIndex(list, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "C", "A" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 3, 3);
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, removed.toArray()));
-
- list = new ArrayList<String>(Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" }));
- removed = CollectionTools.removeElementsAtIndex(list, 0, 3);
- assertTrue(Arrays.equals(new String[] { "D", "E", "F" }, list.toArray()));
- assertTrue(Arrays.equals(new String[] { "A", "B", "C" }, removed.toArray()));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 3, 2);
- assertTrue(Arrays.equals(new String[] { "A", "B", "A", "D" }, a));
- }
-
- public void testRemoveElementsAtIndexObjectArrayIntInt_Empty() {
- String[] a = new String[] { "A", "B", "A", "C", "A", "D" };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 5);
- assertTrue(Arrays.equals(new char[] { 'D' }, a));
- }
-
- public void testRemoveElementsAtIndexCharArrayIntInt_Empty() {
- char[] a = new char[] { 'A', 'B', 'A', 'C', 'A', 'D' };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 3, 3);
- assertTrue(Arrays.equals(new int[] { 8, 6, 7 }, a));
- }
-
- public void testRemoveElementsAtIndexIntArrayIntInt_Empty() {
- int[] a = new int[] { 8, 6, 7, 33, 2, 11 };
- a = CollectionTools.removeElementsAtIndex(a, 0, 6);
- assertEquals(0, a.length);
- }
-
- public void testReplaceAllObjectArrayObjectObject_Object() {
- 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 testReplaceAllObjectArrayObjectObject_String() {
- 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 testReplaceAllObjectArrayObjectObject_Null() {
- String[] a = new String[] { null, "B", null, "C", null, "D" };
- a = CollectionTools.replaceAll(a, null, "Z");
- assertTrue(Arrays.equals(new String[] { "Z", "B", "Z", "C", "Z", "D" }, a));
- }
-
- public void testReplaceAllCharArrayCharChar() {
- 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 testReplaceAllIntArrayIntInt() {
- 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 testRetainAllCollectionIterable() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterableInt() {
- Collection<String> c = this.buildStringList1();
- Iterable<String> iterable = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, iterable));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- iterable = this.buildStringList2();
- assertTrue(CollectionTools.retainAll(c, iterable, 7));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIterator() {
- 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 testRetainAllCollectionIterator_ObjectString() {
- 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");
- }
-
- public void testRetainAllCollectionIterator_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIterator_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator()));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt() {
- Collection<String> c = this.buildStringList1();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 8));
- assertEquals(this.buildStringList1().size(), c.size());
- assertEquals(this.buildStringList1(), c);
-
- assertTrue(CollectionTools.retainAll(c, this.buildStringList2().iterator(), 9));
- assertEquals(0, c.size());
- assertFalse(c.contains("one"));
- assertFalse(c.contains("two"));
- assertFalse(c.contains("three"));
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyIterator() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, EmptyIterator.instance(), 0));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionIteratorInt_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, this.buildStringList1().iterator(), 3));
- assertEquals(0, c.size());
- }
-
- 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 testRetainAllCollectionObjectArray_EmptyObjectArray() {
- Collection<String> c = this.buildStringList1();
- assertTrue(CollectionTools.retainAll(c, new Object[0]));
- assertEquals(0, c.size());
- }
-
- public void testRetainAllCollectionObjectArray_EmptyCollection() {
- Collection<String> c = new ArrayList<String>();
- assertFalse(CollectionTools.retainAll(c, new String[] { "foo" }));
- assertEquals(0, c.size());
- }
-
- 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 testRetainAllObjectArrayObjectArray_EmptyObjectArray1() {
- String[] a1 = new String[0];
- String[] a2 = new String[] { "E", "B", "" };
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_EmptyObjectArray2() {
- String[] a1 = new String[] { "E", "B", "" };
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayObjectArray_BothEmpty() {
- String[] a1 = new String[0];
- String[] a2 = new String[0];
- String[] a3 = CollectionTools.retainAll(a1, a2);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterable() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterable)));
- }
-
- public void testRetainAllObjectArrayIterable_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, iterable);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterableInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterable, 3)));
- }
-
- public void testRetainAllObjectArrayIterableInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterable<String> iterable = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, iterable, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIterator() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterator)));
- }
-
- public void testRetainAllObjectArrayIterator_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.retainAll(a1, iterator);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayIteratorInt() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, iterator, 3)));
- }
-
- public void testRetainAllObjectArrayIteratorInt_EmptyObjectArray() {
- String[] a1 = new String[0];
- Iterator<String> iterator = Arrays.asList(new String[] { "E", "B", "" }).iterator();
- String[] a3 = CollectionTools.retainAll(a1, iterator, 3);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- assertTrue(Arrays.equals(new String[] { "B", "B", "E", "E" }, CollectionTools.retainAll(a1, collection)));
- }
-
- public void testRetainAllObjectArrayCollection_EmptyObjectArray() {
- String[] a1 = new String[0];
- Collection<String> collection = Arrays.asList(new String[] { "E", "B", "" });
- String[] a3 = CollectionTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_EmptyCollection() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = new ArrayList<String>();
- String[] a3 = CollectionTools.retainAll(a1, collection);
- assertEquals(0, a3.length);
- }
-
- public void testRetainAllObjectArrayCollection_All() {
- String[] a1 = new String[] { "A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F" };
- Collection<String> collection = Arrays.asList(new String[] { "A", "B", "C", "D", "E", "F" });
- assertTrue(Arrays.equals(a1, CollectionTools.retainAll(a1, collection)));
- }
-
- 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 testRetainAllCharArrayCharArray_EmptyCharArray1() {
- char[] a1 = new char[0];
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllCharArrayCharArray_EmptyCharArray2() {
- char[] a1 = new char[] { 'E', 'B' };
- char[] a2 = new char[0];
- assertEquals(0, CollectionTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllCharArrayCharArray_RetainAll() {
- char[] a1 = new char[] { 'E', 'B', 'E', 'B', 'E', 'B', 'E', 'B', 'E' };
- char[] a2 = new char[] { 'E', 'B' };
- assertSame(a1, 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 testRetainAllIntArrayIntArray_EmptyIntArray1() {
- int[] a1 = new int[0];
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testRetainAllIntArrayIntArray_EmptyIntArray2() {
- int[] a1 = new int[] { 5, 2 };
- int[] a2 = new int[0];
- assertEquals(0, CollectionTools.retainAll(a1, a2).length);
- }
-
- public void testRetainAllIntArrayIntArray_RetainAll() {
- int[] a1 = new int[] { 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5 };
- int[] a2 = new int[] { 5, 2 };
- assertSame(a1, CollectionTools.retainAll(a1, a2));
- }
-
- public void testReverseObjectArray_Object() {
- Object[] a = this.buildObjectArray1();
- a = CollectionTools.reverse(a);
- assertEquals("two", a[0]);
- assertEquals("one", a[1]);
- assertEquals("zero", a[2]);
- }
-
- public void testReverseObjectArray_String() {
- 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 testReverseListIterable() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- List<String> actual = CollectionTools.reverseList(iterable, 10);
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_String() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator());
- List<String> expected = this.buildStringList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIterator_Object() {
- List<Object> actual = CollectionTools.<Object>reverseList(this.buildStringList1().iterator());
- List<Object> expected = this.buildObjectList1();
- Collections.reverse(expected);
- assertEquals(expected, actual);
- }
-
- public void testReverseListIteratorInt() {
- List<String> actual = CollectionTools.reverseList(this.buildStringList1().iterator(), 33);
- List<String> expected = this.buildStringList1();
- 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 testRotateObjectArray_Zero() {
- String[] a1 = new String[0];
- String[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArray_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- 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 testRotateObjectArrayInt_ZeroDistance() {
- String[] a1 = this.buildStringArray1();
- String[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_Zero() {
- String[] a1 = new String[0];
- String[] a2 = CollectionTools.rotate(a1, 7);
- assertSame(a1, a2);
- }
-
- public void testRotateObjectArrayInt_One() {
- String[] a1 = new String[] { "foo " };
- String[] a2 = CollectionTools.rotate(a1, 8);
- assertSame(a1, a2);
- }
-
- 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 testRotateCharArray_Zero() {
- char[] a1 = new char[0];
- char[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArray_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- 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 testRotateCharArrayInt_ZeroDistance() {
- char[] a1 = new char[] { 'a', 'b', 'c' };
- char[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_Zero() {
- char[] a1 = new char[0];
- char[] a2 = CollectionTools.rotate(a1, 2001);
- assertSame(a1, a2);
- }
-
- public void testRotateCharArrayInt_One() {
- char[] a1 = new char[] { 'a' };
- char[] a2 = CollectionTools.rotate(a1, 22);
- assertSame(a1, a2);
- }
-
- 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 testRotateIntArray_Zero() {
- int[] a1 = new int[0];
- int[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArray_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1);
- assertSame(a1, a2);
- }
-
- 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 testRotateIntArrayInt_ZeroDistance() {
- int[] a1 = new int[] { 3, 2, 1 };
- int[] a2 = CollectionTools.rotate(a1, 0);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_Zero() {
- int[] a1 = new int[0];
- int[] a2 = CollectionTools.rotate(a1, 3);
- assertSame(a1, a2);
- }
-
- public void testRotateIntArrayInt_One() {
- int[] a1 = new int[] { 77 };
- int[] a2 = CollectionTools.rotate(a1, 44);
- assertSame(a1, a2);
- }
-
- public void testSetIterable() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable));
- }
-
- public void testSetIterableInt() {
- Iterable<String> iterable = this.buildStringSet1();
- assertEquals(this.buildStringSet1(), CollectionTools.set(iterable, 22));
- }
-
- public void testSetIterator_String() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator()));
- }
-
- public void testSetIterator_Object() {
- 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 testSetIteratorInt() {
- assertEquals(this.buildStringSet1(), CollectionTools.set(this.buildStringSet1().iterator(), 3));
- }
-
- 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 testSingletonIterator_String() {
- Iterator<String> stream = CollectionTools.singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Object() {
- Iterator<Object> stream = CollectionTools.<Object>singletonIterator("foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSingletonIterator_Cast() {
- Iterator<Object> stream = CollectionTools.singletonIterator((Object) "foo");
- assertTrue(stream.hasNext());
- assertEquals("foo", stream.next());
- }
-
- public void testSizeIterable() {
- Iterable<Object> iterable = this.buildObjectList1();
- assertEquals(3, CollectionTools.size(iterable));
- }
-
- public void testSizeIterator() {
- assertEquals(3, CollectionTools.size(this.buildObjectList1().iterator()));
- }
-
- public void testSortedSetIterable() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable);
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIterableInt() {
- SortedSet<String> ss1 = new TreeSet<String>();
- ss1.add("0");
- ss1.add("2");
- ss1.add("3");
- ss1.add("1");
-
- Iterable<String> iterable = ss1;
- SortedSet<String> set2 = CollectionTools.<String>sortedSet(iterable, 5);
- assertEquals(ss1, set2);
- }
-
- public void testSortedSetIterator() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator()));
- }
-
- public void testSortedSetIterator_TreeSet() {
- 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 testSortedSetIteratorInt() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.sortedSet(this.buildSortedStringSet1().iterator(), 8));
- }
-
- public void testSortedSetObjectArray() {
- assertEquals(this.buildSortedStringSet1(), CollectionTools.set(this.buildSortedStringSet1().toArray()));
- }
-
- public void testSubArrayObjectArrayIntInt() {
- String[] array = new String[] {"foo", "bar", "baz", "joo", "jar", "jaz"};
- String[] result = new String[] {"foo", "bar", "baz", "joo"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new String[] {"jar"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new String[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new String[] {"joo", "jar", "jaz"};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSubArrayIntArrayIntInt() {
- int[] array = new int[] {77, 99, 333, 4, 9090, 42};
- int[] result = new int[] {77, 99, 333, 4};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new int[] {9090};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new int[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new int[] {4, 9090, 42};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- public void testSubArrayCharArrayIntInt() {
- char[] array = new char[] {'a', 'b', 'c', 'd', 'e', 'f'};
- char[] result = new char[] {'a', 'b', 'c', 'd'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 0, 4)));
-
- result = new char[] {'e'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 4, 1)));
-
- result = new char[0];
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 5, 0)));
-
- result = new char[] {'d', 'e', 'f'};
- assertTrue(Arrays.equals(result, CollectionTools.subArray(array, 3, 3)));
- }
-
- 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 testRemoveDuplicateElementsList_Empty() {
- List<String> list = new ArrayList<String>();
- list = CollectionTools.removeDuplicateElements(list);
- assertEquals(0, list.size());
- }
-
- public void testRemoveDuplicateElementsList_SingleElement() {
- List<String> list = new ArrayList<String>();
- list.add("zero");
- list = CollectionTools.removeDuplicateElements(list);
- assertEquals(1, list.size());
- }
-
- public void testRemoveDuplicateElementsObjectArray() {
- 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 testRemoveDuplicateElementsObjectArray_Empty() {
- String[] array = CollectionTools.removeDuplicateElements(new String[0]);
- assertEquals(0, array.length);
- }
-
- public void testRemoveDuplicateElementsObjectArray_SingleElement() {
- String[] array = CollectionTools.removeDuplicateElements(new String[] { "foo" });
- assertEquals(1, array.length);
- }
-
- public void testVectorIterable() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterableInt() {
- Iterable<String> iterable = this.buildStringList1();
- Vector<String> v = CollectionTools.vector(iterable, 8);
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_String() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIterator_Object() {
- Vector<Object> v = CollectionTools.<Object>vector(this.buildStringList1().iterator());
- assertEquals(3, v.size());
- assertTrue(v.containsAll(this.buildStringList1()));
- }
-
- public void testVectorIteratorInt() {
- Vector<String> v = CollectionTools.vector(this.buildStringList1().iterator(), 7);
- 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/CounterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
deleted file mode 100644
index 243149c612..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CounterTests.java
+++ /dev/null
@@ -1,93 +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.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.Counter;
-
-import junit.framework.TestCase;
-
-public class CounterTests extends TestCase {
-
- public CounterTests(String name) {
- super(name);
- }
-
- public void testCtors() {
- Counter counter;
- counter = new Counter();
- assertEquals(0, counter.count());
- counter = new Counter(7);
- assertEquals(7, counter.count());
- counter = new Counter(-7);
- assertEquals(-7, counter.count());
- }
-
- public void testIncrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.increment(3);
- assertEquals(3, count);
- assertEquals(3, counter.count());
-
- count = counter.increment();
- assertEquals(4, count);
- assertEquals(4, counter.count());
-
- count = counter.increment(-7);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
- }
-
- public void testDecrement() {
- Counter counter;
- int count;
- counter = new Counter();
- assertEquals(0, counter.count());
-
- count = counter.decrement(3);
- assertEquals(-3, count);
- assertEquals(-3, counter.count());
-
- count = counter.decrement();
- assertEquals(-4, count);
- assertEquals(-4, counter.count());
-
- count = counter.decrement(-7);
- assertEquals(3, count);
- assertEquals(3, counter.count());
- }
-
- public void testClone() {
- Counter counter = new Counter(44);
- Counter counter2 = (Counter) counter.clone();
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
- public void testEquals() {
- Counter counter = new Counter(44);
- Counter counter2 = new Counter(44);
- assertEquals(counter, counter2);
- assertEquals(counter.hashCode(), counter2.hashCode());
- }
-
- public void testSerialization() throws Exception {
- Counter counter = new Counter(44);
- Counter counter2 = TestTools.serialize(counter);
- assertEquals(44, counter2.count());
- assertEquals(counter, counter2);
- assertNotSame(counter, counter2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
deleted file mode 100644
index 25692053c8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/EmptyIterableTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.EmptyIterable;
-
-import junit.framework.TestCase;
-
-public class EmptyIterableTests extends TestCase {
-
- public EmptyIterableTests(String name) {
- super(name);
- }
-
- public void testIterator() {
- int i = 0;
- for (String string : EmptyIterable.<String>instance()) {
- fail("bogus string: " + string);
- i++;
- }
- assertEquals(0, i);
- }
-
-}
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 96df7b6daa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
+++ /dev/null
@@ -1,493 +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 org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-
-import junit.framework.TestCase;
-
-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(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(exCaught);
-
- exCaught = false;
- try {
- this.bag = new HashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- assertTrue(this.bag.add("five"));
-
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains("five"));
- }
-
- public void testAddCount() {
- // the other adds took place in setUp
- this.bag.add("minus3", -3);
- this.bag.add("zero", 0);
- this.bag.add("five", 5);
-
- assertFalse(this.bag.contains("minus3"));
- assertFalse(this.bag.contains("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(5, this.bag.count("five"));
-
- this.bag.add("three", 2);
- assertEquals(5, this.bag.count("three"));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- Bag<String> bag2 = this.bag.clone();
- assertTrue(this.bag != bag2);
- assertEquals(this.bag, bag2);
- assertTrue(this.bag.hashCode() == bag2.hashCode());
- }
-
- public void testContains() {
- assertTrue(this.bag.contains(null));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("two"));
- assertTrue(this.bag.contains("three"));
- assertTrue(this.bag.contains("four"));
- assertTrue(this.bag.contains(new String("four")));
- assertTrue(this.bag.contains("fo" + "ur"));
- assertFalse(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(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- Bag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.iterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- iterator.remove();
- assertEquals(10, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.iterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testUniqueIterator() {
- int i = 0;
- Iterator<String> iterator = this.bag.uniqueIterator();
- assertTrue(iterator.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !"four".equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- this.bag.add("five");
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-//TODO - poor load factor is seen in the Eclipse build environment for some reason
-// 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(this.bag.remove("one"));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertTrue(this.bag.remove("two"));
- assertTrue(this.bag.remove("two"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove("one", 0));
- assertTrue(this.bag.contains("one"));
-
- assertTrue(this.bag.remove("one", 1));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.remove("one"));
-
- assertFalse(this.bag.remove("two", -3));
- assertTrue(this.bag.remove("two", 1));
- assertTrue(this.bag.contains("two"));
-
- assertTrue(this.bag.remove("two", 1));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.remove("two"));
-
- assertTrue(this.bag.remove("three", 3));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("three"));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains("one"));
- assertFalse(this.bag.contains("three"));
- assertFalse(this.bag.remove("one"));
- assertFalse(this.bag.remove("three"));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add("one");
- c.add("three");
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains("one"));
- assertTrue(this.bag.contains("three"));
- assertFalse(this.bag.contains("two"));
- assertFalse(this.bag.contains("four"));
- assertFalse(this.bag.remove("two"));
- assertFalse(this.bag.remove("four"));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(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(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- Bag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(this.bag, bag2);
- // look for similar elements
- assertTrue(bag2.contains(null));
- assertTrue(bag2.contains("one"));
- assertTrue(bag2.contains("two"));
- assertTrue(bag2.contains("three"));
- assertTrue(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(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, "one"));
- assertTrue(CollectionTools.contains(a, "two"));
- assertTrue(CollectionTools.contains(a, "three"));
- assertTrue(CollectionTools.contains(a, "four"));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(s.endsWith("]"));
- int commaCount = 0;
- for (int i = 0; i < s.length(); i++) {
- if (s.charAt(i) == ',') {
- commaCount++;
- }
- }
- assertEquals(10, commaCount);
- assertTrue(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(s.indexOf("null") != -1);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
deleted file mode 100644
index a819b29fba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
+++ /dev/null
@@ -1,511 +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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.IdentityHashBag;
-
-import junit.framework.TestCase;
-
-public class IdentityHashBagTests extends TestCase {
- private IdentityHashBag<String> bag;
- private String one = "one";
- private String two = "two";
- private String three = "three";
- private String four = "four";
- private String foo = "foo";
- private String bar = "bar";
-
- public IdentityHashBagTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bag = this.buildBag();
- }
-
- protected IdentityHashBag<String> buildBag() {
- IdentityHashBag<String> result = new IdentityHashBag<String>();
- result.add(null);
- result.add(this.one);
- result.add(this.two);
- result.add(this.two);
- result.add(this.three);
- result.add(this.three);
- result.add(this.three);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- result.add(this.four);
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private Collection<String> buildCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.foo);
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.bar);
- c.add(this.bar);
- return c;
- }
-
- public void testCtorCollection() {
- Collection<String> c = this.buildCollection();
- IdentityHashBag<String> localBag = new IdentityHashBag<String>(c);
- for (String s : c) {
- assertTrue(localBag.contains(s));
- }
- }
-
- public void testCtorIntFloat() {
- boolean exCaught;
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(-20, 0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
-
- exCaught = false;
- try {
- this.bag = new IdentityHashBag<String>(20, -0.66f);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue("IllegalArgumentException not thrown", exCaught);
- }
-
- public void testAdd() {
- // the other adds took place in setUp
- String five = "five";
- assertTrue(this.bag.add(five));
-
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(five));
- }
-
- public void testAddCount() {
- String minus3 = "minus3";
- String zero = "zero";
- String five = "five";
- // the other adds took place in setUp
- this.bag.add(minus3, -3);
- this.bag.add(zero, 0);
- this.bag.add(five, 5);
-
- assertFalse(this.bag.contains(minus3));
- assertFalse(this.bag.contains(zero));
- assertEquals(1, this.bag.count(this.one));
- assertEquals(2, this.bag.count(this.two));
- assertEquals(3, this.bag.count(this.three));
- assertEquals(4, this.bag.count(this.four));
- assertEquals(5, this.bag.count(five));
-
- this.bag.add(this.three, 2);
- assertEquals(5, this.bag.count(this.three));
- }
-
- public void testAddAll() {
- Collection<String> c = this.buildCollection();
- assertTrue(this.bag.addAll(c));
- for (String s : c) {
- assertTrue(this.bag.contains(s));
- }
- }
-
- public void testClear() {
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
- assertTrue(this.bag.contains(null));
- assertEquals(11, this.bag.size());
- this.bag.clear();
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.contains(null));
- assertEquals(0, this.bag.size());
- }
-
- public void testClone() {
- IdentityHashBag<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(this.bag.contains(null));
- assertTrue(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertTrue(this.bag.contains(this.four));
-
- assertFalse(this.bag.contains(new String("four")));
- assertFalse(this.bag.contains("five"));
- }
-
- public void testContainsAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(null);
- c.add(this.one);
- c.add(this.two);
- c.add(this.three);
- c.add(this.four);
- assertTrue(this.bag.containsAll(c));
- c.add(new String(this.four));
- assertFalse(this.bag.containsAll(c));
- }
-
- public void testCount() {
- assertEquals(0, this.bag.count("zero"));
- assertEquals(1, this.bag.count("one"));
- assertEquals(2, this.bag.count("two"));
- assertEquals(3, this.bag.count("three"));
- assertEquals(4, this.bag.count("four"));
- assertEquals(0, this.bag.count("five"));
- }
-
- public void testEquals() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag, bag2);
- bag2.add("five");
- assertFalse(this.bag.equals(bag2));
- Collection<String> c = new ArrayList<String>(this.bag);
- assertFalse(this.bag.equals(c));
- }
-
- public void testHashCode() {
- IdentityHashBag<String> bag2 = this.buildBag();
- assertEquals(this.bag.hashCode(), bag2.hashCode());
- }
-
- public void testIsEmpty() {
- assertFalse(this.bag.isEmpty());
- this.bag.clear();
- assertTrue(this.bag.isEmpty());
- this.bag.add("foo");
- assertFalse(this.bag.isEmpty());
- }
-
- public void testEmptyIterator() {
- this.bag.clear();
- Iterator<String> iterator = this.bag.iterator();
- assertFalse(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.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(11, i);
- assertFalse(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(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.hasNext());
- while (iterator.hasNext()) {
- iterator.next();
- i++;
- }
- assertEquals(5, i);
- assertFalse(iterator.hasNext());
-
- boolean exCaught = false;
- Object element = null;
- try {
- element = iterator.next();
- fail(element.toString());
- } catch (NoSuchElementException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- Object next = null;
- while (iterator.hasNext() && !this.four.equals(next)) {
- next = iterator.next();
- }
- iterator.remove();
- assertEquals(7, this.bag.size());
-
- exCaught = false;
- try {
- iterator.remove();
- } catch (IllegalStateException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- // start over
- iterator = this.bag.uniqueIterator();
- String five = "five";
- this.bag.add(five);
- exCaught = false;
- try {
- iterator.next();
- } catch (ConcurrentModificationException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- // Commenting out this test as it is also failing in the Eclipse build
- // apparenly there are some hashing issues that need to be looked into.
-// public void testHashingDistribution() throws Exception {
-// IdentityHashBag<String> bigBag = new IdentityHashBag<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 (int i = 0; i < bucketCount; i++) {
-// if (table[i] != null) {
-// filledBucketCount++;
-// }
-// }
-// float loadFactor = ((float) filledBucketCount)/((float) bucketCount);
-// // System.out.println("load factor: " + loadFactor + " (" + filledBucketCount + "/" + bucketCount + ")");
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor > 0.20);
-// assertTrue("WARNING - poor load factor: " + loadFactor, loadFactor < 0.75);
-// }
-
- public void testRemove() {
- assertTrue(this.bag.remove(this.one));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertTrue(this.bag.remove(this.two));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertFalse(this.bag.remove(new String(this.three)));
- }
-
- public void testRemoveCount() {
- assertFalse(this.bag.remove(this.one, 0));
- assertTrue(this.bag.contains(this.one));
-
- assertTrue(this.bag.remove(this.one, 1));
- assertFalse(this.bag.contains(this.one));
- assertFalse(this.bag.remove(this.one));
-
- assertFalse(this.bag.remove(this.two, -3));
- assertTrue(this.bag.remove(this.two, 1));
- assertTrue(this.bag.contains(this.two));
-
- assertTrue(this.bag.remove(this.two, 1));
- assertFalse(this.bag.contains(this.two));
- assertFalse(this.bag.remove(this.two));
-
- assertTrue(this.bag.remove(this.three, 3));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.three));
- }
-
- public void testRemoveAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.removeAll(c));
- assertFalse(this.bag.contains(this.one));
- assertTrue(this.bag.contains(this.two));
- assertFalse(this.bag.contains(this.three));
- assertFalse(this.bag.remove(this.one));
- assertTrue(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.three));
- assertFalse(this.bag.removeAll(c));
- }
-
- public void testRetainAll() {
- Collection<String> c = new ArrayList<String>();
- c.add(this.one);
- c.add(new String(this.two));
- c.add(this.three);
- assertTrue(this.bag.retainAll(c));
- assertTrue(this.bag.contains(this.one));
- assertFalse(this.bag.contains(this.two));
- assertTrue(this.bag.contains(this.three));
- assertFalse(this.bag.contains(this.four));
- assertFalse(this.bag.remove(this.two));
- assertFalse(this.bag.remove(this.four));
- assertFalse(this.bag.retainAll(c));
- }
-
- public void testSize() {
- assertTrue(this.bag.size() == 11);
- String five = "five";
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(five);
- this.bag.add(new String(five));
- assertEquals(16, this.bag.size());
- }
-
- public void testSerialization() throws Exception {
- IdentityHashBag<String> bag2 = TestTools.serialize(this.bag);
-
- assertTrue("same object?", this.bag != bag2);
- assertEquals(11, bag2.size());
- assertEquals(CollectionTools.bag(this.bag.iterator()), CollectionTools.bag(bag2.iterator()));
- // look for similar elements
- assertTrue(CollectionTools.bag(bag2.iterator()).contains(null));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("one"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("two"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("three"));
- assertTrue(CollectionTools.bag(bag2.iterator()).contains("four"));
-
- int nullCount = 0, oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0;
- for (String next : bag2) {
- if (next == null)
- nullCount++;
- else if (next.equals("one"))
- oneCount++;
- else if (next.equals("two"))
- twoCount++;
- else if (next.equals("three"))
- threeCount++;
- else if (next.equals("four"))
- fourCount++;
- }
- assertEquals(1, nullCount);
- assertEquals(1, oneCount);
- assertEquals(2, twoCount);
- assertEquals(3, threeCount);
- assertEquals(4, fourCount);
- }
-
- public void testToArray() {
- Object[] a = this.bag.toArray();
- assertEquals(11, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.contains(a, this.four));
- }
-
- public void testToArrayObjectArray() {
- String[] a = new String[12];
- a[11] = "not null";
- String[] b = this.bag.toArray(a);
- assertEquals(a, b);
- assertEquals(12, a.length);
- assertTrue(CollectionTools.contains(a, null));
- assertTrue(CollectionTools.contains(a, this.one));
- assertTrue(CollectionTools.contains(a, this.two));
- assertTrue(CollectionTools.contains(a, this.three));
- assertTrue(CollectionTools.contains(a, this.four));
- assertTrue(a[11] == null);
- }
-
- public void testToString() {
- String s = this.bag.toString();
- assertTrue(s.startsWith("["));
- assertTrue(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(s.indexOf("one") != -1);
- assertTrue(s.indexOf("two") != -1);
- assertTrue(s.indexOf("three") != -1);
- assertTrue(s.indexOf("four") != -1);
- assertTrue(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 b971895bc1..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testUndent() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.indent();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.undent();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- public void testIncrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- }
-
- public void testDecrementIndentLevel() {
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- this.ipw1.incrementIndentLevel();
- assertEquals("wrong indent level", 1, this.ipw1.indentLevel());
- this.ipw1.decrementIndentLevel();
- assertEquals("wrong indent level", 0, this.ipw1.indentLevel());
- }
-
- 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 07dad198b5..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.name());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals("INTEGER", jdbcType.name());
- }
-
- public void testCode() {
- JDBCType jdbcType;
- jdbcType = JDBCType.type(Types.VARCHAR);
- assertEquals(Types.VARCHAR, jdbcType.code());
-
- jdbcType = JDBCType.type(Types.INTEGER);
- assertEquals(Types.INTEGER, jdbcType.code());
- }
-
- 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 57a10be26a..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, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.elementTypeName());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals("java.lang.Object", javaType.elementTypeName());
-
- javaType = new JavaType(int.class);
- assertEquals("int", javaType.elementTypeName());
-
- javaType = new JavaType(int[].class);
- assertEquals("int", javaType.elementTypeName());
-
- javaType = new JavaType(void.class);
- assertEquals("void", javaType.elementTypeName());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals("java.util.Map$Entry", javaType.elementTypeName());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals("java.util.Map$Entry", javaType.elementTypeName());
- }
-
- public void testArrayDepth() throws Exception {
- JavaType javaType;
- javaType = new JavaType(java.lang.Object.class);
- assertEquals(0, javaType.arrayDepth());
-
- javaType = new JavaType(java.lang.Object[].class);
- assertEquals(1, javaType.arrayDepth());
-
- javaType = new JavaType(int.class);
- assertEquals(0, javaType.arrayDepth());
-
- javaType = new JavaType(int[].class);
- assertEquals(1, javaType.arrayDepth());
-
- javaType = new JavaType(void.class);
- assertEquals(0, javaType.arrayDepth());
-
- javaType = new JavaType(java.util.Map.Entry.class);
- assertEquals(0, javaType.arrayDepth());
-
- javaType = new JavaType(java.util.Map.Entry[][].class);
- assertEquals(2, javaType.arrayDepth());
- }
-
- 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 c411aaf4f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.tests.internal.iterators.JptUtilityIteratorsTests;
-import org.eclipse.jpt.utility.tests.internal.model.JptUtilityModelTests;
-import org.eclipse.jpt.utility.tests.internal.node.JptUtilityNodeTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityIteratorsTests.suite());
- suite.addTest(JptUtilityModelTests.suite());
- suite.addTest(JptUtilityNodeTests.suite());
-
- suite.addTestSuite(BitToolsTests.class);
- suite.addTestSuite(ClasspathTests.class);
- suite.addTestSuite(ClassToolsTests.class);
- suite.addTestSuite(CollectionToolsTests.class);
- suite.addTestSuite(CounterTests.class);
- suite.addTestSuite(EmptyIterableTests.class);
- suite.addTestSuite(FileToolsTests.class);
- suite.addTestSuite(HashBagTests.class);
- suite.addTestSuite(IdentityHashBagTests.class);
- suite.addTestSuite(IndentingPrintWriterTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(SimpleAssociationTests.class);
- suite.addTestSuite(SimpleStackTests.class);
- suite.addTestSuite(StringToolsTests.class);
- suite.addTestSuite(SynchronizedBooleanTests.class);
- suite.addTestSuite(SynchronizedObjectTests.class);
- suite.addTestSuite(SynchronizedStackTests.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/SimpleAssociationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
deleted file mode 100644
index 3f3200b267..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.Association;
-import org.eclipse.jpt.utility.internal.SimpleAssociation;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class SimpleAssociationTests extends TestCase {
- private SimpleAssociation<String, String> assoc;
-
- public static Test suite() {
- return new TestSuite(SimpleAssociationTests.class);
- }
-
- public SimpleAssociationTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.assoc = new SimpleAssociation<String, String>("foo", "bar");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetKey() {
- assertEquals("foo", this.assoc.key());
- }
-
- public void testGetValue() {
- assertEquals("bar", this.assoc.value());
- }
-
- public void testSetValue() {
- assertEquals("bar", this.assoc.value());
- this.assoc.setValue("baz");
- assertEquals("baz", this.assoc.value());
- }
-
- public void testEquals() {
- assertEquals(this.assoc, this.copy(this.assoc));
-
- SimpleAssociation<String, String> assoc2 = new SimpleAssociation<String, String>("foo", "baz");
- assertFalse(this.assoc.equals(assoc2));
-
- assoc2 = new SimpleAssociation<String, String>("fop", "bar");
- assertFalse(this.assoc.equals(assoc2));
- }
-
- public void testHashCode() {
- assertEquals(this.assoc.hashCode(), this.copy(this.assoc).hashCode());
- }
-
- public void testClone() {
- this.verifyClone(this.assoc, this.assoc.clone());
- }
-
- private void verifyClone(Association<String, String> expected, Association<String, String> actual) {
- assertEquals(expected, actual);
- assertNotSame(expected, actual);
- assertEquals(expected.key(), actual.key());
- assertSame(expected.key(), actual.key());
- assertEquals(expected.value(), actual.value());
- assertSame(expected.value(), actual.value());
- }
-
- public void testSerialization() throws Exception {
- @SuppressWarnings("cast")
- Association<String, String> assoc2 = (Association<String, String>) TestTools.serialize(this.assoc);
-
- assertEquals(this.assoc, assoc2);
- assertNotSame(this.assoc, assoc2);
- assertEquals(this.assoc.key(), assoc2.key());
- assertNotSame(this.assoc.key(), assoc2.key());
- assertEquals(this.assoc.value(), assoc2.value());
- assertNotSame(this.assoc.value(), assoc2.value());
- }
-
- private SimpleAssociation<String, String> copy(SimpleAssociation<String, String> sa) {
- return new SimpleAssociation<String, String>(sa.key(), sa.value());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
deleted file mode 100644
index f229797565..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
+++ /dev/null
@@ -1,142 +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.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-
-import junit.framework.TestCase;
-
-public class SimpleStackTests extends TestCase {
-
- public SimpleStackTests(String name) {
- super(name);
- }
-
- public void testIsEmpty() {
- Stack<String> stack = new SimpleStack<String>();
- assertTrue(stack.isEmpty());
- stack.push("first");
- assertFalse(stack.isEmpty());
- stack.push("second");
- assertFalse(stack.isEmpty());
- stack.pop();
- assertFalse(stack.isEmpty());
- stack.pop();
- assertTrue(stack.isEmpty());
- }
-
- public void testPushAndPop() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.pop());
- assertEquals(first, stack.pop());
- }
-
- public void testPushAndPeek() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
- }
-
- public void testEmptyStackExceptionPeek() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.peek();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testEmptyStackExceptionPop() {
- Stack<String> stack = new SimpleStack<String>();
- String first = "first";
- String second = "second";
-
- stack.push(first);
- stack.push(second);
- assertEquals(second, stack.peek());
- assertEquals(second, stack.pop());
- assertEquals(first, stack.peek());
- assertEquals(first, stack.pop());
-
- boolean exCaught = false;
- try {
- stack.pop();
- } catch (EmptyStackException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testClone() {
- SimpleStack<String> stack = new SimpleStack<String>();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, stack.clone());
- }
-
- public void testSerialization() throws Exception {
- SimpleStack<String> stack = new SimpleStack<String>();
- stack.push("first");
- stack.push("second");
- stack.push("third");
-
- this.verifyClone(stack, TestTools.serialize(stack));
- }
-
- private void verifyClone(Stack<String> original, Stack<String> clone) {
- assertNotSame(original, clone);
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertEquals(original.isEmpty(), clone.isEmpty());
- assertEquals(original.peek(), clone.peek());
- assertEquals(original.pop(), clone.pop());
- assertTrue(original.isEmpty());
- assertEquals(original.isEmpty(), clone.isEmpty());
-
- original.push("fourth");
- assertFalse(original.isEmpty());
- // clone should still be empty
- assertTrue(clone.isEmpty());
- }
-
-}
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 42f6936eb1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,1176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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 testPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.padOn("fred", 4, sb);
- assertEquals("fred", sb.toString());
-
- sb = new StringBuilder();
- StringTools.padOn("fred", 6, sb);
- assertEquals("fred ", sb.toString());
-
- sb = new StringBuilder();
- 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 testPadOrTruncateOnStringBuilder() {
- this.verifyPadOrTruncateOnStringBuilder("fred", "fred", 4);
- this.verifyPadOrTruncateOnStringBuilder("fred ", "fred", 6);
- this.verifyPadOrTruncateOnStringBuilder("fr", "fred", 2);
- }
-
- private void verifyPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- 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 testZeroPadOnStringBuilder() {
- StringBuilder sb;
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 4, sb);
- assertEquals("1234", sb.toString());
-
- sb = new StringBuilder();
- StringTools.zeroPadOn("1234", 6, sb);
- assertEquals("001234", sb.toString());
-
- sb = new StringBuilder();
- 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());
- }
-
- public void testZeroPadOrTruncateOnStringBuilder() {
- this.verifyZeroPadOrTruncateOnStringBuilder("1234", "1234", 4);
- this.verifyZeroPadOrTruncateOnStringBuilder("001234", "1234", 6);
- this.verifyZeroPadOrTruncateOnStringBuilder("34", "1234", 2);
- }
-
- private void verifyZeroPadOrTruncateOnStringBuilder(String expected, String string, int length) {
- StringBuilder sb = new StringBuilder();
- 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 testWrapOnStringBuilder() {
- this.verifyWrapOnStringBuilder("Employee", "123", "123Employee123");
- this.verifyWrapOnStringBuilder("123", "123", "123123123");
- this.verifyWrapOnStringBuilder("", "123", "123123");
- }
-
- private void verifyWrapOnStringBuilder(String string, String wrap, String expectedString) {
- StringBuilder sb = new StringBuilder();
- 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());
- }
-
- public void testQuoteOnStringBuilder() {
- this.verifyQuoteOnStringBuilder("Employee", "\"Employee\"");
- this.verifyQuoteOnStringBuilder("123", "\"123\"");
- this.verifyQuoteOnStringBuilder("", "\"\"");
- }
-
- private void verifyQuoteOnStringBuilder(String string, String expectedString) {
- StringBuilder sb = new StringBuilder();
- 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 testRemoveFirstOccurrenceOnStringBuilder() {
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Emplo&yee&", '&', "Employee&");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee &Foo", '&', "Employee Foo");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("Employee&", '&', "Employee");
- this.verifyRemoveFirstOccurrenceOnStringBuilder("&Employee", '&', "Employee");
- }
-
- private void verifyRemoveFirstOccurrenceOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- 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());
- }
-
- public void testRemoveAllOccurrencesOnStringBuilder() {
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Fred", ' ', "EmployeeFred");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Employee ", ' ', "Employee");
- this.verifyRemoveAllOccurrencesOnStringBuilder("Employee Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllOccurrencesOnStringBuilder(" Emp loyee Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllOccurrencesOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllOccurrencesOn(string, charToRemove, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespace() {
- this.verifyRemoveAllWhitespace("Employee Fred\t", ' ', "EmployeeFred");
- this.verifyRemoveAllWhitespace("\tEmployee\n", ' ', "Employee");
- this.verifyRemoveAllWhitespace("Employee \t Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllWhitespace(" Emp\tloyee \n Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespace(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, StringTools.removeAllWhitespace(string));
- }
-
- public void testRemoveAllWhitespaceCharArray() {
- this.verifyRemoveAllWhitespaceCharArray("Employee Fred\t", ' ', "EmployeeFred");
- this.verifyRemoveAllWhitespaceCharArray("\tEmployee\n", ' ', "Employee");
- this.verifyRemoveAllWhitespaceCharArray("Employee \t Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllWhitespaceCharArray(" Emp\tloyee \n Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceCharArray(String string, char charToRemove, String expectedString) {
- assertEquals(expectedString, new String(StringTools.removeAllWhitespace(string.toCharArray())));
- }
-
- public void testRemoveAllWhitespaceOnWriter() {
- this.verifyRemoveAllWhitespaceOnWriter("Employee Fred\t", ' ', "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnWriter("\tEmployee\n", ' ', "Employee");
- this.verifyRemoveAllWhitespaceOnWriter("Employee \t Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnWriter(" Emp\tloyee \n Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnWriter(String string, char charToRemove, String expectedString) {
- Writer writer = new StringWriter();
- StringTools.removeAllWhitespaceOn(string, writer);
- assertEquals(expectedString, writer.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuffer() {
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee Fred\t", ' ', "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuffer("\tEmployee\n", ' ', "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuffer("Employee \t Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuffer(" Emp\tloyee \n Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuffer(String string, char charToRemove, String expectedString) {
- StringBuffer sb = new StringBuffer();
- StringTools.removeAllWhitespaceOn(string, sb);
- assertEquals(expectedString, sb.toString());
- }
-
- public void testRemoveAllWhitespaceOnStringBuilder() {
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee Fred\t", ' ', "EmployeeFred");
- this.verifyRemoveAllWhitespaceOnStringBuilder("\tEmployee\n", ' ', "Employee");
- this.verifyRemoveAllWhitespaceOnStringBuilder("Employee \t Foo", ' ', "EmployeeFoo");
- this.verifyRemoveAllWhitespaceOnStringBuilder(" Emp\tloyee \n Foo", ' ', "EmployeeFoo");
- }
-
- private void verifyRemoveAllWhitespaceOnStringBuilder(String string, char charToRemove, String expectedString) {
- StringBuilder sb = new StringBuilder();
- StringTools.removeAllWhitespaceOn(string, 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 testCapitalizeOnCharArrayStringBuilder() {
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder("Oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyCapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyCapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyCapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyCapitalizeOnCharArrayStringBuilder("A", new char[] { 'a' });
- this.verifyCapitalizeOnCharArrayStringBuilder("\u00C9cole", new char[] { '\u00E9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyCapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- 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 testCapitalizeOnStringStringBuilder() {
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "Oracle");
- this.verifyCapitalizeOnStringStringBuilder("Oracle", "oracle");
- this.verifyCapitalizeOnStringStringBuilder(" ", " ");
- this.verifyCapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyCapitalizeOnStringStringBuilder("", "");
- this.verifyCapitalizeOnStringStringBuilder("A", "a");
- this.verifyCapitalizeOnStringStringBuilder("\u00C9cole", "\u00E9cole"); // �cole->�COLE
- }
-
- private void verifyCapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- 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 testUncapitalizeOnCharArrayStringBuilder() {
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'O', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("oracle", new char[] { 'o', 'r', 'a', 'c', 'l', 'e' });
- this.verifyUncapitalizeOnCharArrayStringBuilder(" ", new char[] { ' ', ' ', ' ' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("ORACLE", new char[] { 'O', 'R', 'A', 'C', 'L', 'E' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("", new char[0]);
- this.verifyUncapitalizeOnCharArrayStringBuilder("a", new char[] { 'A' });
- this.verifyUncapitalizeOnCharArrayStringBuilder("\u00E9cole", new char[] { '\u00C9', 'c', 'o', 'l', 'e' });
- }
-
- private void verifyUncapitalizeOnCharArrayStringBuilder(String expected, char[] string) {
- StringBuilder sb = new StringBuilder();
- 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 testUncapitalizeOnStringStringBuilder() {
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "Oracle");
- this.verifyUncapitalizeOnStringStringBuilder("oracle", "oracle");
- this.verifyUncapitalizeOnStringStringBuilder(" ", " ");
- this.verifyUncapitalizeOnStringStringBuilder("ORACLE", "ORACLE");
- this.verifyUncapitalizeOnStringStringBuilder("", "");
- this.verifyUncapitalizeOnStringStringBuilder("a", "A");
- this.verifyUncapitalizeOnStringStringBuilder("\u00E9cole", "\u00C9cole"); // �cole->�COLE
- }
-
- private void verifyUncapitalizeOnStringStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- 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 testConvertCamelCaseToAllCapsOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuffer(String expected, String string) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.toString());
- }
-
- public void testConvertCamelCaseToAllCapsOnStringBuilder() {
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "test");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST", "TEST");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "testTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST", "TestTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "testTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST", "TestTESTTest");
- this.verifyConvertCamelCaseToAllCapsOnStringBuilder("TEST_TEST_TEST_T", "TestTESTTestT");
- }
-
- private void verifyConvertCamelCaseToAllCapsOnStringBuilder(String expected, String string) {
- StringBuilder sb = new StringBuilder();
- StringTools.convertCamelCaseToAllCapsOn(string, sb);
- assertEquals(expected, sb.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 testConvertCamelCaseToAllCapsMaxLengthOnStringBuffer() {
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 44);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "test", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TES", "test", 3);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "TEST", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TE", "TEST", 2);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "testTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TES", "testTest", 8);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_T", "testTest", 6);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_", "testTest", 5);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST", "testTest", 4);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 9);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST", "TestTest", 1100);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_", "testTESTTest", 10);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST", "TestTESTTest", 14);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_T", "TestTESTTestT", 16);
- this.verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer("TEST_TEST_TEST_", "TestTESTTestT", 15);
- }
-
- private void verifyConvertCamelCaseToAllCapsMaxLengthOnStringBuffer(String expected, String string, int max) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertCamelCaseToAllCapsOn(string, max, sb);
- assertEquals(expected, sb.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());
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBuffer() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TEST____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "TeST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "TEST___TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "TEST_TEST_TEST", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "TEST_TEST_TEST", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__TEST_TEST_TEST_T", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_TEST_TEST_TEST_T", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__TEST_TEST_TEST_T", true);
- }
-
- public void testConvertUnderscoresToCamelCaseOnStringBufferLowercase() {
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test_", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test____", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("Test", "test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("test", "test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTest", "test___test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTest", "test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTest", "test_test_test", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTest", "test_test_test", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "_test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("testTestTestT", "__test_test_test_t", false);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "_test_test_test_t", true);
- this.verifyConvertUnderscoresToCamelCaseOnStringBuffer("TestTestTestT", "__test_test_test_t", true);
- }
-
- private void verifyConvertUnderscoresToCamelCaseOnStringBuffer(String expected, String string, boolean capitalizeFirstLetter) {
- StringBuffer sb = new StringBuffer();
- StringTools.convertUnderscoresToCamelCaseOn(string, capitalizeFirstLetter, sb);
- assertEquals(expected, sb.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
deleted file mode 100644
index 4b42839081..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
+++ /dev/null
@@ -1,226 +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.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-import junit.framework.TestCase;
-
-public class SynchronizedBooleanTests extends TestCase {
- private volatile SynchronizedBoolean sb;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
-
-
- public SynchronizedBooleanTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.sb = new SynchronizedBoolean();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.sb.setValue(false);
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setValue(true);
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- this.sb.setFalse();
- assertFalse(this.sb.value());
- assertFalse(this.sb.isTrue());
- assertTrue(this.sb.isFalse());
-
- this.sb.setTrue();
- assertTrue(this.sb.value());
- assertTrue(this.sb.isTrue());
- assertFalse(this.sb.isFalse());
-
- assertSame(this.sb, this.sb.mutex());
- }
-
- public void testEquals() throws Exception {
- this.sb.setValue(false);
- SynchronizedBoolean sb2 = new SynchronizedBoolean(false);
- assertEquals(this.sb, sb2);
-
- this.sb.setValue(true);
- assertFalse(this.sb.equals(sb2));
-
- sb2.setValue(true);
- assertEquals(this.sb, sb2);
- }
-
- public void testHashCode() {
- this.sb.setValue(false);
- assertEquals(0, this.sb.hashCode());
-
- this.sb.setValue(true);
- assertEquals(1, this.sb.hashCode());
- }
-
- public void testWaitUntilTrue() throws Exception {
- this.verifyWaitUntilTrue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to true by t2
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitUntilTrueTimeout() throws Exception {
- this.verifyWaitUntilTrue(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitUntilTrue(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitUntilTrueCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- public void testWaitToSetFalse() throws Exception {
- this.verifyWaitToSetFalse(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to false by t2
- assertFalse(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToSetFalseTimeout() throws Exception {
- this.verifyWaitToSetFalse(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to true by t1
- assertTrue(this.sb.value());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToSetFalse(long timeout) throws Exception {
- this.sb.setFalse();
- Runnable r1 = this.buildRunnable(this.buildSetTrueCommand(), this.sb, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToSetFalseCommand(timeout), this.sb, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildSetTrueCommand() {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) {
- syncBool.setTrue();
- }
- };
- }
-
- private Command buildWaitUntilTrueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitUntilTrue(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetFalseCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedBoolean syncBool) throws Exception {
- SynchronizedBooleanTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedBooleanTests.this.setTimeoutOccurred( ! syncBool.waitToSetFalse(timeout));
- SynchronizedBooleanTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedBoolean syncBool, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(syncBool);
- } catch (Exception ex) {
- SynchronizedBooleanTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedBoolean syncBool) throws Exception;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
deleted file mode 100644
index e673aa2f42..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal;
-
-import org.eclipse.jpt.utility.internal.SynchronizedObject;
-
-import junit.framework.TestCase;
-
-public class SynchronizedObjectTests extends TestCase {
- private volatile SynchronizedObject<Object> so;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- volatile Object value = new Object();
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object soValue;
-
-
- public SynchronizedObjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.so = new SynchronizedObject<Object>();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.soValue = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAccessors() throws Exception {
- this.so.setValue(null);
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- this.so.setValue(this.value);
- assertEquals(this.value, this.so.value());
- assertTrue(this.so.isNotNull());
- assertFalse(this.so.isNull());
-
- this.so.setNull();
- assertNull(this.so.value());
- assertFalse(this.so.isNotNull());
- assertTrue(this.so.isNull());
-
- assertSame(this.so, this.so.mutex());
- }
-
- public void testEquals() throws Exception {
- this.so.setValue(null);
- SynchronizedObject<Object> so2 = new SynchronizedObject<Object>(null);
- assertEquals(this.so, so2);
-
- this.so.setValue(this.value);
- assertFalse(this.so.equals(so2));
-
- so2.setValue(this.value);
- assertEquals(this.so, so2);
- }
-
- public void testHashCode() {
- this.so.setValue(this.value);
- assertEquals(this.value.hashCode(), this.so.hashCode());
-
- this.so.setValue(null);
- assertEquals(0, this.so.hashCode());
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null
- */
- public void testWaitUntilNull() throws Exception {
- this.verifyWaitUntilNull(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to null by t2
- assertNull(this.so.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitUntilNullTimeout() throws Exception {
- this.verifyWaitUntilNull(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertNull(this.so.value());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- private void verifyWaitUntilNull(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitUntilNullCommand(t2Timeout));
- }
-
- /**
- * t2 will wait indefinitely until t1 sets the value to null;
- * then t2 will set the value to an object
- */
- public void testWaitToSetValue() throws Exception {
- this.verifyWaitToSetValue(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the value should be set to an object by t2
- assertTrue(this.so.isNotNull());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 150): " + time, time > 150);
- }
-
- /**
- * t2 will time out waiting for t1 to set the value to null
- */
- public void testWaitToSetValueTimeout() throws Exception {
- this.verifyWaitToSetValue(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the value will eventually be set to null by t1
- assertTrue(this.so.isNull());
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit late (expected value should be < 150): " + time, time < 150);
- }
-
- private void verifyWaitToSetValue(long t2Timeout) throws Exception {
- this.executeThreads(this.buildSetNullCommand(), this.buildWaitToSetValueCommand(t2Timeout));
- }
-
- /**
- * t2 will wait until t1 is finished "initializing" the value;
- * then t2 will get the newly-initialized value ("foo")
- */
- public void testExecute() throws Exception {
- this.so.setValue(null);
- Runnable r1 = this.buildRunnable(this.buildInitializeValueCommand(), this.so, 0);
- // give t1 a head start of 100 ms
- Runnable r2 = this.buildRunnable(this.buildGetValueCommand(), this.so, 100);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- assertEquals("foo", this.so.value());
- assertEquals("foo", this.soValue);
- // make a reasonable guess about how long t2 took
- long time = this.elapsedTime();
- assertTrue("t2 finished a bit early (expected value should be > 100): " + time, time > 300);
- }
-
- private void executeThreads(Command t1Command, Command t2Command) throws Exception {
- this.so.setValue(this.value);
- Runnable r1 = this.buildRunnable(t1Command, this.so, 200);
- Runnable r2 = this.buildRunnable(t2Command, this.so, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildSetNullCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) {
- sObject.setNull();
- }
- };
- }
-
- private Command buildWaitUntilNullCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitUntilNull(timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildWaitToSetValueCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setTimeoutOccurred( ! sObject.waitToSetValue(SynchronizedObjectTests.this.value, timeout));
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildInitializeValueCommand() {
- return new Command() {
- public void execute(final SynchronizedObject<Object> sObject) throws Exception {
- sObject.execute(
- new org.eclipse.jpt.utility.Command() {
- public void execute() {
- // pretend to perform some long initialization process
- try {
- Thread.sleep(500);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- sObject.setValue("foo");
- }
- }
- );
- }
- };
- }
-
- private Command buildGetValueCommand() {
- return new Command() {
- public void execute(SynchronizedObject<Object> sObject) throws Exception {
- SynchronizedObjectTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedObjectTests.this.setSOValue(sObject.value());
- SynchronizedObjectTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedObject<Object> sObject, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(sObject);
- } catch (Exception ex) {
- SynchronizedObjectTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- private long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
- void setSOValue(Object soValue) {
- this.soValue = soValue;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedObject<Object> so) throws Exception;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
deleted file mode 100644
index adb83d9f83..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
+++ /dev/null
@@ -1,271 +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.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.utility.internal.SynchronizedStack;
-
-public class SynchronizedStackTests extends SimpleStackTests {
- private volatile SynchronizedStack<String> ss;
- private volatile boolean exCaught;
- private volatile boolean timeoutOccurred;
- private volatile long startTime;
- private volatile long endTime;
- private volatile Object poppedObject;
-
- static final String ITEM_1 = new String();
- static final String ITEM_2 = new String();
-
- public SynchronizedStackTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.ss = new SynchronizedStack<String>();
- this.exCaught = false;
- this.timeoutOccurred = false;
- this.startTime = 0;
- this.endTime = 0;
- this.poppedObject = null;
- }
-
- /**
- * test first with an unsynchronized stack,
- * then with a synchronized stack
- */
- public void testConcurrentAccess() throws Exception {
- this.verifyConcurrentAccess(new SlowSimpleStack<String>(), "second");
- this.verifyConcurrentAccess(new SlowSynchronizedStack<String>(), "first");
- }
-
- private void verifyConcurrentAccess(SlowStack<String> slowStack, String expected) throws Exception {
- slowStack.push("first");
- slowStack.push("second");
-
- new Thread(this.buildRunnable(slowStack)).start();
- Thread.sleep(200);
-
- assertEquals(expected, slowStack.pop());
- }
-
- private Runnable buildRunnable(final SlowStack<String> slowStack) {
- return new Runnable() {
- public void run() {
- slowStack.slowPop();
- }
- };
- }
-
-
- private interface SlowStack<E> extends Stack<E> {
- Object slowPop();
- }
-
- private class SlowSimpleStack<E> extends SimpleStack<E> implements SlowStack<E> {
- SlowSimpleStack() {
- super();
- }
- public Object slowPop() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
- private class SlowSynchronizedStack<E> extends SynchronizedStack<E> implements SlowStack<E> {
- SlowSynchronizedStack() {
- super();
- }
- public synchronized Object slowPop() {
- try {
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- return this.pop();
- }
-
- }
-
-
- // ********** waits **********
-
- public void testWaitToPop() throws Exception {
- this.verifyWaitToPop(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and an item should have been popped by t2...
- assertSame(ITEM_1, this.poppedObject);
- // ...and the stack should be empty
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToPopTimeout() throws Exception {
- this.verifyWaitToPop(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack was never popped...
- assertNull(this.poppedObject);
- // ...and it still holds the item
- assertSame(ITEM_1, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToPop(long timeout) throws Exception {
- Runnable r1 = this.buildRunnable(this.buildPushCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPopCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- public void testWaitToPush() throws Exception {
- this.verifyWaitToPush(0);
- // no timeout occurs...
- assertFalse(this.timeoutOccurred);
- // ...and the stack gets popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...and an item is pushed on to the stack by t2
- assertFalse(this.ss.isEmpty());
- assertSame(ITEM_2, this.ss.peek());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() > 150);
- }
-
- public void testWaitToPushTimeout() throws Exception {
- this.verifyWaitToPush(20);
- // timeout occurs...
- assertTrue(this.timeoutOccurred);
- // ...and the stack is eventually popped by t1...
- assertSame(ITEM_1, this.poppedObject);
- // ...but nothing is pushed on to the stack by t2
- assertTrue(this.ss.isEmpty());
- // make a reasonable guess about how long t2 took
- assertTrue(this.elapsedTime() < 150);
- }
-
- private void verifyWaitToPush(long timeout) throws Exception {
- this.ss.push(ITEM_1);
- Runnable r1 = this.buildRunnable(this.buildPopCommand(), this.ss, 200);
- Runnable r2 = this.buildRunnable(this.buildWaitToPushCommand(timeout), this.ss, 0);
- Thread t1 = new Thread(r1);
- Thread t2 = new Thread(r2);
- t1.start();
- t2.start();
- while (t1.isAlive() || t2.isAlive()) {
- Thread.sleep(50);
- }
- assertFalse(this.exCaught);
- }
-
- private Command buildPushCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- synchronizedStack.push(ITEM_1);
- }
- };
- }
-
- private Command buildWaitToPopCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- try {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.waitToPop(timeout));
- } catch (EmptyStackException ex) {
- SynchronizedStackTests.this.setTimeoutOccurred(true);
- }
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Command buildPopCommand() {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) {
- SynchronizedStackTests.this.setPoppedObject(synchronizedStack.pop());
- }
- };
- }
-
- private Command buildWaitToPushCommand(final long timeout) {
- return new Command() {
- public void execute(SynchronizedStack<String> synchronizedStack) throws Exception {
- SynchronizedStackTests.this.setStartTime(System.currentTimeMillis());
- SynchronizedStackTests.this.setTimeoutOccurred( ! synchronizedStack.waitToPush(ITEM_2, timeout));
- SynchronizedStackTests.this.setEndTime(System.currentTimeMillis());
- }
- };
- }
-
- private Runnable buildRunnable(final Command command, final SynchronizedStack<String> synchronizedStack, final long sleep) {
- return new Runnable() {
- public void run() {
- try {
- if (sleep != 0) {
- Thread.sleep(sleep);
- }
- command.execute(synchronizedStack);
- } catch (Exception ex) {
- SynchronizedStackTests.this.setExCaught(true);
- }
- }
- };
- }
-
- void setExCaught(boolean exCaught) {
- this.exCaught = exCaught;
- }
-
- void setTimeoutOccurred(boolean timeoutOccurred) {
- this.timeoutOccurred = timeoutOccurred;
- }
-
- void setStartTime(long startTime) {
- this.startTime = startTime;
- }
-
- void setEndTime(long endTime) {
- this.endTime = endTime;
- }
-
- void setPoppedObject(Object poppedObject) {
- this.poppedObject = poppedObject;
- }
-
- long elapsedTime() {
- return this.endTime - this.startTime;
- }
-
-
- // ********** Command interface **********
-
- private interface Command {
- void execute(SynchronizedStack<String> synchronizedStack) throws Exception;
- }
-
-}
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 57fe19877c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
+++ /dev/null
@@ -1,142 +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();
- }
-
- /**
- * 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 18b3db2669..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
+++ /dev/null
@@ -1,132 +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();
- }
- };
- }
-
- public void testInvalidChainIterator() {
- // missing method override
- Iterator<Class<?>> iterator = new ChainIterator<Class<?>>(Vector.class);
- boolean exCaught = false;
- try {
- Class<?> c = iterator.next();
- fail("invalid class: " + c.getName());
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
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 58c3976076..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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() {
- this.verifyRemove();
- }
-
- protected void verifyRemove() {
- 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();
- }
-
- void verifyIllegalStateException() {
- 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.verifyEmptyIllegalStateException1();
- }
-
- void verifyEmptyIllegalStateException1() {
- this.verifyIllegalStateException(this.buildEmptyCompositeIterator1());
- }
-
- public void testEmptyHasAnother2() {
- this.verifyEmptyHasAnother(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyNoSuchElementException2() {
- this.verifyNoSuchElementException(this.buildEmptyCompositeIterator2());
- }
-
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- void verifyEmptyIllegalStateException2() {
- 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 2d2bdbec7a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-
-public class CompositeListIteratorTests extends ReadOnlyCompositeListIteratorTests {
-
- public CompositeListIteratorTests(String name) {
- super(name);
- }
-
- @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));
- }
-
- @Override
- 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);
- }
-
- @Override
- public void testIllegalStateException() {
- this.verifyIllegalStateException();
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- this.verifyEmptyIllegalStateException1();
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- this.verifyEmptyIllegalStateException2();
- }
-
- // 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() });
- }
-
- @Override
- 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 fe498aab9f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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<Integer, Number>(integers.iterator()) {
- @Override
- protected boolean accept(Integer o) {
- return 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> numbers = new ArrayList<Number>();
- numbers.add(new Integer(0));
- numbers.add(new Long(1));
- numbers.add(new Integer(2));
- numbers.add(new Float(3));
- Iterator<Integer> stream = new FilteringIterator<Number, Integer>(numbers.iterator()) {
- @Override
- protected boolean accept(Number 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, String>(nestedIterator, filter);
- }
-
- private Iterator<String> buildInnerFilteredIterator(Iterator<String> nestedIterator) {
- return new FilteringIterator<String, String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.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, String>(nestedIterator) {
- @Override
- protected boolean accept(String s) {
- return s.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);
- }
- };
- }
-
- public void testInvalidFilteringIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<String> iterator = new FilteringIterator<String, String>(this.buildNestedIterator());
- String s = iterator.next();
- fail("invalid string: " + s);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
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 8048a2f10c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
+++ /dev/null
@@ -1,196 +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);
- }
-
- public void testInvalidGraphIterator() {
- boolean exCaught = false;
- try {
- // missing method override
- Iterator<GraphNode> iterator = new GraphIterator<GraphNode>(this.buildGraphRoot());
- GraphNode gn = iterator.next();
- fail("invalid graph node: " + gn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- /**
- * 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 8d9d3f7270..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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(ReadOnlyCompositeListIteratorTests.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();
- throw new UnsupportedOperationException();
- }
-
-}
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/ReadOnlyCompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
deleted file mode 100644
index a031166f12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.ReadOnlyCompositeListIterator;
-
-public class ReadOnlyCompositeListIteratorTests extends CompositeIteratorTests {
-
- public ReadOnlyCompositeListIteratorTests(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));
- }
- }
-
- 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()) {
- stream.next();
- 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()) {
- stream.previous();
- i--;
- assertEquals(i, stream.nextIndex());
- assertEquals(i - 1, stream.previousIndex());
- }
- assertEquals("index is corrupt", 0, i);
- }
-
- public void testPreviousIndex() {
- // TODO
- }
-
- @Override
- public void testRemove() {
- // #remove() is not supported
- }
-
- @Override
- public void testIllegalStateException() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException1() {
- // #remove() is not supported
- }
-
- @Override
- public void testEmptyIllegalStateException2() {
- // #remove() is not supported
- }
-
- @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 ReadOnlyCompositeListIterator<String>((ListIterator<ListIterator<String>>) iterators);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator2() {
- return new ReadOnlyCompositeListIterator<String>(this.buildIterator1(), this.buildIterator2(), this.buildIterator3());
- }
-
- @Override
- @SuppressWarnings("unchecked")
- Iterator<String> buildCompositeIterator3() {
- return new ReadOnlyCompositeListIterator<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 ReadOnlyCompositeListIterator<String>(string, iterator);
- }
-
- public void testVariedNestedIterators() {
- List<Integer> integerList = new ArrayList<Integer>();
- integerList.add(42);
- integerList.add(22);
- integerList.add(111);
- integerList.add(77);
-
- List<Float> floatList = new ArrayList<Float>();
- floatList.add(42.42f);
- floatList.add(22.22f);
- floatList.add(111.111f);
- floatList.add(77.77f);
-
- List<ListIterator<? extends Number>> list = new ArrayList<ListIterator<? extends Number>>();
- list.add(integerList.listIterator());
- list.add(floatList.listIterator());
- ListIterator<Number> li = new ReadOnlyCompositeListIterator<Number>(list);
- while (li.hasNext()) {
- assertTrue(li.next().intValue() > 0);
- }
- }
-
-}
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 bef2552570..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.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.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());
- }
-
- public void testInvalidTransformationIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationIterator<String, Integer>(this.buildCollection().iterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
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 dc8a2e02c7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
+++ /dev/null
@@ -1,321 +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());
- }
-
- public void testInvalidTransformationListIterator() {
- // missing method override
- Iterator<Integer> iterator = new TransformationListIterator<String, Integer>(this.buildList().listIterator());
- boolean exCaught = false;
- try {
- Integer integer = iterator.next();
- fail("invalid integer: " + integer);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
-}
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 e15f1a8d50..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
+++ /dev/null
@@ -1,210 +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();
- }
- };
- }
-
- public void testInvalidTreeIterator() {
- // missing method override
- Iterator<TreeNode> iterator = new TreeIterator<TreeNode>(this.buildTree());
- boolean exCaught = false;
- try {
- TreeNode tn = iterator.next();
- fail("invalid tree node: " + tn);
- } catch (UnsupportedOperationException ex) {
- exCaught = true;
- }
- assertTrue("NoSuchElementException not thrown", exCaught);
- }
-
- 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/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
deleted file mode 100644
index 93dd505adc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
+++ /dev/null
@@ -1,1686 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class AbstractModelTests
- extends TestCase
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- private TestModel testModel;
- private static final String TEST_TO_STRING = "this is a test";
-
- private StateChangeEvent stateChangeEvent;
- private boolean stateChangedCalled = false;
-
- private PropertyChangeEvent propertyChangeEvent;
- private boolean propertyChangeCalled = false;
- private static final String PROPERTY_NAME = "propertyName";
- static final Object OLD_OBJECT_VALUE = new Object();
- static final Object NEW_OBJECT_VALUE = new Object();
- static final Integer OLD_INT_VALUE = new Integer(27);
- static final Integer NEW_INT_VALUE = new Integer(42);
- static final Boolean OLD_BOOLEAN_VALUE = Boolean.TRUE;
- static final Boolean NEW_BOOLEAN_VALUE = Boolean.FALSE;
-
- private CollectionChangeEvent collectionChangeEvent;
- private boolean itemsAddedCollectionCalled = false;
- private boolean itemsRemovedCollectionCalled = false;
- private boolean collectionChangedCalled = false;
- private boolean collectionClearedCalled = false;
- private static final String COLLECTION_NAME = "collectionName";
- static final Object ADDED_OBJECT_VALUE = new Object();
- static final Object REMOVED_OBJECT_VALUE = new Object();
- static final int TARGET_INDEX = 7;
- static final int SOURCE_INDEX = 22;
-
- private ListChangeEvent listChangeEvent;
- private boolean itemsAddedListCalled = false;
- private boolean itemsRemovedListCalled = false;
- private boolean itemsReplacedListCalled = false;
- private boolean itemsMovedListCalled = false;
- private boolean listChangedCalled = false;
- private boolean listClearedCalled = false;
- private static final String LIST_NAME = "listName";
- private static final int ADD_INDEX = 3;
- private static final int REMOVE_INDEX = 5;
- private static final int REPLACE_INDEX = 2;
-
- private TreeChangeEvent treeChangeEvent;
- private boolean nodeAddedCalled = false;
- private boolean nodeRemovedCalled = false;
- private boolean treeChangedCalled = false;
- private boolean treeClearedCalled = false;
- private static final String TREE_NAME = "treeName";
- static final Object[] OBJECT_ARRAY_PATH = {new Object(), new Object(), new String()};
- static final Object[] EMPTY_PATH = {};
-
- public AbstractModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = new TestModel();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testFireStateChange() {
- this.stateChangeEvent = null;
- this.stateChangedCalled = false;
- this.testModel.addStateChangeListener(this);
- this.testModel.testFireStateChange();
- assertNotNull(this.stateChangeEvent);
- assertEquals(this.testModel, this.stateChangeEvent.getSource());
- assertTrue(this.stateChangedCalled);
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObjectObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeObject() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- this.verifyPropertyChangeEvent(null, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeObject();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- this.verifyPropertyChangeEvent(OLD_INT_VALUE, NEW_INT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeIntInt();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- this.verifyPropertyChangeEvent(OLD_BOOLEAN_VALUE, NEW_BOOLEAN_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
- this.testModel.testFirePropertyChangeBooleanBoolean();
- assertNull(this.propertyChangeEvent);
- assertFalse(this.propertyChangeCalled);
- }
-
- public void testFireItemAddedCollection() {
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- this.verifyCollectionChangeEvent(ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsAddedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemAddedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsAddedCollectionCalled);
- }
-
- public void testFireItemRemovedCollection() {
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- this.verifyCollectionChangeEvent(REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedCollectionCalled);
-
- this.collectionChangeEvent = null;
- this.itemsRemovedCollectionCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireItemRemovedCollection();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.itemsRemovedCollectionCalled);
- }
-
- public void testFireCollectionCleared() {
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionClearedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionClearedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionCleared();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionClearedCalled);
- }
-
- public void testFireCollectionChanged() {
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- this.verifyCollectionChangeEvent(null);
- assertTrue(this.collectionChangedCalled);
-
- this.collectionChangeEvent = null;
- this.collectionChangedCalled = false;
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
- this.testModel.testFireCollectionChanged();
- assertNull(this.collectionChangeEvent);
- assertFalse(this.collectionChangedCalled);
- }
-
- public void testFireItemAddedList() {
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- this.verifyListChangeEvent(ADD_INDEX, ADDED_OBJECT_VALUE);
- assertTrue(this.itemsAddedListCalled);
-
- this.listChangeEvent = null;
- this.itemsAddedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemAddedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsAddedListCalled);
- }
-
- public void testFireItemRemovedList() {
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- this.verifyListChangeEvent(REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsRemovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsRemovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemRemovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsRemovedListCalled);
- }
-
- public void testFireItemReplacedList() {
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- this.verifyListChangeEvent(REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- assertTrue(this.itemsReplacedListCalled);
-
- this.listChangeEvent = null;
- this.itemsReplacedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemReplacedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsReplacedListCalled);
- }
-
- public void testFireItemMovedList() {
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- this.verifyListChangeEvent(TARGET_INDEX, SOURCE_INDEX);
- assertTrue(this.itemsMovedListCalled);
-
- this.listChangeEvent = null;
- this.itemsMovedListCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireItemMovedList();
- assertNull(this.listChangeEvent);
- assertFalse(this.itemsMovedListCalled);
- }
-
- public void testFireListCleared() {
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listClearedCalled);
-
- this.listChangeEvent = null;
- this.listClearedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListCleared();
- assertNull(this.listChangeEvent);
- assertFalse(this.listClearedCalled);
- }
-
- public void testFireListChanged() {
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.addListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- this.verifyListChangeEvent(-1, null);
- assertTrue(this.listChangedCalled);
-
- this.listChangeEvent = null;
- this.listChangedCalled = false;
- this.testModel.removeListChangeListener(LIST_NAME, this);
- this.testModel.testFireListChanged();
- assertNull(this.listChangeEvent);
- assertFalse(this.listChangedCalled);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeAddedCalled);
-
- this.treeChangeEvent = null;
- this.nodeAddedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeAddedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeAddedCalled);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.nodeRemovedCalled);
-
- this.treeChangeEvent = null;
- this.nodeRemovedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireNodeRemovedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.nodeRemovedCalled);
- }
-
- public void testFireTreeCleared() {
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- this.verifyTreeChangeEvent(EMPTY_PATH);
- assertTrue(this.treeClearedCalled);
-
- this.treeChangeEvent = null;
- this.treeClearedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeCleared();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeClearedCalled);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- this.verifyTreeChangeEvent(OBJECT_ARRAY_PATH);
- assertTrue(this.treeChangedCalled);
-
- this.treeChangeEvent = null;
- this.treeChangedCalled = false;
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- this.testModel.testFireTreeChangedObjectArrayPath();
- assertNull(this.treeChangeEvent);
- assertFalse(this.treeChangedCalled);
- }
-
- public void testHasAnyChangeListeners() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(this);
-
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(PROPERTY_NAME, this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.removePropertyChangeListener(PROPERTY_NAME, this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(this);
-
- assertFalse(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.addCollectionChangeListener(COLLECTION_NAME, this);
- assertTrue(this.testModel.hasAnyCollectionChangeListeners(COLLECTION_NAME));
- this.testModel.removeCollectionChangeListener(COLLECTION_NAME, this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(this);
-
- assertFalse(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.addListChangeListener(LIST_NAME, this);
- assertTrue(this.testModel.hasAnyListChangeListeners(LIST_NAME));
- this.testModel.removeListChangeListener(LIST_NAME, this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(this);
-
- assertFalse(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.addTreeChangeListener(TREE_NAME, this);
- assertTrue(this.testModel.hasAnyTreeChangeListeners(TREE_NAME));
- this.testModel.removeTreeChangeListener(TREE_NAME, this);
- }
-
- public void testAttributeValueHasChanged() {
- this.testModel.testAttributeValueHasChanged();
- }
-
- public void testClone() {
- assertFalse(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- this.testModel.addPropertyChangeListener(this);
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // verify that the clone does not have any listeners
- TestModel clone = this.testModel.clone();
- assertFalse(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- clone.addPropertyChangeListener(this);
- assertTrue(clone.hasAnyPropertyChangeListeners(PROPERTY_NAME));
- // check original
- assertTrue(this.testModel.hasAnyPropertyChangeListeners(PROPERTY_NAME));
-
- // now test events fired by original
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- this.testModel.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
-
- // now test events fired by clone
- this.propertyChangeEvent = null;
- this.propertyChangeCalled = false;
- clone.testFirePropertyChangeObjectObject();
- this.verifyPropertyChangeEvent(clone, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- assertTrue(this.propertyChangeCalled);
- }
-
- public void testAddNullStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.addStateChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListener() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener(null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addPropertyChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addCollectionChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addListChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testAddNullTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.addTreeChangeListener("foo", null);
- } catch (NullPointerException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusStateListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addStateChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeStateChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListener() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListener() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener(this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener(new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusPropertyListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removePropertyChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusCollectionListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addCollectionChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeCollectionChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusListListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addListChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeListChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testRemoveBogusTreeListenerName() {
- boolean exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addPropertyChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", this);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
-
- this.testModel.addTreeChangeListener("foo", this);
- exCaught = false;
- try {
- this.testModel.removeTreeChangeListener("foo", new AbstractModelTests("dummy"));
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testToString() {
- assertTrue(this.testModel.toString().indexOf(TEST_TO_STRING) != -1);
- }
-
-// ********** internal methods **********
-
- private void verifyPropertyChangeEvent(Object oldValue, Object newValue) {
- this.verifyPropertyChangeEvent(this.testModel, oldValue, newValue);
- }
-
- private void verifyPropertyChangeEvent(Object source, Object oldValue, Object newValue) {
- assertNotNull(this.propertyChangeEvent);
- assertEquals(source, this.propertyChangeEvent.getSource());
- assertEquals(PROPERTY_NAME, this.propertyChangeEvent.propertyName());
- assertEquals(oldValue, this.propertyChangeEvent.oldValue());
- assertEquals(newValue, this.propertyChangeEvent.newValue());
- }
-
- private void verifyCollectionChangeEvent(Object item) {
- assertNotNull(this.collectionChangeEvent);
- assertEquals(this.testModel, this.collectionChangeEvent.getSource());
- assertEquals(COLLECTION_NAME, this.collectionChangeEvent.collectionName());
- if (item == null) {
- assertFalse(this.collectionChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.collectionChangeEvent.items().next());
- }
- }
-
- private void verifyListChangeEvent(int index, Object item) {
- this.verifyListChangeEvent(index, item, null);
- }
-
- private void verifyListChangeEvent(int targetIndex, int sourceIndex) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.listName());
- assertEquals(targetIndex, this.listChangeEvent.targetIndex());
- assertEquals(sourceIndex, this.listChangeEvent.sourceIndex());
- }
-
- private void verifyListChangeEvent(int index, Object item, Object replacedItem) {
- assertNotNull(this.listChangeEvent);
- assertEquals(this.testModel, this.listChangeEvent.getSource());
- assertEquals(LIST_NAME, this.listChangeEvent.listName());
- assertEquals(index, this.listChangeEvent.index());
- if (item == null) {
- assertFalse(this.listChangeEvent.items().hasNext());
- } else {
- assertEquals(item, this.listChangeEvent.items().next());
- }
- if (replacedItem == null) {
- assertFalse(this.listChangeEvent.replacedItems().hasNext());
- } else {
- assertEquals(replacedItem, this.listChangeEvent.replacedItems().next());
- }
- }
-
- private void verifyTreeChangeEvent(Object[] path) {
- assertNotNull(this.treeChangeEvent);
- assertEquals(this.testModel, this.treeChangeEvent.getSource());
- assertEquals(TREE_NAME, this.treeChangeEvent.treeName());
- assertTrue(Arrays.equals(path, this.treeChangeEvent.path()));
- }
-
-// ********** listener implementations **********
-
- public void stateChanged(StateChangeEvent e) {
- this.stateChangedCalled = true;
- this.stateChangeEvent = e;
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- this.propertyChangeCalled = true;
- this.propertyChangeEvent = e;
- }
-
- public void itemsAdded(CollectionChangeEvent e) {
- this.itemsAddedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.itemsRemovedCollectionCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- this.collectionClearedCalled = true;
- this.collectionChangeEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- this.collectionChangedCalled = true;
- this.collectionChangeEvent = e;
- }
-
- public void itemsAdded(ListChangeEvent e) {
- this.itemsAddedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- this.itemsRemovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- this.itemsReplacedListCalled = true;
- this.listChangeEvent = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- this.itemsMovedListCalled = true;
- this.listChangeEvent = e;
- }
- public void listCleared(ListChangeEvent e) {
- this.listClearedCalled = true;
- this.listChangeEvent = e;
- }
- public void listChanged(ListChangeEvent e) {
- this.listChangedCalled = true;
- this.listChangeEvent = e;
- }
-
- public void nodeAdded(TreeChangeEvent e) {
- this.nodeAddedCalled = true;
- this.treeChangeEvent = e;
- }
- public void nodeRemoved(TreeChangeEvent e) {
- this.nodeRemovedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeCleared(TreeChangeEvent e) {
- this.treeClearedCalled = true;
- this.treeChangeEvent = e;
- }
- public void treeChanged(TreeChangeEvent e) {
- this.treeChangedCalled = true;
- this.treeChangeEvent = e;
- }
-
- // ********** inner class **********
-
- private static class TestModel extends AbstractModel implements Cloneable {
- TestModel() {
- super();
- }
-
- public void testFireStateChange() {
- this.fireStateChanged();
- }
-
- public void testFirePropertyChangeObjectObject() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_OBJECT_VALUE, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeObject() {
- this.firePropertyChanged(PROPERTY_NAME, NEW_OBJECT_VALUE);
- }
-
- public void testFirePropertyChangeIntInt() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_INT_VALUE.intValue(), NEW_INT_VALUE.intValue());
- }
-
- public void testFirePropertyChangeBooleanBoolean() {
- this.firePropertyChanged(PROPERTY_NAME, OLD_BOOLEAN_VALUE.booleanValue(), NEW_BOOLEAN_VALUE.booleanValue());
- }
-
- public void testFireItemAddedCollection() {
- this.fireItemAdded(COLLECTION_NAME, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedCollection() {
- this.fireItemRemoved(COLLECTION_NAME, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireCollectionCleared() {
- this.fireCollectionCleared(COLLECTION_NAME);
- }
-
- public void testFireCollectionChanged() {
- this.fireCollectionChanged(COLLECTION_NAME);
- }
-
- public void testFireItemAddedList() {
- this.fireItemAdded(LIST_NAME, ADD_INDEX, ADDED_OBJECT_VALUE);
- }
-
- public void testFireItemRemovedList() {
- this.fireItemRemoved(LIST_NAME, REMOVE_INDEX, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemReplacedList() {
- this.fireItemReplaced(LIST_NAME, REPLACE_INDEX, ADDED_OBJECT_VALUE, REMOVED_OBJECT_VALUE);
- }
-
- public void testFireItemMovedList() {
- this.fireItemMoved(LIST_NAME, TARGET_INDEX, SOURCE_INDEX);
- }
-
- public void testFireListCleared() {
- this.fireListCleared(LIST_NAME);
- }
-
- public void testFireListChanged() {
- this.fireListChanged(LIST_NAME);
- }
-
- public void testFireNodeAddedObjectArrayPath() {
- this.fireNodeAdded(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireNodeRemovedObjectArrayPath() {
- this.fireNodeRemoved(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testFireTreeCleared() {
- this.fireTreeCleared(TREE_NAME);
- }
-
- public void testFireTreeChangedObjectArrayPath() {
- this.fireTreeChanged(TREE_NAME, OBJECT_ARRAY_PATH);
- }
-
- public void testAttributeValueHasChanged() {
- assertTrue(this.attributeValueHasChanged(null, new Object()));
- assertTrue(this.attributeValueHasChanged(new Object(), null));
- assertTrue(this.attributeValueHasChanged(new Object(), new Object()));
-
- Object same = new Object();
- assertFalse(this.attributeValueHasChanged(same, same));
- assertFalse(this.attributeValueHasChanged(null, null));
- }
-
- @Override
- public TestModel clone() {
- try {
- return (TestModel) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(TEST_TO_STRING);
- }
-
- }
-
-
- // ********** serialization test **********
-
-//TODO - This test doesn't pass in the Eclipse build environment (Linux) for some reason
-// public void testSerialization() throws IOException, ClassNotFoundException {
-// LocalModel model1 = new LocalModel();
-// Foo foo1 = new Foo();
-// Bar bar1 = new Bar();
-// Joo joo1 = new Joo();
-// Jar jar1 = new Jar();
-// model1.addStateChangeListener(foo1);
-// model1.addStateChangeListener(bar1);
-// model1.addListChangeListener(joo1);
-// model1.addListChangeListener(jar1);
-//
-// ChangeListener[] listeners1 = this.listeners(model1, StateChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Foo.class, listeners1[0].getClass());
-// assertEquals(Bar.class, listeners1[1].getClass());
-//
-// listeners1 = this.listeners(model1, ListChangeListener.class);
-// assertEquals(2, listeners1.length);
-// // the order of these could change...
-// assertEquals(Joo.class, listeners1[0].getClass());
-// assertEquals(Jar.class, listeners1[1].getClass());
-//
-// LocalModel model2 = TestTools.serialize(model1);
-//
-// ChangeListener[] listeners2 = this.listeners(model2, StateChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Foo.class, listeners2[0].getClass());
-//
-// listeners2 = this.listeners(model2, ListChangeListener.class);
-// assertEquals(1, listeners2.length);
-// assertEquals(Joo.class, listeners2[0].getClass());
-// }
-
-// >>>>>>>>>>>>>>>>> these methods are called by #testSerialization(), commented out above...
- private ChangeListener[] listeners(LocalModel model, Class<? extends ChangeListener> listenerClass) {
- ChangeSupport changeSupport = (ChangeSupport) ClassTools.fieldValue(model, "changeSupport");
- return (ChangeListener[]) ClassTools.executeMethod(changeSupport, "listeners", Class.class, listenerClass);
- }
-
- private static class LocalModel extends AbstractModel implements Serializable {
- LocalModel() {
- super();
- }
- }
-
- private static class Foo implements Serializable, StateChangeListener {
- Foo() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Bar implements StateChangeListener {
- Bar() {
- super();
- }
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
- }
-
- private static class Joo extends ListChangeAdapter implements Serializable {
-// private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("changeSupport", ChangeSupport.class)};
- Joo() {
- super();
- }
- }
-
- private static class Jar extends ListChangeAdapter {
- Jar() {
- super();
- }
- }
-
-
- // ********** bug(?) test **********
-
- private static final String ISE_MESSAGE = "this object is no longer listening to localA";
-
- /**
- * Test the following situation:
- * - both B and C are listening to A
- * - C is also listening to B
- * - when B receives an event from A, it will fire an event to C
- * - when C receives an event from B, it will STOP listening to A
- * - the event from B to C may be preceded or followed (depending on
- * the hash positions of listeners) by an event from A to C:
- * - if the A to C event comes first, no problem
- * - but if the A to B event comes first, the A to C event should NOT happen
- */
- public void testIndirectRemoveStateListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyStateListeners();
- }
- }
- );
- }
-
- public void testIndirectRemovePropertyListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyPropertyListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveCollectionListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyCollectionListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveListListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyListListeners();
- }
- }
- );
- }
-
- public void testIndirectRemoveTreeListener() {
- this.verifyIndirectRemoveListener(
- new NotifyCommand() {
- public void notifyListeners(LocalA localA) {
- localA.notifyTreeListeners();
- }
- }
- );
- }
-
- public void verifyIndirectRemoveListener(NotifyCommand command) {
- LocalA localA = new LocalA();
- LocalB localB = new LocalB(localA);
-
- // build a bunch of LocalCs so at least one of them is notified AFTER the LocalB;
- // using 1000 seemed to fail very consistently before ChangeSupport was fixed
- LocalC[] localCs = new LocalC[1000];
- for (int i = localCs.length; i-- > 0; ) {
- localCs[i] = new LocalC(localA, localB);
- }
-
- boolean exCaught = false;
- try {
- command.notifyListeners(localA);
- } catch (IllegalStateException ex) {
- if (ex.getMessage() == ISE_MESSAGE) {
- exCaught = true;
- } else {
- throw ex;
- }
- }
- assertFalse(exCaught);
-
- for (int i = localCs.length; i-- > 0; ) {
- assertFalse(localCs[i].isListeningToLocalA());
- }
- }
-
- private interface NotifyCommand {
- void notifyListeners(LocalA localA);
- }
-
- /**
- * This object simply fires a state change event. Both LocalB and LocalC
- * will be listeners.
- */
- private static class LocalA extends AbstractModel {
- LocalA() {
- super();
- }
- void notifyStateListeners() {
- this.fireStateChanged();
- }
- void notifyPropertyListeners() {
- this.firePropertyChanged("foo", 1, 2);
- }
- void notifyCollectionListeners() {
- this.fireCollectionChanged("foo");
- }
- void notifyListListeners() {
- this.fireListChanged("foo");
- }
- void notifyTreeListeners() {
- this.fireTreeChanged("foo");
- }
- }
-
- /**
- * This object will fire state change events whenever it receives
- * a state change event from localA.
- */
- private static class LocalB
- extends AbstractModel
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- LocalB(LocalA localA) {
- super();
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(this);
- }
-
- public void stateChanged(StateChangeEvent e) {
- this.fireStateChanged();
- }
-
- public void propertyChanged(PropertyChangeEvent evt) {
- this.firePropertyChanged("bar", 1, 2);
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- this.fireCollectionChanged("bar");
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- this.fireListChanged("bar");
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- this.fireTreeChanged("bar");
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent e) {/*ignore*/}
-
- }
-
- /**
- * This object will listen to two other objects, localA and localB.
- * If this object receives notification from localB, it will stop listening to
- * localA. If this object receives notification from localA, it will check to
- * see whether it still listening to localA. If this object is no longer
- * listening to localA, it will complain about receiving the event and
- * throw an exception.
- */
- private static class LocalC
- extends AbstractModel
- implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
- {
- private LocalA localA;
- private LocalB localB;
- private boolean listeningToLocalA;
-
- LocalC(LocalA localA, LocalB localB) {
- super();
- this.localA = localA;
- this.localB = localB;
-
- localA.addStateChangeListener(this);
- localA.addPropertyChangeListener(this);
- localA.addCollectionChangeListener(this);
- localA.addListChangeListener(this);
- localA.addTreeChangeListener(this);
- this.listeningToLocalA = true;
-
- localB.addStateChangeListener(this);
- localB.addPropertyChangeListener(this);
- localB.addCollectionChangeListener(this);
- localB.addListChangeListener(this);
- localB.addTreeChangeListener(this);
- }
- boolean isListeningToLocalA() {
- return this.listeningToLocalA;
- }
-
- public void stateChanged(StateChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeStateChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void propertyChanged(PropertyChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removePropertyChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
-
- public void collectionChanged(CollectionChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeCollectionChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void collectionCleared(CollectionChangeEvent e) {/*ignore*/}
- public void itemsAdded(CollectionChangeEvent e) {/*ignore*/}
- public void itemsRemoved(CollectionChangeEvent e) {/*ignore*/}
-
- public void listChanged(ListChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeListChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void listCleared(ListChangeEvent e) {/*ignore*/}
- public void itemsAdded(ListChangeEvent e) {/*ignore*/}
- public void itemsRemoved(ListChangeEvent e) {/*ignore*/}
- public void itemsReplaced(ListChangeEvent e) {/*ignore*/}
- public void itemsMoved(ListChangeEvent e) {/*ignore*/}
-
- public void treeChanged(TreeChangeEvent e) {
- Object source = e.getSource();
- if (source == this.localA) {
- if ( ! this.listeningToLocalA) {
- throw new IllegalStateException(ISE_MESSAGE);
- }
- } else if (source == this.localB) {
- this.localA.removeTreeChangeListener(this);
- this.listeningToLocalA = false;
- } else {
- throw new IllegalStateException("bogus event source: " + source);
- }
- }
- public void treeCleared(TreeChangeEvent e) {/*ignore*/}
- public void nodeAdded(TreeChangeEvent e) {/*ignore*/}
- public void nodeRemoved(TreeChangeEvent e) {/*ignore*/}
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
deleted file mode 100644
index d77ba7e2e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import org.eclipse.jpt.utility.tests.internal.model.listener.JptUtilityModelListenerTests;
-import org.eclipse.jpt.utility.tests.internal.model.value.JptUtilityModelValueTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelListenerTests.suite());
- suite.addTest(JptUtilityModelValueTests.suite());
-
- suite.addTestSuite(AbstractModelTests.class);
- suite.addTestSuite(NewEventTests.class);
-
- return suite;
- }
-
- private JptUtilityModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
deleted file mode 100644
index 8a6e245c62..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- * test what it takes to add a new type of event to
- * model and change support
- */
-public class NewEventTests extends TestCase {
- private Foo foo;
-
- public NewEventTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Foo();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testHasNoFooChangeListeners() {
- assertTrue(this.foo.hasNoFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertFalse(this.foo.hasNoFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertTrue(this.foo.hasNoFooChangeListeners());
- }
-
- public void testHasAnyFooChangeListeners() {
- assertFalse(this.foo.hasAnyFooChangeListeners());
- LocalListener listener = new LocalListener();
- this.foo.addFooChangeListener(listener);
- assertTrue(this.foo.hasAnyFooChangeListeners());
- this.foo.removeFooChangeListener(listener);
- assertFalse(this.foo.hasAnyFooChangeListeners());
- }
-
- public void testFireFooChangeEvent() {
- LocalListener listener = new LocalListener();
- assertFalse(listener.receivedFooEvent);
- this.foo.addFooChangeListener(listener);
- this.foo.foo();
- assertTrue(listener.receivedFooEvent);
- }
-
-
- // ********** harness classes **********
-
- class Foo extends AbstractFooModel {
- Foo() {
- super();
- }
- void foo() {
- this.fireFooChangeEvent();
- }
- }
-
- class LocalListener implements FooChangeListener {
- boolean receivedFooEvent = false;
- LocalListener() {
- super();
- }
- public void fooChanged(FooChangeEvent event) {
- this.receivedFooEvent = true;
- }
- }
-
- interface FooModel extends Model {
- void addFooChangeListener(FooChangeListener listener);
- void removeFooChangeListener(FooChangeListener listener);
- }
-
- interface FooChangeListener extends ChangeListener {
- void fooChanged(FooChangeEvent event);
- }
-
- static class FooChangeEvent extends ChangeEvent {
- private static final long serialVersionUID = 1L;
- public FooChangeEvent(FooModel source) {
- super(source);
- }
- @Override
- public String aspectName() {
- return null; // the point of the event is that the name is unknown...
- }
- @Override
- public FooChangeEvent cloneWithSource(Model newSource) {
- return new FooChangeEvent((FooModel) newSource);
- }
- }
-
- static class AbstractFooModel extends AbstractModel implements FooModel {
- @Override
- protected synchronized FooChangeSupport changeSupport() {
- return (FooChangeSupport) super.changeSupport();
- }
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new FooChangeSupport(this);
- }
- public void addFooChangeListener(FooChangeListener listener) {
- this.changeSupport().addFooChangeListener(listener);
- }
- public void removeFooChangeListener(FooChangeListener listener) {
- this.changeSupport().removeFooChangeListener(listener);
- }
- protected void fireFooChangeEvent() {
- this.changeSupport().fireFooChanged();
- }
- public boolean hasAnyFooChangeListeners() {
- return this.changeSupport().hasAnyFooChangeListeners();
- }
- public boolean hasNoFooChangeListeners() {
- return ! this.hasAnyFooChangeListeners();
- }
- }
-
- static class FooChangeSupport extends ChangeSupport {
- FooChangeSupport(FooModel source) {
- super(source);
- }
- protected static final Class<FooChangeListener> FOO_CHANGE_LISTENER_CLASS = FooChangeListener.class;
- void addFooChangeListener(FooChangeListener listener) {
- this.addListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- void removeFooChangeListener(FooChangeListener listener) {
- this.removeListener(FOO_CHANGE_LISTENER_CLASS, listener);
- }
- public boolean hasAnyFooChangeListeners() {
- return this.hasAnyListeners(FOO_CHANGE_LISTENER_CLASS);
- }
- private FooChangeListener[] fooChangeListeners() {
- return (FooChangeListener[]) this.listeners(FOO_CHANGE_LISTENER_CLASS);
- }
- public void fireFooChanged() {
- FooChangeListener[] targets = null;
- synchronized (this) {
- FooChangeListener[] fooChangeListeners = this.fooChangeListeners();
- if (fooChangeListeners != null) {
- targets = fooChangeListeners.clone();
- }
- }
- if (targets != null) {
- FooChangeEvent event = null;
- for (FooChangeListener target : targets) {
- boolean stillListening;
- synchronized (this) {
- stillListening = CollectionTools.contains(this.fooChangeListeners(), target);
- }
- if (stillListening) {
- if (event == null) {
- // here's the reason for the duplicate code...
- event = new FooChangeEvent((FooModel) this.source);
- }
- target.fooChanged(event);
- }
- }
- }
- this.sourceChanged(null);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
deleted file mode 100644
index 084a9b8ab3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.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.utility.tests.internal.model.listener;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelListenerTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelListenerTests.class.getPackage().getName());
-
- suite.addTestSuite(ReflectiveCollectionChangeListenerTests.class);
- suite.addTestSuite(ReflectiveListChangeListenerTests.class);
- suite.addTestSuite(ReflectivePropertyChangeListenerTests.class);
- suite.addTestSuite(ReflectiveStateChangeListenerTests.class);
- suite.addTestSuite(ReflectiveTreeChangeListenerTests.class);
-
- return suite;
- }
-
- private JptUtilityModelListenerTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
deleted file mode 100644
index 502d3ae6a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveCollectionChangeListenerTests extends TestCase {
-
- public ReflectiveCollectionChangeListenerTests(String name) {
- super(name);
- }
-
- private CollectionChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "collectionClearedZeroArgument", "collectionChangedZeroArgument");
- }
-
- private CollectionChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "collectionClearedSingleArgument", "collectionChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertTrue(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionClearedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertTrue(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertTrue(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedZeroArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildZeroArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertTrue(target.collectionChangedZeroArgumentFlag);
- assertFalse(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertTrue(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testCollectionChangedSingleArgumentNamedCollection() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- testModel.addCollectionChangeListener(TestModel.STRINGS_COLLECTION, this.buildSingleArgumentListener(target));
- testModel.replaceStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.collectionClearedZeroArgumentFlag);
- assertFalse(target.collectionClearedSingleArgumentFlag);
- assertFalse(target.collectionChangedZeroArgumentFlag);
- assertTrue(target.collectionChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "collectionChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- Method method = ClassTools.method(target, "collectionChangedDoubleArgument", new Class[] {CollectionChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- CollectionChangeListener listener = ReflectiveChangeListener.buildCollectionChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_COLLECTION, string);
- // build a COLLECTION change listener and hack it so we
- // can add it as a LIST change listener
- Object listener = ReflectiveChangeListener.buildCollectionChangeListener(target, "itemAddedSingleArgument");
- testModel.addListChangeListener((ListChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeList();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private Collection<String> strings = new ArrayList<String>();
- public static final String STRINGS_COLLECTION = "strings";
- TestModel() {
- super();
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.strings) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeString(s);
- }
- };
- }
- void addString(String string) {
- this.addItemToCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void removeString(String string) {
- this.removeItemFromCollection(string, this.strings, STRINGS_COLLECTION);
- }
- void clearStrings() {
- this.clearCollection(this.strings, STRINGS_COLLECTION);
- }
- void replaceStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireCollectionChanged(STRINGS_COLLECTION);
- }
- void changeList() {
- this.fireListChanged("bogus list");
- }
- }
-
- private class Target {
- TestModel testModel;
- String collectionName;
- String string;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean collectionClearedZeroArgumentFlag = false;
- boolean collectionClearedSingleArgumentFlag = false;
- boolean collectionChangedZeroArgumentFlag = false;
- boolean collectionChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String collectionName, String string) {
- super();
- this.testModel = testModel;
- this.collectionName = collectionName;
- this.string = string;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(CollectionChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.collectionName());
- assertEquals(this.string, e.items().next());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(CollectionChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.collectionName());
- assertEquals(this.string, e.items().next());
- }
- void collectionClearedZeroArgument() {
- this.collectionClearedZeroArgumentFlag = true;
- }
- void collectionClearedSingleArgument(CollectionChangeEvent e) {
- this.collectionClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.collectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedZeroArgument() {
- this.collectionChangedZeroArgumentFlag = true;
- }
- void collectionChangedSingleArgument(CollectionChangeEvent e) {
- this.collectionChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.collectionName, e.collectionName());
- assertFalse(e.items().hasNext());
- }
- void collectionChangedDoubleArgument(CollectionChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
deleted file mode 100644
index 9eb496afae..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
+++ /dev/null
@@ -1,744 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveListChangeListenerTests extends TestCase {
-
- public ReflectiveListChangeListenerTests(String name) {
- super(name);
- }
-
- private ListChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "itemReplacedZeroArgument", "itemMovedZeroArgument", "listClearedZeroArgument", "listChangedZeroArgument");
- }
-
- private ListChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "itemReplacedSingleArgument", "itemMovedSingleArgument", "listClearedSingleArgument", "listChangedSingleArgument");
- }
-
- public void testItemAddedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.addString(string);
- assertTrue(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemAddedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.addString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertTrue(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertTrue(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemRemovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.removeString(string);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertTrue(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedZeroArgument() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertTrue(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedSingleArgument() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertTrue(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemReplacedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String oldString = "foo";
- String newString = "bar";
- testModel.addString(oldString);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceString(oldString, newString);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertTrue(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedZeroArgument() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertTrue(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertTrue(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedSingleArgument() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertTrue(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testItemMovedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- testModel.addString("zero");
- testModel.addString("one");
- testModel.addString("two");
- testModel.addString("three");
- Target target = new Target(testModel, TestModel.STRINGS_LIST, 0, 2);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.moveString(0, 2);
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertTrue(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertTrue(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertTrue(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertTrue(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListClearedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.clearStrings();
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertTrue(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedZeroArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertTrue(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedZeroArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertTrue(target.listChangedZeroArgumentFlag);
- assertFalse(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedSingleArgument() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertTrue(target.listChangedSingleArgumentFlag);
- }
-
- public void testListChangedSingleArgumentNamedList() {
- TestModel testModel = new TestModel();
- String string = "foo";
- testModel.addString(string);
- Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1);
- testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target));
- testModel.replaceAllStrings(new String[] {"bar", "baz"});
- assertFalse(target.itemAddedZeroArgumentFlag);
- assertFalse(target.itemAddedSingleArgumentFlag);
- assertFalse(target.itemRemovedZeroArgumentFlag);
- assertFalse(target.itemRemovedSingleArgumentFlag);
- assertFalse(target.itemReplacedZeroArgumentFlag);
- assertFalse(target.itemReplacedSingleArgumentFlag);
- assertFalse(target.itemMovedZeroArgumentFlag);
- assertFalse(target.itemMovedSingleArgumentFlag);
- assertFalse(target.listClearedZeroArgumentFlag);
- assertFalse(target.listClearedSingleArgumentFlag);
- assertFalse(target.listChangedZeroArgumentFlag);
- assertTrue(target.listChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, "listChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- Method method = ClassTools.method(target, "listChangedDoubleArgument", new Class[] {ListChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- String string = "foo";
- Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0);
- // build a LIST change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private List<String> strings = new ArrayList<String>();
- public static final String STRINGS_LIST = "strings";
- TestModel() {
- super();
- }
- ListIterator<String> strings() {
- return new CloneListIterator<String>(this.strings);
- }
- void addString(String string) {
- this.addItemToList(string, this.strings, STRINGS_LIST);
- }
- void removeString(String string) {
- this.removeItemFromList(this.strings.indexOf(string), this.strings, STRINGS_LIST);
- }
- void replaceString(String oldString, String newString) {
- this.setItemInList(this.strings.indexOf(oldString), newString, this.strings, STRINGS_LIST);
- }
- void moveString(int targetIndex, int sourceIndex) {
- this.moveItemInList(targetIndex, sourceIndex, this.strings, STRINGS_LIST);
- }
- void clearStrings() {
- this.clearList(this.strings, STRINGS_LIST);
- }
- void replaceAllStrings(String[] newStrings) {
- this.strings.clear();
- CollectionTools.addAll(this.strings, newStrings);
- this.fireListChanged(STRINGS_LIST);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection");
- }
- }
-
- private class Target {
- TestModel testModel;
- String listName;
- String string;
- int index;
- String replacedString;
- int sourceIndex;
- boolean itemAddedZeroArgumentFlag = false;
- boolean itemAddedSingleArgumentFlag = false;
- boolean itemRemovedZeroArgumentFlag = false;
- boolean itemRemovedSingleArgumentFlag = false;
- boolean itemReplacedZeroArgumentFlag = false;
- boolean itemReplacedSingleArgumentFlag = false;
- boolean itemMovedZeroArgumentFlag = false;
- boolean itemMovedSingleArgumentFlag = false;
- boolean listClearedZeroArgumentFlag = false;
- boolean listClearedSingleArgumentFlag = false;
- boolean listChangedZeroArgumentFlag = false;
- boolean listChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String listName, String string, int index) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.string = string;
- this.index = index;
- }
- Target(TestModel testModel, String listName, String string, int index, String replacedString) {
- this(testModel, listName, string, index);
- this.replacedString = replacedString;
- }
- Target(TestModel testModel, String listName, int targetIndex, int sourceIndex) {
- super();
- this.testModel = testModel;
- this.listName = listName;
- this.index = targetIndex;
- this.sourceIndex = sourceIndex;
- }
- void itemAddedZeroArgument() {
- this.itemAddedZeroArgumentFlag = true;
- }
- void itemAddedSingleArgument(ListChangeEvent e) {
- this.itemAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.index());
- }
- void itemRemovedZeroArgument() {
- this.itemRemovedZeroArgumentFlag = true;
- }
- void itemRemovedSingleArgument(ListChangeEvent e) {
- this.itemRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.index, e.index());
- }
- void itemReplacedZeroArgument() {
- this.itemReplacedZeroArgumentFlag = true;
- }
- void itemReplacedSingleArgument(ListChangeEvent e) {
- this.itemReplacedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertEquals(this.string, e.items().next());
- assertEquals(this.replacedString, e.replacedItems().next());
- assertEquals(this.index, e.index());
- }
- void itemMovedZeroArgument() {
- this.itemMovedZeroArgumentFlag = true;
- }
- void itemMovedSingleArgument(ListChangeEvent e) {
- this.itemMovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertEquals(this.index, e.targetIndex());
- assertEquals(this.sourceIndex, e.sourceIndex());
- }
- void listChangedZeroArgument() {
- this.listChangedZeroArgumentFlag = true;
- }
- void listClearedSingleArgument(ListChangeEvent e) {
- this.listClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.index());
- }
- void listClearedZeroArgument() {
- this.listClearedZeroArgumentFlag = true;
- }
- void listChangedSingleArgument(ListChangeEvent e) {
- this.listChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.listName, e.listName());
- assertFalse(e.items().hasNext());
- assertEquals(this.index, e.index());
- }
- void listChangedDoubleArgument(ListChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
deleted file mode 100644
index 28ef7be8b0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectivePropertyChangeListenerTests extends TestCase {
-
- public ReflectivePropertyChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testZeroArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedZeroArgument"));
- testModel.setValue(99);
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testSingleArgumentNamedProperty() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument"));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgumentNamedProperty2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedSingleArgument2", new Class[] {Object.class});
- testModel.addPropertyChangeListener(TestModel.VALUE_PROPERTY, ReflectiveChangeListener.buildPropertyChangeListener(target, method));
- testModel.setValue(99);
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- // build a PROPERTY change listener and hack it so we
- // can add it as a STATE change listener
- Object listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "propertyChangedSingleArgument");
- testModel.addStateChangeListener((StateChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.setValue(99);
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel(7);
- Target target = new Target(testModel, TestModel.VALUE_PROPERTY, 7, 99);
- Method method = ClassTools.method(target, "propertyChangedDoubleArgument", new Class[] {PropertyChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- PropertyChangeListener listener = ReflectiveChangeListener.buildPropertyChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private int value = 0;
- public static final String VALUE_PROPERTY = "value";
- TestModel(int value) {
- super();
- this.value = value;
- }
- void setValue(int value) {
- int old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- if (old != value) {
- this.fireStateChanged();
- }
- }
- }
-
- private class Target {
- TestModel testModel;
- String propertyName;
- Object oldValue;
- Object newValue;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel, String propertyName, int oldValue, int newValue) {
- super();
- this.testModel = testModel;
- this.propertyName = propertyName;
- this.oldValue = new Integer(oldValue);
- this.newValue = new Integer(newValue);
- }
- void propertyChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void propertyChangedSingleArgument(PropertyChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.propertyName());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- }
- void propertyChangedSingleArgument2(Object o) {
- PropertyChangeEvent e = (PropertyChangeEvent) o;
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.propertyName, e.propertyName());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- }
- void propertyChangedDoubleArgument(PropertyChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
deleted file mode 100644
index 6230b1c644..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveStateChangeListenerTests extends TestCase {
-
- public ReflectiveStateChangeListenerTests(String name) {
- super(name);
- }
-
- public void testZeroArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedZeroArgument"));
- testModel.changeState();
- assertTrue(target.zeroArgumentFlag);
- assertFalse(target.singleArgumentFlag);
- }
-
- public void testSingleArgument() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument"));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- /**
- * test method that has more general method parameter type
- */
- public void testSingleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ClassTools.method(target, "stateChangedSingleArgument2", new Class[] {Object.class});
- testModel.addStateChangeListener(ReflectiveChangeListener.buildStateChangeListener(target, method));
- testModel.changeState();
- assertFalse(target.zeroArgumentFlag);
- assertTrue(target.singleArgumentFlag);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- // build a STATE change listener and hack it so we
- // can add it as a PROPERTY change listener
- Object listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedSingleArgument");
- testModel.addPropertyChangeListener((PropertyChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeProperty();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, "stateChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel();
- Target target = new Target(testModel);
- Method method = ClassTools.method(target, "stateChangedDoubleArgument", new Class[] {StateChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- StateChangeListener listener = ReflectiveChangeListener.buildStateChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- TestModel() {
- super();
- }
- void changeState() {
- this.fireStateChanged();
- }
- void changeProperty() {
- this.firePropertyChanged("value", 55, 42);
- }
- }
-
- private class Target {
- TestModel testModel;
- boolean zeroArgumentFlag = false;
- boolean singleArgumentFlag = false;
- Target(TestModel testModel) {
- super();
- this.testModel = testModel;
- }
- void stateChangedZeroArgument() {
- this.zeroArgumentFlag = true;
- }
- void stateChangedSingleArgument(StateChangeEvent e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- }
- void stateChangedSingleArgument2(Object e) {
- this.singleArgumentFlag = true;
- assertSame(this.testModel, ((StateChangeEvent) e).getSource());
- }
- void stateChangedDoubleArgument(StateChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
deleted file mode 100644
index 9504e2a33d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-import junit.framework.TestCase;
-
-public class ReflectiveTreeChangeListenerTests extends TestCase {
-
- public ReflectiveTreeChangeListenerTests(String name) {
- super(name);
- }
-
- private TreeChangeListener buildZeroArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedZeroArgument", "nodeRemovedZeroArgument", "treeClearedZeroArgument", "treeChangedZeroArgument");
- }
-
- private TreeChangeListener buildSingleArgumentListener(Object target) {
- return ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedSingleArgument", "nodeRemovedSingleArgument", "treeClearedSingleArgument", "treeChangedSingleArgument");
- }
-
- public void testNodeAddedZeroArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.addNode("root", "child");
- assertTrue(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.addNode("root", "child");
- assertTrue(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedSingleArgument() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.addNode("root", "child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertTrue(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeAddedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.addNode("root", "child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertTrue(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertTrue(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertTrue(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertTrue(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testNodeRemovedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.removeNode("child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertTrue(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertTrue(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertTrue(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertTrue(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeClearedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- testModel.addNode("child", "grandchild");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[0]);
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.clearTree();
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertTrue(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedZeroArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(this.buildZeroArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertTrue(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedZeroArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildZeroArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertTrue(target.treeChangedZeroArgumentFlag);
- assertFalse(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedSingleArgument() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(this.buildSingleArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertTrue(target.treeChangedSingleArgumentFlag);
- }
-
- public void testTreeChangedSingleArgumentNamedTree() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "another child"});
- testModel.addTreeChangeListener(TestModel.STRINGS_TREE, this.buildSingleArgumentListener(target));
- testModel.replaceNode("child", "another child");
- assertFalse(target.nodeAddedZeroArgumentFlag);
- assertFalse(target.nodeAddedSingleArgumentFlag);
- assertFalse(target.nodeRemovedZeroArgumentFlag);
- assertFalse(target.nodeRemovedSingleArgumentFlag);
- assertFalse(target.treeClearedZeroArgumentFlag);
- assertFalse(target.treeClearedSingleArgumentFlag);
- assertFalse(target.treeChangedZeroArgumentFlag);
- assertTrue(target.treeChangedSingleArgumentFlag);
- }
-
- public void testBogusDoubleArgument1() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(target, "collectionChangedDoubleArgument");
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getCause().getClass() == NoSuchMethodException.class) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testBogusDoubleArgument2() throws Exception {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- Method method = ClassTools.method(target, "collectionChangedDoubleArgument", new Class[] {TreeChangeEvent.class, Object.class});
- boolean exCaught = false;
- try {
- TreeChangeListener listener = ReflectiveChangeListener.buildTreeChangeListener(target, method);
- fail("bogus listener: " + listener);
- } catch (RuntimeException ex) {
- if (ex.getMessage().equals(method.toString())) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- }
-
- public void testListenerMismatch() {
- TestModel testModel = new TestModel("root");
- testModel.addNode("root", "child");
- Target target = new Target(testModel, TestModel.STRINGS_TREE, new String[]{"root", "child"});
- // build a TREE change listener and hack it so we
- // can add it as a COLLECTION change listener
- Object listener = ReflectiveChangeListener.buildTreeChangeListener(target, "nodeAddedSingleArgument");
- testModel.addCollectionChangeListener((CollectionChangeListener) listener);
-
- boolean exCaught = false;
- try {
- testModel.changeCollection();
- fail("listener mismatch: " + listener);
- } catch (IllegalArgumentException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
-
- private class TestModel extends AbstractModel {
- private final String root;
- private Map<String, Collection<String>> childrenLists = new HashMap<String, Collection<String>>();
- private Map<String, String> parents = new HashMap<String, String>();
- public static final String STRINGS_TREE = "strings";
- TestModel(String root) {
- super();
- if (root == null) {
- throw new NullPointerException();
- }
- this.root = root;
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.put(root, null);
- }
- String getRoot() {
- return this.root;
- }
- private String[] path(String node) {
- String temp = node;
- List<String> reversePath = new ArrayList<String>();
- do {
- reversePath.add(temp);
- temp = this.parents.get(temp);
- } while (temp != null);
- return CollectionTools.reverse(reversePath).toArray(new String[reversePath.size()]);
- }
- Iterator<String> strings() {
- return new CloneIterator<String>(this.childrenLists.keySet()) {
- @Override
- protected void remove(String s) {
- TestModel.this.removeNode(s);
- }
- };
- }
- void addNode(String parent, String child) {
- if ((parent == null) || (child == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(parent);
- if (children == null) {
- throw new IllegalStateException("cannot add a child to a non-existent parent");
- }
-
- if (this.childrenLists.get(child) != null) {
- throw new IllegalStateException("cannot add a child that is already in the tree");
- }
-
- children.add(child);
- this.childrenLists.put(child, new ArrayList<String>());
- this.parents.put(child, parent);
- this.fireNodeAdded(STRINGS_TREE, this.path(child));
- }
- void removeNode(String node) {
- if (node == null) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.get(node);
- if (children == null) {
- throw new IllegalStateException("node is not in tree");
- }
- Object[] path = this.path(node);
- for (String s : children) {
- this.removeNode(s);
- }
- this.childrenLists.remove(node);
- this.parents.remove(node);
- this.fireNodeRemoved(STRINGS_TREE, path);
- }
- void replaceNode(String oldNode, String newNode) {
- if ((oldNode == null) || (newNode == null)) {
- throw new NullPointerException();
- }
-
- Collection<String> children = this.childrenLists.remove(oldNode);
- if (children == null) {
- throw new IllegalStateException("old node is not in tree");
- }
- this.childrenLists.put(newNode, children);
- for (String child : children) {
- this.parents.put(child, newNode);
- }
-
- String parent = this.parents.remove(oldNode);
- this.parents.put(newNode, parent);
-
- this.fireTreeChanged(STRINGS_TREE, this.path(newNode));
- }
- void clearTree() {
- this.childrenLists.clear();
- this.childrenLists.put(root, new ArrayList<String>());
- this.parents.clear();
- this.parents.put(root, null);
- this.fireTreeCleared(STRINGS_TREE);
- }
- void changeCollection() {
- this.fireCollectionChanged("bogus collection");
- }
- }
-
- private class Target {
- TestModel testModel;
- String treeName;
- String[] path;
- boolean nodeAddedZeroArgumentFlag = false;
- boolean nodeAddedSingleArgumentFlag = false;
- boolean nodeRemovedZeroArgumentFlag = false;
- boolean nodeRemovedSingleArgumentFlag = false;
- boolean treeClearedZeroArgumentFlag = false;
- boolean treeClearedSingleArgumentFlag = false;
- boolean treeChangedZeroArgumentFlag = false;
- boolean treeChangedSingleArgumentFlag = false;
- Target(TestModel testModel, String treeName, String[] path) {
- super();
- this.testModel = testModel;
- this.treeName = treeName;
- this.path = path;
- }
- void nodeAddedZeroArgument() {
- this.nodeAddedZeroArgumentFlag = true;
- }
- void nodeAddedSingleArgument(TreeChangeEvent e) {
- this.nodeAddedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.treeName());
- assertTrue(Arrays.equals(this.path, e.path()));
- }
- void nodeRemovedZeroArgument() {
- this.nodeRemovedZeroArgumentFlag = true;
- }
- void nodeRemovedSingleArgument(TreeChangeEvent e) {
- this.nodeRemovedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.treeName());
- assertTrue(Arrays.equals(this.path, e.path()));
- }
- void treeClearedZeroArgument() {
- this.treeClearedZeroArgumentFlag = true;
- }
- void treeClearedSingleArgument(TreeChangeEvent e) {
- this.treeClearedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.treeName());
- assertTrue(Arrays.equals(this.path, e.path()));
- }
- void treeChangedZeroArgument() {
- this.treeChangedZeroArgumentFlag = true;
- }
- void treeChangedSingleArgument(TreeChangeEvent e) {
- this.treeChangedSingleArgumentFlag = true;
- assertSame(this.testModel, e.getSource());
- assertEquals(this.treeName, e.treeName());
- assertTrue(Arrays.equals(this.path, e.path()));
- }
- void collectionChangedDoubleArgument(TreeChangeEvent e, Object o) {
- fail("bogus event: " + e);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
deleted file mode 100644
index ec2025375c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Date;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class BufferedWritablePropertyValueModelTests extends TestCase {
- private Employee employee;
- private WritablePropertyValueModel<Employee> employeeHolder;
- PropertyChangeEvent employeeEvent;
-
- private WritablePropertyValueModel<Integer> idAdapter;
- private WritablePropertyValueModel<String> nameAdapter;
- private WritablePropertyValueModel<Date> hireDateAdapter;
- PropertyChangeEvent adapterEvent;
-
- private BufferedWritablePropertyValueModel.Trigger trigger;
- private WritablePropertyValueModel<Integer> bufferedIDHolder;
- private WritablePropertyValueModel<String> bufferedNameHolder;
- private WritablePropertyValueModel<Date> bufferedHireDateHolder;
- PropertyChangeEvent bufferedEvent;
-
- public BufferedWritablePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.employee = new Employee(17, "Freddy", new Date());
- this.employeeHolder = new SimplePropertyValueModel<Employee>(this.employee);
-
- this.trigger = new BufferedWritablePropertyValueModel.Trigger();
-
- this.idAdapter = this.buildIDAdapter(this.employeeHolder);
- this.bufferedIDHolder = new BufferedWritablePropertyValueModel<Integer>(this.idAdapter, this.trigger);
-
- this.nameAdapter = this.buildNameAdapter(this.employeeHolder);
- this.bufferedNameHolder = new BufferedWritablePropertyValueModel<String>(this.nameAdapter, this.trigger);
-
- this.hireDateAdapter = this.buildHireDateAdapter(this.employeeHolder);
- this.bufferedHireDateHolder = new BufferedWritablePropertyValueModel<Date>(this.hireDateAdapter, this.trigger);
- }
-
- private WritablePropertyValueModel<Integer> buildIDAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Integer>(eHolder, Employee.ID_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getID());
- }
- @Override
- protected void setValue_(Integer value) {
- this.subject.setID(value.intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, String>(eHolder, Employee.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<Date> buildHireDateAdapter(PropertyValueModel<Employee> eHolder) {
- return new PropertyAspectAdapter<Employee, Date>(eHolder, Employee.HIRE_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getHireDate();
- }
- @Override
- protected void setValue_(Date value) {
- this.subject.setHireDate(value);
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertEquals(new Integer(17), this.idAdapter.value());
- assertEquals(new Integer(17), this.bufferedIDHolder.value());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.value());
- assertEquals("Freddy", this.bufferedNameHolder.value());
-
- Date temp = this.employee.getHireDate();
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.value());
- assertEquals(temp, this.bufferedHireDateHolder.value());
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.value());
- assertEquals(new Integer(323), this.bufferedIDHolder.value());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.value());
- assertEquals("Ripley", this.bufferedNameHolder.value());
-
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.value());
- assertEquals(null, this.bufferedHireDateHolder.value());
- }
-
- public void testAccept() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.value());
- assertEquals(new Integer(323), this.bufferedIDHolder.value());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.value());
- assertEquals("Ripley", this.bufferedNameHolder.value());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.value());
- assertEquals(null, this.bufferedHireDateHolder.value());
-
- this.trigger.accept();
-
- assertEquals(323, this.employee.getID());
- assertEquals(new Integer(323), this.idAdapter.value());
- assertEquals(new Integer(323), this.bufferedIDHolder.value());
-
- assertEquals("Ripley", this.employee.getName());
- assertEquals("Ripley", this.nameAdapter.value());
- assertEquals("Ripley", this.bufferedNameHolder.value());
-
- assertEquals(null, this.employee.getHireDate());
- assertEquals(null, this.hireDateAdapter.value());
- assertEquals(null, this.bufferedHireDateHolder.value());
- }
-
- public void testReset() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- this.bufferedIDHolder.setValue(new Integer(323));
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.value());
- assertEquals(new Integer(323), this.bufferedIDHolder.value());
-
- this.bufferedNameHolder.setValue("Ripley");
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.value());
- assertEquals("Ripley", this.bufferedNameHolder.value());
-
- Date temp = this.employee.getHireDate();
- this.bufferedHireDateHolder.setValue(null);
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.value());
- assertEquals(null, this.bufferedHireDateHolder.value());
-
- this.trigger.reset();
-
- assertEquals(17, this.employee.getID());
- assertEquals(new Integer(17), this.idAdapter.value());
- assertEquals(new Integer(17), this.bufferedIDHolder.value());
-
- assertEquals("Freddy", this.employee.getName());
- assertEquals("Freddy", this.nameAdapter.value());
- assertEquals("Freddy", this.bufferedNameHolder.value());
-
- assertEquals(temp, this.employee.getHireDate());
- assertEquals(temp, this.hireDateAdapter.value());
- assertEquals(temp, this.bufferedHireDateHolder.value());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedIDHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasAnyPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
-
- this.bufferedIDHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedNameHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
- this.bufferedHireDateHolder.removePropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- assertTrue(((AbstractModel) this.bufferedIDHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedNameHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.bufferedHireDateHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(((AbstractModel) this.idAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.nameAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.hireDateAdapter).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.ID_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.NAME_PROPERTY));
- assertTrue(this.employee.hasNoPropertyChangeListeners(Employee.HIRE_DATE_PROPERTY));
- }
-
- public void testPropertyChange1() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(PropertyValueModel.VALUE, bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(Employee.NAME_PROPERTY, employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- PropertyChangeListener bufferedListener = this.buildBufferedListener();
- this.bufferedNameHolder.addPropertyChangeListener(bufferedListener);
-
- PropertyChangeListener adapterListener = this.buildAdapterListener();
- this.nameAdapter.addPropertyChangeListener(adapterListener);
-
- PropertyChangeListener employeeListener = this.buildEmployeeListener();
- this.employee.addPropertyChangeListener(employeeListener);
-
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Ripley");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Freddy", "Ripley");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Charlie");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Ripley", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.accept();
- assertNull(this.bufferedEvent);
- this.verifyEvent(this.adapterEvent, this.nameAdapter, PropertyValueModel.VALUE, "Freddy", "Charlie");
- this.verifyEvent(this.employeeEvent, this.employee, Employee.NAME_PROPERTY, "Freddy", "Charlie");
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.bufferedNameHolder.setValue("Jason");
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Charlie", "Jason");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
-
- this.bufferedEvent = null;
- this.adapterEvent = null;
- this.employeeEvent = null;
- this.trigger.reset();
- this.verifyEvent(this.bufferedEvent, this.bufferedNameHolder, PropertyValueModel.VALUE, "Jason", "Charlie");
- assertNull(this.adapterEvent);
- assertNull(this.employeeEvent);
- }
-
- private PropertyChangeListener buildBufferedListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.bufferedEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildAdapterListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.adapterEvent = e;
- }
- };
- }
-
- private PropertyChangeListener buildEmployeeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- BufferedWritablePropertyValueModelTests.this.employeeEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent event, Object source, String propertyName, Object oldValue, Object newValue) {
- assertEquals(source, event.getSource());
- assertEquals(propertyName, event.propertyName());
- assertEquals(oldValue, event.oldValue());
- assertEquals(newValue, event.newValue());
- }
-
-
- // ********** inner class **********
-
- private class Employee extends AbstractModel {
- private int id;
- public static final String ID_PROPERTY = "id";
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Date hireDate;
- public static final String HIRE_DATE_PROPERTY = "hireDate";
-
- Employee(int id, String name, Date hireDate) {
- super();
- this.id = id;
- this.name = name;
- this.hireDate = hireDate;
- }
- int getID() {
- return this.id;
- }
- void setID(int id) {
- int old = this.id;
- this.id = id;
- this.firePropertyChanged(ID_PROPERTY, old, id);
- }
- String getName() {
- return this.name;
- }
- void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- Date getHireDate() {
- return this.hireDate;
- }
- void setHireDate(Date hireDate) {
- Object old = this.hireDate;
- this.hireDate = hireDate;
- this.firePropertyChanged(HIRE_DATE_PROPERTY, old, hireDate);
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
deleted file mode 100644
index 1d48711ead..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalCollectionAspectAdapter aa1;
- private CollectionChangeEvent event1;
- private CollectionChangeListener listener1;
- private String event1Type;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
- private TestSubject subject2;
-
- public CollectionAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- this.event1 = null;
- this.event1Type = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private Collection<String> subject1Names() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private Collection<String> subject1Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private Collection<String> subject2Names() {
- Collection<String> result = new HashBag<String>();
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private Collection<String> subject2Descriptions() {
- Collection<String> result = new HashBag<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalCollectionAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalCollectionAspectAdapter(subjectHolder);
- }
-
- private CollectionChangeListener buildValueChangeListener1() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, ADD);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, REMOVE);
- }
- public void collectionCleared(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CLEAR);
- }
- public void collectionChanged(CollectionChangeEvent e) {
- CollectionAspectAdapterTests.this.value1Changed(e, CHANGE);
- }
- };
- }
-
- void value1Changed(CollectionChangeEvent e, String eventType) {
- this.event1 = e;
- this.event1Type = eventType;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertFalse(this.event1.items().hasNext());
- assertFalse((this.aa1.iterator()).hasNext());
-
- this.event1 = null;
- this.event1Type = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertEquals("jam", this.event1.items().next());
- Collection<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.addAll(Collections.singleton("jaz"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, ADD);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertEquals("jaz", this.event1.items().next());
- namesPlus.add("jaz");
- assertEquals(namesPlus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.removeName("foo");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertEquals("foo", this.event1.items().next());
- Collection<String> namesMinus = this.subject1Names();
- namesMinus.remove("foo");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
-
- this.event1 = null;
- this.event1Type = null;
- this.aa1.removeAll(Collections.singleton("bar"));
- assertNotNull(this.event1);
- assertEquals(this.event1Type, REMOVE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertEquals("bar", this.event1.items().next());
- namesMinus.remove("bar");
- assertEquals(namesMinus, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testCollectionChange() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.event1Type, CHANGE);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event1.collectionName());
- assertFalse(this.event1.items().hasNext());
- Collection<String> namesPlus2 = this.subject1Names();
- namesPlus2.add("jam");
- namesPlus2.add("jaz");
- assertEquals(namesPlus2, CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.bag(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.bag(this.aa1.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.iterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- CollectionChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addCollectionChangeListener(listener2);
- assertTrue(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- this.aa1.removeCollectionChangeListener(listener2);
- assertFalse(this.subject1.hasAnyCollectionChangeListeners(TestSubject.NAMES_COLLECTION));
- assertFalse(this.aa1.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private Collection<String> names;
- public static final String NAMES_COLLECTION = "names";
- private Collection<String> descriptions;
- public static final String DESCRIPTIONS_COLLECTION = "descriptions";
-
- public TestSubject() {
- this.names = new HashBag<String>();
- this.descriptions = new HashBag<String>();
- }
- public Iterator<String> names() {
- return new ReadOnlyIterator<String>(this.names);
- }
- public void addName(String name) {
- if (this.names.add(name)) {
- this.fireItemAdded(NAMES_COLLECTION, name);
- }
- }
- public void addNames(Iterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(Collection<String> newNames) {
- this.addNames(newNames.iterator());
- }
- public void addTwoNames(String name1, String name2) {
- if (this.names.add(name1) | this.names.add(name2)) {
- this.fireCollectionChanged(NAMES_COLLECTION);
- }
- }
- public void removeName(String name) {
- if (this.names.remove(name)) {
- this.fireItemRemoved(NAMES_COLLECTION, name);
- }
- }
- public Iterator<String> descriptions() {
- return new ReadOnlyIterator<String>(this.descriptions);
- }
- public void addDescription(String description) {
- if (this.descriptions.add(description)) {
- this.fireItemAdded(DESCRIPTIONS_COLLECTION, description);
- }
- }
- public void addDescriptions(Iterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(Collection<String> newDescriptions) {
- this.addDescriptions(newDescriptions.iterator());
- }
- public void removeDescription(String description) {
- if (this.descriptions.remove(description)) {
- this.fireItemRemoved(DESCRIPTIONS_COLLECTION, description);
- }
- }
- }
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- private class LocalCollectionAspectAdapter extends CollectionAspectAdapter<TestSubject, String> {
-
- LocalCollectionAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_COLLECTION);
- }
-
- @Override
- protected Iterator<String> iterator_() {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- return this.subject.names();
- }
- if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- return this.subject.descriptions();
- }
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
-
- public void add(String item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.addName(item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.addDescription(item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void addAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public void remove(Object item) {
- if (this.collectionNames[0] == TestSubject.NAMES_COLLECTION) {
- this.subject.removeName((String) item);
- } else if (this.collectionNames[0] == TestSubject.DESCRIPTIONS_COLLECTION) {
- this.subject.removeDescription((String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.collectionNames[0]);
- }
- }
-
- public void removeAll(Collection<String> items) {
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- this.remove(stream.next());
- }
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
deleted file mode 100644
index a4c4e23918..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-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.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
- public CollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new CollectionListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- private Collection<String> adapterCollection() {
- return CollectionTools.collection(this.adapter.iterator());
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterCollection = this.adapterCollection();
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testAdd() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemove() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertTrue(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- Collection<String> adapterCollection = this.adapterCollection();
- assertEquals(this.wrappedCollection, adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testCollectionChangedToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedCollectionHolder.setCollection(new HashBag<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- bag.add("foo");
- bag.add("bar");
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- HashBag<String> bag = new HashBag<String>();
- this.wrappedCollectionHolder.setCollection(bag);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
deleted file mode 100644
index 4924c07dfa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CollectionPropertyValueModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- PropertyChangeEvent event;
-
- public CollectionPropertyValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>();
- this.adapter = new LocalAdapter(this.wrappedCollectionHolder, "666");
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean booleanValue() {
- return this.adapter.value().booleanValue();
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedCollectionHolder.iterator());
- }
-
- public void testValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("111");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("222");
- assertFalse(this.booleanValue());
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.remove("666");
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.wrappedCollectionHolder.clear();
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testSetValue() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- });
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.TRUE);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.setValue(Boolean.FALSE);
- assertFalse(this.booleanValue());
- assertFalse(this.wrappedCollection().contains("666"));
- }
-
- public void testEventFiring() {
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CollectionPropertyValueModelAdapterTests.this.event = e;
- }
- });
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("111");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("222");
- assertNull(this.event);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.remove("666");
- this.verifyEvent(true, false);
-
- this.wrappedCollectionHolder.add("666");
- this.verifyEvent(false, true);
-
- this.wrappedCollectionHolder.clear();
- this.verifyEvent(true, false);
- }
-
- private void verifyEvent(boolean oldValue, boolean newValue) {
- assertEquals(this.adapter, this.event.getSource());
- assertEquals(Boolean.valueOf(oldValue), this.event.oldValue());
- assertEquals(Boolean.valueOf(newValue), this.event.newValue());
- this.event = null;
- }
-
- public void testStaleValue() {
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- this.wrappedCollectionHolder.add("666");
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
-
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(this.booleanValue());
- assertTrue(this.wrappedCollection().contains("666"));
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- PropertyChangeListener listener = new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {/* OK */}
- };
- this.adapter.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.adapter.removePropertyChangeListener(listener);
- assertFalse(((AbstractModel) this.adapter).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(((AbstractModel) this.wrappedCollectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
-
- // ********** member class **********
-
- /**
- * the value is true if the wrapped collection contains the specified item,
- * otherwise the value is false
- */
- private static class LocalAdapter
- extends CollectionPropertyValueModelAdapter<Boolean>
- implements WritablePropertyValueModel<Boolean>
- {
- private String item;
-
- LocalAdapter(CollectionValueModel<String> collectionHolder, String item) {
- super(collectionHolder);
- this.item = item;
- }
-
- // ********** CollectionPropertyValueModelAdapter implementation **********
- /**
- * always return a Boolean
- */
- @Override
- public Boolean value() {
- Boolean result = super.value();
- return (result == null) ? Boolean.FALSE : result;
- }
- @SuppressWarnings("unchecked")
- public void setValue(Boolean value) {
- if (this.booleanValue()) {
- if ( ! this.booleanValueOf(value)) {
- // the value is changing from true to false
- ((SimpleCollectionValueModel<String>) this.collectionHolder).remove(this.item);
- }
- } else {
- if (this.booleanValueOf(value)) {
- // the value is changing from false to true
- ((SimpleCollectionValueModel<String>) this.collectionHolder).add(this.item);
- }
- }
- }
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(CollectionTools.contains(this.collectionHolder.iterator(), this.item));
- }
-
- // ********** internal methods **********
- private boolean booleanValue() {
- return this.booleanValueOf(this.value);
- }
- private boolean booleanValueOf(Object b) {
- return (b == null) ? false : ((Boolean) b).booleanValue();
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
deleted file mode 100644
index 90f4b6ff0b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CompositeCollectionValueModelTests extends TestCase {
- private Neighborhood neighborhood;
- private WritablePropertyValueModel<Neighborhood> neighborhoodHolder;
-
- public CompositeCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.neighborhood = new Neighborhood("Hanna-Barbera");
- this.neighborhoodHolder = new SimplePropertyValueModel<Neighborhood>(this.neighborhood);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSynch1() {
- this.verifySynch(this.buildAllMembersComposite(this.neighborhoodHolder));
- }
-
- public void testSynch2() {
- this.verifySynch(this.buildAllMembersComposite2(this.neighborhoodHolder));
- }
-
- private void verifySynch(CollectionValueModel<Member> compositeCVM) {
- assertEquals(0, CollectionTools.size(compositeCVM.iterator()));
- Bag<Family> familiesSynch = new CoordinatedBag<Family>(this.buildFamiliesAspectAdapter(this.neighborhoodHolder));
- Bag<Member> membersSynch = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
-
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Astro"));
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.removeMember(jetsons.memberNamed("Judy"));
- assertEquals(3, familiesSynch.size());
- assertEquals(10, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(10, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- jetsons.addMember("Fido");
- assertEquals(3, familiesSynch.size());
- assertEquals(11, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(11, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- this.neighborhood.removeFamily(jetsons);
- assertEquals(2, familiesSynch.size());
- assertEquals(7, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(7, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Family bears = this.neighborhood.addFamily("Bear");
- bears.addMember("Yogi");
- assertEquals(3, familiesSynch.size());
- assertEquals(8, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(8, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- bears.addMember("Boo-Boo");
- assertEquals(3, familiesSynch.size());
- assertEquals(9, CollectionTools.size(this.neighborhood.allMembers()));
- assertEquals(9, membersSynch.size());
- assertEquals(CollectionTools.bag(this.neighborhood.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
-
- Neighborhood n2 = new Neighborhood("Hanna-Barbera 2");
- this.neighborhoodHolder.setValue(n2);
- this.populateNeighborhood(n2);
- assertEquals(3, familiesSynch.size());
- assertEquals(12, CollectionTools.size(n2.allMembers()));
- assertEquals(12, membersSynch.size());
- assertEquals(CollectionTools.bag(n2.allMembers()), membersSynch);
- assertEquals(membersSynch, CollectionTools.bag(compositeCVM.iterator()));
- }
-
- public void testNoTransformer() {
- SimpleCollectionValueModel<String> subCVM1 = new SimpleCollectionValueModel<String>();
- SimpleCollectionValueModel<String> subCVM2 = new SimpleCollectionValueModel<String>();
- Collection<CollectionValueModel<String>> collection = new ArrayList<CollectionValueModel<String>>();
- collection.add(subCVM1);
- collection.add(subCVM2);
- Bag<String> synchBag = new CoordinatedBag<String>(new CompositeCollectionValueModel<CollectionValueModel<String>, String>(collection));
-
- assertEquals(0, synchBag.size());
-
- subCVM1.add("foo");
- subCVM1.add("bar");
- subCVM1.add("baz");
- assertEquals(3, synchBag.size());
- assertTrue(synchBag.contains("foo"));
-
- subCVM2.add("joo");
- subCVM2.add("jar");
- subCVM2.add("jaz");
- assertEquals(6, synchBag.size());
- assertTrue(synchBag.contains("foo"));
- assertTrue(synchBag.contains("jaz"));
-
- subCVM1.remove("baz");
- assertEquals(5, synchBag.size());
- assertFalse(synchBag.contains("baz"));
- }
-
- public void testDuplicateItem() {
- Bag<Member> synchBag = new CoordinatedBag<Member>(this.buildAllMembersComposite(this.neighborhoodHolder));
- this.populateNeighborhood(this.neighborhood);
- boolean exCaught = false;
- try {
- this.neighborhood.addFamily(this.neighborhood.familyNamed("Jetson"));
- } catch (IllegalStateException ex) {
- if (ex.getMessage().indexOf("duplicate component") != -1) {
- exCaught = true;
- }
- }
- assertTrue(exCaught);
- assertEquals(12, synchBag.size());
- }
-
- public void testHasListeners() {
- CompositeCollectionValueModel<Family, Member> compositeCVM = this.buildAllMembersComposite(this.neighborhoodHolder);
- CoordinatedBag<Member> synchBag = new CoordinatedBag<Member>(compositeCVM);
- this.populateNeighborhood(this.neighborhood);
- Family jetsons = this.neighborhood.familyNamed("Jetson");
-
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.removeCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertFalse(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertFalse(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
-
- compositeCVM.addCollectionChangeListener(CollectionValueModel.VALUES, synchBag);
- assertTrue(compositeCVM.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(jetsons.hasAnyCollectionChangeListeners(Family.MEMBERS_COLLECTION));
- }
-
- private void populateNeighborhood(Neighborhood n) {
- Family family1 = n.addFamily("Flintstone");
- family1.addMember("Fred");
- family1.addMember("Wilma");
- family1.addMember("Pebbles");
- family1.addMember("Dino");
- Family family2 = n.addFamily("Rubble");
- family2.addMember("Barney");
- family2.addMember("Betty");
- family2.addMember("Bamm-Bamm");
- Family family3 = n.addFamily("Jetson");
- family3.addMember("George");
- family3.addMember("Jane");
- family3.addMember("Judy");
- family3.addMember("Elroy");
- family3.addMember("Astro");
- }
-
- private CollectionValueModel<Family> buildFamiliesAspectAdapter(PropertyValueModel<Neighborhood> communeHolder) {
- return new CollectionAspectAdapter<Neighborhood, Family>(communeHolder, Neighborhood.FAMILIES_COLLECTION) {
- @Override
- protected Iterator<Family> iterator_() {
- return this.subject.families();
- }
- };
- }
-
- CollectionValueModel<Member> buildMembersAdapter(Family family) {
- return new CollectionAspectAdapter<Family, Member>(Family.MEMBERS_COLLECTION, family) {
- @Override
- protected Iterator<Member> iterator_() {
- return this.subject.members();
- }
- };
- }
-
- private CompositeCollectionValueModel<Family, Member> buildAllMembersComposite(PropertyValueModel<Neighborhood> communeHolder) {
- // override #transform(Object)
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder)) {
- @Override
- protected CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- };
- }
-
- private CollectionValueModel<Member> buildAllMembersComposite2(PropertyValueModel<Neighborhood> communeHolder) {
- // build a custom Transformer
- return new CompositeCollectionValueModel<Family, Member>(this.buildFamiliesAspectAdapter(communeHolder), this.buildTransformer());
- }
-
- private Transformer<Family, CollectionValueModel<Member>> buildTransformer() {
- return new Transformer<Family, CollectionValueModel<Member>>() {
- public CollectionValueModel<Member> transform(Family family) {
- return CompositeCollectionValueModelTests.this.buildMembersAdapter(family);
- }
- @Override
- public String toString() {
- return "Local Transformer";
- }
- };
- }
-
-
-// ********** inner classes **********
-
- /**
- * inner class
- */
- private class Neighborhood extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Family> families = new ArrayList<Family>();
- public static final String FAMILIES_COLLECTION = "families";
-
- public Neighborhood(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Family> families() {
- return this.families.iterator();
- }
-
- public Family addFamily(String familyName) {
- return this.addFamily(new Family(familyName));
- }
-
- // backdoor to allow duplicates
- public Family addFamily(Family family) {
- this.addItemToCollection(family, this.families, FAMILIES_COLLECTION);
- return family;
- }
-
- public void removeFamily(Family family) {
- this.removeItemFromCollection(family, this.families, FAMILIES_COLLECTION);
- }
-
- public Family familyNamed(String familyName) {
- for (Family family : this.families) {
- if (family.getName().equals(familyName)) {
- return family;
- }
- }
- throw new IllegalArgumentException(familyName);
- }
-
- public Iterator<Member> allMembers() {
- return new CompositeIterator<Member>(this.membersIterators());
- }
-
- private Iterator<Iterator<Member>> membersIterators() {
- return new TransformationIterator<Family, Iterator<Member>>(this.families()) {
- @Override
- protected Iterator<Member> transform(Family family) {
- return family.members();
- }
- };
- }
-
- public Member memberNamed(String familyName, String memberName) {
- return this.familyNamed(familyName).memberNamed(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- private class Family extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private Collection<Member> members = new ArrayList<Member>();
- public static final String MEMBERS_COLLECTION = "members";
-
- public Family(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<Member> members() {
- return this.members.iterator();
- }
-
- public Member addMember(String memberName) {
- Member member = new Member(memberName);
- this.addItemToCollection(member, this.members, MEMBERS_COLLECTION);
- return member;
- }
-
- public void removeMember(Member member) {
- this.removeItemFromCollection(member, this.members, MEMBERS_COLLECTION);
- }
-
- public Member memberNamed(String memberName) {
- for (Member member : this.members) {
- if (member.getName().equals(memberName)) {
- return member;
- }
- }
- throw new IllegalArgumentException(memberName);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-
- /**
- * inner class
- */
- private class Member extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Member(String name) {
- super();
- this.name = name;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
deleted file mode 100644
index 5ff07daaf0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
+++ /dev/null
@@ -1,849 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CompositeListValueModelTests extends TestCase {
- private SimpleListValueModel<String> lvm0;
- private SimpleListValueModel<String> lvm1;
- private SimpleListValueModel<String> lvm2;
- private SimpleListValueModel<String> lvm3;
- private SimpleListValueModel<SimpleListValueModel<String>> uberLVM;
- private CompositeListValueModel<SimpleListValueModel<String>, String> compositeLVM;
-
- public CompositeListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.lvm0 = new SimpleListValueModel<String>();
- this.lvm0.add("aaa");
- this.lvm0.add("bbb");
- this.lvm0.add("ccc");
-
- this.lvm1 = new SimpleListValueModel<String>();
- this.lvm1.add("ddd");
- this.lvm1.add("eee");
-
- this.lvm2 = new SimpleListValueModel<String>();
- this.lvm2.add("fff");
-
- this.lvm3 = new SimpleListValueModel<String>();
- this.lvm3.add("ggg");
- this.lvm3.add("hhh");
- this.lvm3.add("iii");
- this.lvm3.add("jjj");
- this.lvm3.add("kkk");
-
- this.uberLVM = new SimpleListValueModel<SimpleListValueModel<String>>();
- this.uberLVM.add(this.lvm0);
- this.uberLVM.add(this.lvm1);
- this.uberLVM.add(this.lvm2);
- this.uberLVM.add(this.lvm3);
-
- this.compositeLVM = new CompositeListValueModel<SimpleListValueModel<String>, String>((ListValueModel<SimpleListValueModel<String>>) this.uberLVM);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetInt() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.get(0));
- assertEquals("aaa", coordList.get(0));
- assertEquals("bbb", this.compositeLVM.get(1));
- assertEquals("bbb", coordList.get(1));
- assertEquals("ccc", this.compositeLVM.get(2));
- assertEquals("ccc", coordList.get(2));
-
- assertEquals("ddd", this.compositeLVM.get(3));
- assertEquals("ddd", coordList.get(3));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
-
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
-
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testIterator() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals("aaa", this.compositeLVM.iterator().next());
- assertEquals("aaa", coordList.iterator().next());
- Iterator<String> stream1 = coordList.iterator();
- for (Iterator<String> stream2 = this.compositeLVM.iterator(); stream2.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- assertFalse(stream1.hasNext());
- }
-
- public void testSize() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertEquals(11, this.compositeLVM.size());
- assertEquals(11, coordList.size());
- }
-
- public void testToArray() {
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testHasListeners() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.removeListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertFalse(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.compositeLVM.addListChangeListener(ListValueModel.LIST_VALUES, coordList);
- assertTrue(this.compositeLVM.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.lvm0.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testAddSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(0, lvm);
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(2, lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvm = new SimpleListValueModel<String>();
- lvm.add("xxx");
- lvm.add("yyy");
- lvm.add("zzz");
- this.uberLVM.add(lvm);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- Collection<SimpleListValueModel<String>> c = new ArrayList<SimpleListValueModel<String>>();
- c.add(lvmA);
- c.add(lvmB);
- this.uberLVM.addAll(2, c);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(12));
- assertEquals("ggg", coordList.get(12));
- }
-
- public void testRemoveSource_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(0);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveSource_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveSource_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testRemoveSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.remove(2, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("eee", this.compositeLVM.get(4));
- assertEquals("eee", coordList.get(4));
- }
-
- public void testReplaceSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- SimpleListValueModel<String> lvmA = new SimpleListValueModel<String>();
- lvmA.add("xxx");
- lvmA.add("yyy");
- lvmA.add("zzz");
- SimpleListValueModel<String> lvmB = new SimpleListValueModel<String>();
- lvmB.add("ppp");
- lvmB.add("qqq");
- lvmB.add("rrr");
- List<SimpleListValueModel<String>> list = new ArrayList<SimpleListValueModel<String>>();
- list.add(lvmA);
- list.add(lvmB);
- this.uberLVM.set(2, list);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "yyy", "zzz", "ppp", "qqq", "rrr" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("qqq", this.compositeLVM.get(9));
- assertEquals("qqq", coordList.get(9));
- }
-
- public void testMoveSources_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(0, 2, 2);
-
- Object[] expected = new Object[] { "fff", "ggg", "hhh", "iii", "jjj", "kkk", "aaa", "bbb", "ccc", "ddd", "eee" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(1));
- assertEquals("ggg", coordList.get(1));
- }
-
- public void testMoveSources_Middle() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(1, 3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "ddd", "eee", "fff", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testMoveSources_End() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 0, 3);
-
- Object[] expected = new Object[] { "ggg", "hhh", "iii", "jjj", "kkk", "lll", "mmm", "nnn", "ooo", "ppp", "qqq", "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(0));
- assertEquals("ggg", coordList.get(0));
- }
-
- public void testMoveSource() {
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- this.uberLVM.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- this.uberLVM.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.move(3, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "ddd", "eee", "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(14));
- assertEquals("ooo", coordList.get(14));
- }
-
- public void testClearSources() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.clear();
-
- Object[] expected = new Object[0];
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- }
-
- public void testChangeSources() {
- List<SimpleListValueModel<String>> newList = new ArrayList<SimpleListValueModel<String>>();
- SimpleListValueModel<String> lvm4 = new SimpleListValueModel<String>();
- lvm4.add("lll");
- lvm4.add("mmm");
- newList.add(lvm4);
-
- SimpleListValueModel<String> lvm5 = new SimpleListValueModel<String>();
- lvm5.add("nnn");
- lvm5.add("ooo");
- lvm5.add("ppp");
- lvm5.add("qqq");
- newList.add(lvm5);
-
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.uberLVM.setList(newList);
-
- Object[] expected = new Object[] { "lll", "mmm", "nnn", "ooo", "ppp", "qqq" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ooo", this.compositeLVM.get(3));
- assertEquals("ooo", coordList.get(3));
- }
-
- public void testAddItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.add(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.add(1, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testAddItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.add(5, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testAddItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.addAll(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.addAll(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testAddItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.addAll(5, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.remove(0);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(5));
- assertEquals("ggg", coordList.get(5));
- }
-
- public void testRemoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testRemoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.remove(0, 3);
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testRemoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(1, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(7));
- assertEquals("kkk", coordList.get(7));
- }
-
- public void testRemoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.remove(3, 2);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, "xxx");
-
- Object[] expected = new Object[] { "xxx", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm2.set(0, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "xxx", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(4, "xxx");
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "xxx" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.set(0, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testReplaceItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(1, Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "xxx", "yyy", "zzz", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("kkk", this.compositeLVM.get(10));
- assertEquals("kkk", coordList.get(10));
- }
-
- public void testReplaceItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.set(3, Arrays.asList(new String[] { "xxx", "yyy" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "xxx", "yyy" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(2, 0);
-
- Object[] expected = new Object[] { "bbb", "ccc", "aaa", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.move(0, 1);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "eee", "ddd", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItem_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 4);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "kkk", "ggg", "hhh", "iii", "jjj" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testMoveItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.move(1, 0, 2);
-
- Object[] expected = new Object[] { "ccc", "aaa", "bbb", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testMoveItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.add("eee.1");
- this.lvm1.add("eee.2");
- this.lvm1.add("eee.3");
- this.lvm1.move(1, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee.1", "eee.2", "eee.3", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testMoveItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.move(0, 2, 3);
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "iii", "jjj", "kkk", "ggg", "hhh" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(9));
- assertEquals("ggg", coordList.get(9));
- }
-
- public void testClearItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.clear();
-
- Object[] expected = new Object[] { "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(3));
- assertEquals("ggg", coordList.get(3));
- }
-
- public void testClearItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(4));
- assertEquals("ggg", coordList.get(4));
- }
-
- public void testClearItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.clear();
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
- public void testChangeItems_Begin() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm0.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "xxx", "yyy", "zzz", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(6));
- assertEquals("ggg", coordList.get(6));
- }
-
- public void testChangeItems_Middle() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm1.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "xxx", "yyy", "zzz", "fff", "ggg", "hhh", "iii", "jjj", "kkk" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("ggg", this.compositeLVM.get(7));
- assertEquals("ggg", coordList.get(7));
- }
-
- public void testChangeItems_End() {
- CoordinatedList<String> coordList = new CoordinatedList<String>(this.compositeLVM);
-
- this.lvm3.setList(Arrays.asList(new String[] { "xxx", "yyy", "zzz" }));
-
- Object[] expected = new Object[] { "aaa", "bbb", "ccc", "ddd", "eee", "fff", "xxx", "yyy", "zzz" };
- assertEquals(expected.length, this.compositeLVM.size());
- assertEquals(expected.length, coordList.size());
- assertTrue(Arrays.equals(expected, this.compositeLVM.toArray()));
- assertTrue(Arrays.equals(expected, coordList.toArray()));
- assertEquals("fff", this.compositeLVM.get(5));
- assertEquals("fff", coordList.get(5));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
deleted file mode 100644
index e05ec8543c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-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.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * Helper class that keeps an internal collection in synch with the
- * collection held by a collection value model.
- */
-class CoordinatedBag<E> implements Bag<E>, CollectionChangeListener {
-
- private Bag<E> bag = new HashBag<E>();
-
- CoordinatedBag(CollectionValueModel<E> cvm) {
- cvm.addCollectionChangeListener(CollectionValueModel.VALUES, this);
- }
-
-
- // ********** Collection implementation **********
-
- public boolean add(E o) {
- return this.bag.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.bag.addAll(c);
- }
-
- public void clear() {
- this.bag.clear();
- }
-
- public boolean contains(Object o) {
- return this.bag.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.bag.containsAll(c);
- }
-
- public boolean isEmpty() {
- return this.bag.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.bag.iterator();
- }
-
- public boolean remove(Object o) {
- return this.bag.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.bag.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.bag.retainAll(c);
- }
-
- public int size() {
- return this.bag.size();
- }
-
- public Object[] toArray() {
- return this.bag.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.bag.toArray(a);
- }
-
-
- // ********** Bag implementation **********
-
- public int count(Object o) {
- return this.bag.count(o);
- }
-
- public boolean add(E o, int count) {
- return this.bag.add(o, count);
- }
-
- public boolean remove(Object o, int count) {
- return this.bag.remove(o, count);
- }
-
- public Iterator<E> uniqueIterator() {
- return this.bag.uniqueIterator();
- }
-
- // ********** CollectionChangeListener implementation **********
-
- public void itemsAdded(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.add(stream.next());
- }
- }
-
- public void itemsRemoved(CollectionChangeEvent e) {
- for (@SuppressWarnings("unchecked") Iterator<E> stream = (Iterator<E>) e.items(); stream.hasNext(); ) {
- this.bag.remove(stream.next());
- }
- }
-
- public void collectionCleared(CollectionChangeEvent e) {
- this.bag.clear();
- }
-
- @SuppressWarnings("unchecked")
- public void collectionChanged(CollectionChangeEvent e) {
- this.bag.clear();
- CollectionTools.addAll(this.bag, ((CollectionValueModel<E>) e.getSource()).iterator());
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.bag.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.bag.hashCode();
- }
-
- @Override
- public String toString() {
- return this.bag.toString();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
deleted file mode 100644
index df950465d9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Helper class that keeps an internal list in synch with the
- * list held by a list value model.
- */
-public class CoordinatedList<E> implements List<E>, ListChangeListener, ListDataListener {
- private List<E> list = new ArrayList<E>();
-
- public CoordinatedList(ListValueModel<E> listValueModel) {
- listValueModel.addListChangeListener(ListValueModel.LIST_VALUES, this);
- for (Iterator<E> stream = listValueModel.iterator(); stream.hasNext(); ) {
- this.add(stream.next());
- }
- }
-
- public CoordinatedList(ListModel listModel) {
- listModel.addListDataListener(this);
- for (int i = 0; i < listModel.getSize(); i++) {
- this.add(i, this.getElementAt(listModel, i));
- }
- }
-
-
- // ********** List implementation **********
-
- public void add(int index, E element) {
- this.list.add(index, element);
- }
-
- public boolean add(E o) {
- return this.list.add(o);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.list.addAll(c);
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return this.list.addAll(index, c);
- }
-
- public void clear() {
- this.list.clear();
- }
-
- public boolean contains(Object o) {
- return this.list.contains(o);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.list.containsAll(c);
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public int indexOf(Object o) {
- return this.list.indexOf(o);
- }
-
- public boolean isEmpty() {
- return this.list.isEmpty();
- }
-
- public Iterator<E> iterator() {
- return this.list.iterator();
- }
-
- public int lastIndexOf(Object o) {
- return this.list.lastIndexOf(o);
- }
-
- public ListIterator<E> listIterator() {
- return this.list.listIterator();
- }
-
- public ListIterator<E> listIterator(int index) {
- return this.list.listIterator(index);
- }
-
- public E remove(int index) {
- return this.list.remove(index);
- }
-
- public boolean remove(Object o) {
- return this.list.remove(o);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.list.removeAll(c);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.list.retainAll(c);
- }
-
- public E set(int index, E element) {
- return this.list.set(index, element);
- }
-
- public int size() {
- return this.list.size();
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- return this.list.subList(fromIndex, toIndex);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
- public <T> T[] toArray(T[] a) {
- return this.list.toArray(a);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- public void itemsAdded(ListChangeEvent e) {
- int i = e.index();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.add(i++, stream.next());
- }
- }
-
- public void itemsRemoved(ListChangeEvent e) {
- int i = e.index();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- stream.next();
- this.list.remove(i);
- }
- }
-
- public void itemsReplaced(ListChangeEvent e) {
- int i = e.index();
- for (Iterator<E> stream = this.items(e); stream.hasNext(); ) {
- this.list.set(i++, stream.next());
- }
- }
-
- public void itemsMoved(ListChangeEvent e) {
- CollectionTools.move(this.list, e.targetIndex(), e.sourceIndex(), e.moveLength());
- }
-
- public void listCleared(ListChangeEvent e) {
- this.list.clear();
- }
-
- public void listChanged(ListChangeEvent e) {
- this.list.clear();
- CollectionTools.addAll(this.list, this.getSource(e).iterator());
- }
-
-
- // ********** ListDataListener implementation **********
-
- public void contentsChanged(ListDataEvent e) {
- this.list.clear();
- ListModel lm = (ListModel) e.getSource();
- int size = lm.getSize();
- for (int i = 0; i < size; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalAdded(ListDataEvent e) {
- ListModel lm = (ListModel) e.getSource();
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- for (int i = start; i <= end; i++) {
- this.list.add(i, this.getElementAt(lm, i));
- }
- }
-
- public void intervalRemoved(ListDataEvent e) {
- int start = Math.min(e.getIndex0(), e.getIndex1());
- int end = Math.max(e.getIndex0(), e.getIndex1());
- int length = end - start + 1;
- for (int i = 1; i <= length; i++) {
- this.list.remove(start);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public boolean equals(Object o) {
- return this.list.equals(o);
- }
-
- @Override
- public int hashCode() {
- return this.list.hashCode();
- }
-
- @Override
- public String toString() {
- return this.list.toString();
- }
-
-
- // ********** internal methods **********
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private E getElementAt(ListModel listModel, int index) {
- return (E) listModel.getElementAt(index);
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private Iterator<E> items(ListChangeEvent event) {
- return (Iterator<E>) event.items();
- }
-
- /**
- * minimize the scope of the suppressed warnings.=
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<E> getSource(ListChangeEvent event) {
- return (ListValueModel<E>) event.getSource();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
deleted file mode 100644
index 43222db375..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ExtendedListValueModelWrapperTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> extendedListHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
- public ExtendedListValueModelWrapperTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.extendedListHolder = this.buildExtendedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("A");
- result.add("B");
- result.add("C");
- result.add("D");
- return result;
- }
-
- private List<String> buildExtendedList() {
- List<String> extendedList = new ArrayList<String>();
- extendedList.addAll(this.buildPrefix());
- extendedList.addAll(this.buildList());
- extendedList.addAll(this.buildSuffix());
- return extendedList;
- }
-
- private List<String> buildPrefix() {
- List<String> prefix = new ArrayList<String>();
- prefix.add("x");
- prefix.add("y");
- prefix.add("z");
- return prefix;
- }
-
- private List<String> buildSuffix() {
- List<String> suffix = new ArrayList<String>();
- suffix.add("i");
- suffix.add("j");
- return suffix;
- }
-
- private ListValueModel<String> buildExtendedListHolder(ListValueModel<String> lvm) {
- return new ExtendedListValueModelWrapper<String>(this.buildPrefix(), lvm, this.buildSuffix());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList(), CollectionTools.list(this.extendedListHolder.iterator()));
- }
-
- public void testSize() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildExtendedList().size(), CollectionTools.size(this.extendedListHolder.iterator()));
- assertEquals(this.buildExtendedList().size(), this.extendedListHolder.size());
- }
-
- private boolean extendedListContains(Object item) {
- return CollectionTools.contains(this.extendedListHolder.iterator(), item);
- }
-
- private boolean extendedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.extendedListHolder.iterator(), items);
- }
-
- private boolean extendedListContainsAny(Collection<String> items) {
- List<String> extendedList = CollectionTools.list(this.extendedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (extendedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.iterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.iterator(), items);
- }
-
-// private boolean listContainsAny(Collection<String> items) {
-// List<String> extendedList = CollectionTools.list(this.listHolder.iterator());
-// for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
-// if (extendedList.contains(stream.next())) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
- public void testAdd1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains("E"));
- this.listHolder.add(4, "E");
- assertTrue(this.extendedListContains("E"));
- assertTrue(this.listContains("E"));
- }
-
- public void testAdd2() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContains(null));
- this.listHolder.add(4, null);
- assertTrue(this.extendedListContains(null));
- assertTrue(this.listContains(null));
- }
-
- private List<String> buildAddList() {
- List<String> addList = new ArrayList<String>();
- addList.add("E");
- addList.add("F");
- return addList;
- }
-
- public void testAddAll1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.extendedListContainsAny(this.buildAddList()));
- this.listHolder.addAll(4, this.buildAddList());
- assertTrue(this.extendedListContainsAll(this.buildAddList()));
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testRemove1() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.extendedListContains("B"));
- this.listHolder.remove(this.buildList().indexOf("B"));
- assertFalse(this.extendedListContains("B"));
- assertFalse(this.listContains("B"));
- }
-
- public void testListChangeGeneric() {
- this.extendedListHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(4, "E");
- this.verifyEvent(ADD, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(5, null);
- this.verifyEvent(ADD, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(5);
- this.verifyEvent(REMOVE, 8, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(4);
- this.verifyEvent(REMOVE, 7, "E");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "AA");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "A"));
- assertTrue(CollectionTools.contains(this.event.items(), "AA"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = ADD;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REMOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = REPLACE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = MOVE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CLEAR;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- ExtendedListValueModelWrapperTests.this.eventType = CHANGE;
- ExtendedListValueModelWrapperTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.extendedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.listName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- assertEquals(index, this.event.index());
- assertEquals(item, this.event.items().next());
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the extended list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the extended list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener = this.buildListener();
-
- this.extendedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.extendedListHolder.removeListChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
deleted file mode 100644
index eb9e2fc59f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-public class FilteringCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> collectionHolder;
- CollectionChangeEvent addEvent;
- CollectionChangeEvent removeEvent;
- CollectionChangeEvent collectionClearedEvent;
- CollectionChangeEvent collectionChangedEvent;
-
- private CollectionValueModel<String> filteredCollectionHolder;
- CollectionChangeEvent filteredAddEvent;
- CollectionChangeEvent filteredRemoveEvent;
- CollectionChangeEvent filteredCollectionClearedEvent;
- CollectionChangeEvent filteredCollectionChangedEvent;
-
- public FilteringCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new SimpleCollectionValueModel<String>(buildCollection());
- this.filteredCollectionHolder = new FilteringCollectionValueModel<String>(this.collectionHolder, this.buildFilter());
- }
-
- private Collection<String> buildCollection() {
- Collection<String> collection = new Vector<String>();
- collection.add("foo");
- return collection;
- }
-
- private Filter<String> buildFilter() {
- return new Filter<String>() {
- public boolean accept(String s) {
- return s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("bar");
- Iterator<String> collectionHolderValue = this.collectionHolder.iterator();
- assertEquals("foo", collectionHolderValue.next());
- assertEquals("bar", collectionHolderValue.next());
- assertTrue(this.filteredCollectionHolder.iterator().hasNext());
- assertEquals("bar", this.filteredCollectionHolder.iterator().next());
-
- this.collectionHolder.remove("bar");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.remove("foo");
- assertFalse(this.collectionHolder.iterator().hasNext());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
-
- this.collectionHolder.add("foo");
- assertEquals("foo", this.collectionHolder.iterator().next());
- assertFalse(this.filteredCollectionHolder.iterator().hasNext());
- }
-
- public void testSetValue() {
- // add a listener to "activate" the wrapper
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setCollection(newCollection);
-
- Iterator<String> collectionValues = this.collectionHolder.iterator();
- assertEquals("fox", collectionValues.next());
- assertEquals("baz", collectionValues.next());
- Iterator<String> filteredCollectionValues = this.filteredCollectionHolder.iterator();
- assertEquals("baz", filteredCollectionValues.next());
- assertFalse(filteredCollectionValues.hasNext());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- CollectionChangeListener listener = this.buildFilteredListener();
- this.filteredCollectionHolder.addCollectionChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
-
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.filteredCollectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- assertTrue(((AbstractModel) this.collectionHolder).hasNoCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testCollectionChange1() {
- this.collectionHolder.addCollectionChangeListener(this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(this.buildFilteredListener());
- this.verifyCollectionChanges();
- }
-
- public void testCollectionChange2() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildListener());
- this.filteredCollectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
- this.verifyCollectionChanges();
- }
-
- private void clearEvents() {
- this.addEvent = null;
- this.removeEvent = null;
- this.collectionClearedEvent = null;
- this.collectionChangedEvent = null;
- this.filteredAddEvent = null;
- this.filteredRemoveEvent = null;
- this.filteredCollectionClearedEvent = null;
- this.filteredCollectionChangedEvent = null;
- }
-
- private void verifyCollectionChanges() {
- clearEvents();
- this.collectionHolder.add("bar");
- Collection<String> tempCollection = new Vector<String>();
- tempCollection.add("bar");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredAddEvent, this.filteredCollectionHolder, tempCollection);
-
- clearEvents();
- this.collectionHolder.remove("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredRemoveEvent);
-
-
- clearEvents();
- this.collectionHolder.remove("bar");
- tempCollection.add("bar");
- tempCollection.remove("foo");
- this.verifyEvent(this.removeEvent, this.collectionHolder, tempCollection);
- this.verifyEvent(this.filteredRemoveEvent, this.filteredCollectionHolder, tempCollection);
-
-
- clearEvents();
- this.collectionHolder.add("foo");
- tempCollection.remove("bar");
- tempCollection.add("foo");
- this.verifyEvent(this.addEvent, this.collectionHolder, tempCollection);
- assertNull(this.filteredAddEvent);
-
-
- clearEvents();
- Collection<String> newCollection = new Vector<String>();
- newCollection.add("fox");
- newCollection.add("baz");
-
- this.collectionHolder.setCollection(newCollection);
-
- this.verifyEvent(this.collectionChangedEvent, this.collectionHolder, new Vector<String>());
-
- tempCollection.remove("foo");
- tempCollection.add("baz");
- this.verifyEvent(this.filteredCollectionChangedEvent, this.filteredCollectionHolder, new Vector<String>());
-
- }
-
- private CollectionChangeListener buildListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.addEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.removeEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.collectionChangedEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildFilteredListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredAddEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredRemoveEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionClearedEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- FilteringCollectionValueModelTests.this.filteredCollectionChangedEvent = e;
- }
- };
- }
-
- private void verifyEvent(CollectionChangeEvent event, Object source, Object items) {
- assertEquals(source, event.getSource());
- assertEquals(CollectionValueModel.VALUES, event.collectionName());
- assertEquals(items, CollectionTools.vector(event.items()));
- }
-
- public void testRemoveFilteredItem() {
- // build collection with TestItems
- SimpleCollectionValueModel<TestItem> tiHolder = new SimpleCollectionValueModel<TestItem>(this.buildCollection2());
- CollectionValueModel<TestItem> filteredTIHolder = new FilteringCollectionValueModel<TestItem>(tiHolder, this.buildFilter2());
- // add a listener to "activate" the wrapper
- filteredTIHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildFilteredListener());
-
- assertEquals(0, filteredTIHolder.size());
-
- tiHolder.add(new TestItem("bar"));
- assertEquals(1, filteredTIHolder.size());
-
- TestItem baz = new TestItem("baz");
- tiHolder.add(baz);
- assertEquals(2, filteredTIHolder.size());
- // before removing it, change the item so that it is filtered
- baz.name = "jaz";
- tiHolder.remove(baz);
- // this would fail because the item was not removed from
- // the filtered collection cache... but we've fixed it now
- assertEquals(1, filteredTIHolder.size());
- }
-
- private Collection<TestItem> buildCollection2() {
- Collection<TestItem> collection = new Vector<TestItem>();
- collection.add(new TestItem("foo"));
- return collection;
- }
-
- private Filter<TestItem> buildFilter2() {
- return new Filter<TestItem>() {
- public boolean accept(TestItem ti) {
- return ti.name.startsWith("b");
- }
- };
- }
-
-
- // ********** TestItem inner class **********
-
- private class TestItem {
- String name;
- TestItem(String name) {
- super();
- this.name = name;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
deleted file mode 100644
index 5878e0654d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class FilteringPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> filteredObjectHolder;
- PropertyChangeEvent filteredEvent;
-
- public FilteringPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.filteredObjectHolder = new FilteringWritablePropertyValueModel<String>(this.objectHolder, this.buildFilter());
- }
-
- private BidiFilter<String> buildFilter() {
- return new BidiFilter<String>() {
- public boolean accept(String s) {
- return (s != null) && s.startsWith("b");
- }
- public boolean reverseAccept(String s) {
- return (s != null) && s.startsWith("b");
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.value());
- assertNull(this.filteredObjectHolder.value());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.value());
- assertNotNull(this.filteredObjectHolder.value());
- assertEquals("bar", this.filteredObjectHolder.value());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.value());
- assertNotNull(this.filteredObjectHolder.value());
- assertEquals("baz", this.filteredObjectHolder.value());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.value());
- assertNull(this.filteredObjectHolder.value());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.value());
- assertNull(this.filteredObjectHolder.value());
- }
-
- public void testSetValue() {
- this.filteredObjectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.value());
- assertEquals("bar", this.filteredObjectHolder.value());
-
- this.filteredObjectHolder.setValue("foo");
- assertEquals("bar", this.objectHolder.value());
- assertEquals("bar", this.filteredObjectHolder.value());
-
- this.filteredObjectHolder.setValue(null);
- assertEquals("bar", this.objectHolder.value());
- assertEquals("bar", this.filteredObjectHolder.value());
-
- this.filteredObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.value());
- assertEquals("baz", this.filteredObjectHolder.value());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildFilteredListener();
- this.filteredObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.filteredObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.filteredObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildFilteredListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "bar", "baz");
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "foo");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, "baz", null);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("fop");
- this.verifyEvent(this.event, this.objectHolder, "foo", "fop");
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "fop", null);
- assertNull(this.filteredEvent);
-
- this.event = null;
- this.filteredEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.filteredEvent, this.filteredObjectHolder, null, "bar");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildFilteredListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- FilteringPropertyValueModelTests.this.filteredEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- assertEquals(oldValue, e.oldValue());
- assertEquals(newValue, e.newValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
deleted file mode 100644
index 347bbed778..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemCollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemCollectionListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemCollectionListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_COLLECTION));
-
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.jaz.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemCollectionListValueModelAdapter<Junk>(listHolder, Junk.STUFF_COLLECTION));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
deleted file mode 100644
index bfc8169e55..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemListListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemListListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemListListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("foo");
- this.bar = new Junk("bar");
- this.baz = new Junk("baz");
- this.joo = new Junk("joo");
- this.jar = new Junk("jar");
- this.jaz = new Junk("jaz");
-
- this.tom = new Junk("tom");
- this.dick = new Junk("dick");
- this.harry = new Junk("harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(collectionHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
-
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.jaz.hasAnyListChangeListeners(Junk.STUFF_LIST));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemListListValueModelAdapter<Junk>(listHolder, Junk.STUFF_LIST));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.removeStuff("bar");
- this.bar.addStuff("zzz");
- this.bar.addStuff("bar");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.removeStuff("zzz");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
- public void addStuff(String stuffItem) {
- this.stuff.add(stuffItem);
- fireItemAdded(STUFF_LIST, this.stuff.indexOf(stuffItem), stuffItem);
- }
-
- public void removeStuff(String stuffItem) {
- int index = this.stuff.indexOf(stuffItem);
- this.stuff.remove(stuffItem);
- fireItemRemoved(STUFF_LIST, index, stuffItem);
- }
-
- public String displayString() {
- return toString();
- }
-
- public Icon icon() {
- return null;
- }
-
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
deleted file mode 100644
index 3860703216..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemPropertyListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemPropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(collectionHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.setCollection(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- // test concurrent modification exception
- listHolder.setList(this.buildList());
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.compareTo(o1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.setCollection(this.buildCollection());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder, comparator), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.setList(this.buildList());
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
-
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertTrue(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.foo.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.DISPLAY_STRING_PROPERTY));
- assertFalse(this.jaz.hasAnyPropertyChangeListeners(Displayable.ICON_PROPERTY));
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemPropertyListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder), Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemPropertyListValueModelAdapter<Junk>(listHolder, Displayable.DISPLAY_STRING_PROPERTY, Displayable.ICON_PROPERTY));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
-
- // ********** Junk class **********
-
- private class Junk extends AbstractModel implements Displayable {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public String displayString() {
- return this.name;
- }
- public Icon icon() {
- return null;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
deleted file mode 100644
index 66146ded02..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemStateListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ItemStateListValueModelAdapterTests extends TestCase {
- private Junk foo;
- private Junk bar;
- private Junk baz;
- private Junk joo;
- private Junk jar;
- private Junk jaz;
-
- private Junk tom;
- private Junk dick;
- private Junk harry;
-
- public ItemStateListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.foo = new Junk("this.foo");
- this.bar = new Junk("this.bar");
- this.baz = new Junk("this.baz");
- this.joo = new Junk("this.joo");
- this.jar = new Junk("this.jar");
- this.jaz = new Junk("this.jaz");
-
- this.tom = new Junk("this.tom");
- this.dick = new Junk("this.dick");
- this.harry = new Junk("this.harry");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(collectionHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(listHolder);
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.add(6, this.tom);
- listHolder.add(7, this.dick);
- listHolder.add(8, this.harry);
- assertEquals(9, synchList.size());
- this.compare(listValueModel, synchList);
-
- listHolder.remove(8);
- listHolder.remove(0);
- listHolder.remove(4);
- assertEquals(6, synchList.size());
- this.compare(listValueModel, synchList);
- }
-
- private void compare(ListValueModel<Junk> listValueModel, List<Junk> list) {
- assertEquals(listValueModel.size(), list.size());
- for (int i = 0; i < listValueModel.size(); i++) {
- assertEquals(listValueModel.get(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<Junk> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<Junk>() {
- public int compare(Junk o1, Junk o2) {
- return o2.compareTo(o1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<Junk> comparator) {
- SimpleCollectionValueModel<Junk> collectionHolder = this.buildCollectionHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(collectionHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.add(this.tom);
- collectionHolder.add(this.dick);
- collectionHolder.add(this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- collectionHolder.remove(this.foo);
- collectionHolder.remove(this.jar);
- collectionHolder.remove(this.harry);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<Junk> comparator) {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder, comparator));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertEquals(6, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.add(0, this.tom);
- listHolder.add(0, this.dick);
- listHolder.add(0, this.harry);
- assertEquals(9, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listValueModel, synchList, comparator);
- }
-
- private void compareSort(ListValueModel<Junk> listValueModel, List<Junk> list, Comparator<Junk> comparator) {
- SortedSet<Junk> ss = new TreeSet<Junk>(comparator);
- for (int i = 0; i < listValueModel.size(); i++) {
- ss.add(listValueModel.get(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<Junk> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
-
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder));
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
-
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.foo.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- assertTrue(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasListeners(listValueModel);
-
- listValueModel.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.foo.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- assertFalse(this.jaz.hasAnyStateChangeListeners());
- this.verifyHasNoListeners(listValueModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new ItemStateListValueModelAdapter<Junk>(new SortedListValueModelAdapter<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(6, listValueModel.size());
- assertEquals(6, synchList.size());
- }
-
- public void testGet() throws Exception {
- SimpleListValueModel<Junk> listHolder = this.buildListHolder();
- ListValueModel<Junk> listValueModel = new SortedListValueModelAdapter<Junk>(new ItemStateListValueModelAdapter<Junk>(listHolder));
- CoordinatedList<Junk> synchList = new CoordinatedList<Junk>(listValueModel);
- this.verifyHasListeners(listValueModel);
- assertEquals(this.bar, listValueModel.get(0));
- assertEquals(this.bar, synchList.get(0));
- this.bar.setName("zzz");
- assertEquals(this.bar, listValueModel.get(5));
- assertEquals(this.bar, synchList.get(5));
- this.bar.setName("this.bar");
- }
-
- private void verifyHasNoListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void verifyHasListeners(ListValueModel<Junk> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private SimpleCollectionValueModel<Junk> buildCollectionHolder() {
- return new SimpleCollectionValueModel<Junk>(this.buildCollection());
- }
-
- private Collection<Junk> buildCollection() {
- Bag<Junk> bag = new HashBag<Junk>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<Junk> buildListHolder() {
- return new SimpleListValueModel<Junk>(this.buildList());
- }
-
- private List<Junk> buildList() {
- List<Junk> list = new ArrayList<Junk>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Junk> c) {
- c.add(this.foo);
- c.add(this.bar);
- c.add(this.baz);
- c.add(this.joo);
- c.add(this.jar);
- c.add(this.jaz);
- }
-
- // ********** Junk class **********
- private class Junk extends AbstractModel implements Comparable<Junk> {
- private String name;
- public Junk(String name) {
- this.name = name;
- }
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
- public int compareTo(Junk j) {
- return this.name.compareTo(j.name);
- }
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
deleted file mode 100644
index e53070c828..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.tests.internal.model.value.prefs.JptUtilityModelValuePrefsTests;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.JptUtilityModelValueSwingTests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValueTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueTests.class.getPackage().getName());
-
- suite.addTest(JptUtilityModelValuePrefsTests.suite());
- suite.addTest(JptUtilityModelValueSwingTests.suite());
-
- suite.addTestSuite(BufferedWritablePropertyValueModelTests.class);
- suite.addTestSuite(CollectionAspectAdapterTests.class);
- suite.addTestSuite(CollectionListValueModelAdapterTests.class);
- suite.addTestSuite(CollectionPropertyValueModelAdapterTests.class);
- suite.addTestSuite(CompositeCollectionValueModelTests.class);
- suite.addTestSuite(CompositeListValueModelTests.class);
- suite.addTestSuite(ExtendedListValueModelWrapperTests.class);
- suite.addTestSuite(FilteringCollectionValueModelTests.class);
- suite.addTestSuite(FilteringPropertyValueModelTests.class);
- suite.addTestSuite(ItemCollectionListValueModelAdapterTests.class);
- suite.addTestSuite(ItemListListValueModelAdapterTests.class);
- suite.addTestSuite(ItemPropertyListValueModelAdapterTests.class);
- suite.addTestSuite(ItemStateListValueModelAdapterTests.class);
- suite.addTestSuite(ListAspectAdapterTests.class);
- suite.addTestSuite(ListCollectionValueModelAdapterTests.class);
- suite.addTestSuite(ListCuratorTests.class);
- suite.addTestSuite(NullCollectionValueModelTests.class);
- suite.addTestSuite(NullListValueModelTests.class);
- suite.addTestSuite(NullPropertyValueModelTests.class);
- suite.addTestSuite(PropertyAspectAdapterTests.class);
- suite.addTestSuite(PropertyCollectionValueModelAdapterTests.class);
- suite.addTestSuite(PropertyListValueModelAdapterTests.class);
- suite.addTestSuite(StaticCollectionValueModelTests.class);
- suite.addTestSuite(StaticListValueModelTests.class);
- suite.addTestSuite(SimpleCollectionValueModelTests.class);
- suite.addTestSuite(SimpleListValueModelTests.class);
- suite.addTestSuite(SimplePropertyValueModelTests.class);
- suite.addTestSuite(SortedListValueModelAdapterTests.class);
- suite.addTestSuite(StaticValueModelTests.class);
- suite.addTestSuite(TransformationListValueModelAdapterTests.class);
- suite.addTestSuite(TransformationListValueModelAdapterTests.TransformerTests.class);
- suite.addTestSuite(TransformationPropertyValueModelTests.class);
- suite.addTestSuite(TreeAspectAdapterTests.class);
- suite.addTestSuite(ValueCollectionAdapterTests.class);
- suite.addTestSuite(ValueListAdapterTests.class);
- suite.addTestSuite(ValuePropertyAdapterTests.class);
- suite.addTestSuite(ValueStateAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
deleted file mode 100644
index 43ca18743b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private LocalListAspectAdapter aa1;
- private ListChangeEvent event1;
- private ListChangeListener listener1;
-
- private TestSubject subject2;
-
- public ListAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- this.subject1.addNames(this.subject1Names());
- this.subject1.addDescriptions(this.subject1Descriptions());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
- this.subject2.addNames(this.subject2Names());
- this.subject2.addDescriptions(this.subject2Descriptions());
- }
-
- private List<String> subject1Names() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- result.add("bam");
- return result;
- }
-
- private List<String> subject1Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject1 description1");
- result.add("this.subject1 description2");
- return result;
- }
-
- private List<String> subject2Names() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- result.add("jam");
- return result;
- }
-
- private List<String> subject2Descriptions() {
- List<String> result = new ArrayList<String>();
- result.add("this.subject2 description1");
- result.add("this.subject2 description2");
- return result;
- }
-
- private LocalListAspectAdapter buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new LocalListAspectAdapter(subjectHolder);
- }
-
- private ListChangeListener buildValueChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertFalse(this.aa1.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addName("jam");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(this.subject1Names().size(), this.event1.index());
- assertEquals("jam", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.add("jam");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- this.aa1.add(2, "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(2, this.event1.index());
- assertEquals("jaz", this.event1.items().next());
- namesPlus.add(2, "jaz");
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("joo");
- items.add("jar");
- items.add("jaz");
- items.add("jam");
-
- this.event1 = null;
- this.aa1.addAll(2, items);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(5, this.event1.index()); // only the last "add" event will still be there
- assertEquals("jam", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.addAll(2, items);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String removedName = this.subject1.removeName(0); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(0, this.event1.index());
- assertEquals(removedName, this.event1.items().next());
- List<String> namesMinus = this.subject1Names();
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- Object removedItem = this.aa1.remove(0);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(0, this.event1.index());
- assertEquals(removedItem, this.event1.items().next());
- namesMinus.remove(0);
- assertEquals(namesMinus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testDefaultLength() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- List<String> items = new ArrayList<String>();
- items.add("bar");
- items.add("baz");
-
- this.event1 = null;
- this.aa1.remove(1, 2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(1, this.event1.index()); // only the last "remove" event will still be there
- assertEquals("baz", this.event1.items().next());
- List<String> namesPlus = this.subject1Names();
- namesPlus.remove(1);
- namesPlus.remove(1);
- assertEquals(namesPlus, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testReplace() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- String replacedName = this.subject1.setName(0, "jelly"); // should be "foo"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(0, this.event1.index());
- assertEquals("jelly", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().next());
- List<String> namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
-
- this.event1 = null;
- replacedName = this.subject1.setName(1, "roll"); // should be "bar"
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(1, this.event1.index());
- assertEquals("roll", this.event1.items().next());
- assertEquals(replacedName, this.event1.replacedItems().next());
- namesChanged = this.subject1Names();
- namesChanged.set(0, "jelly");
- namesChanged.set(1, "roll");
- assertEquals(namesChanged, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addTwoNames("jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- List<String> namesPlus2 = this.subject1Names();
- namesPlus2.add(0, "jaz");
- namesPlus2.add(0, "jam");
- assertEquals(namesPlus2, CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.names()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.aa1.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getName(0));
- assertEquals(this.subject1Names().get(0), this.aa1.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.names()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.aa1.listIterator()));
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addListChangeListener(listener2);
- assertTrue(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- this.aa1.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyListChangeListeners(TestSubject.NAMES_LIST));
- assertFalse(this.aa1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private List<String> names;
- public static final String NAMES_LIST = "names";
- private List<String> descriptions;
- public static final String DESCRIPTIONS_LIST = "descriptions";
-
- public TestSubject() {
- this.names = new ArrayList<String>();
- this.descriptions = new ArrayList<String>();
- }
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.names.add(index, name);
- this.fireItemAdded(NAMES_LIST, index, name);
- }
- public void addName(String name) {
- this.addName(this.names.size(), name);
- }
- public void addNames(ListIterator<String> newNames) {
- while (newNames.hasNext()) {
- this.addName(newNames.next());
- }
- }
- public void addNames(List<String> newNames) {
- this.addNames(newNames.listIterator());
- }
- public void addTwoNames(String name1, String name2) {
- this.names.add(0, name2);
- this.names.add(0, name1);
- this.fireListChanged(NAMES_LIST);
- }
- public String removeName(int index) {
- String removedName = this.names.remove(index);
- this.fireItemRemoved(NAMES_LIST, index, removedName);
- return removedName;
- }
- public String setName(int index, String name) {
- String replacedName = this.names.set(index, name);
- this.fireItemReplaced(NAMES_LIST, index, name, replacedName);
- return replacedName;
- }
- public ListIterator<String> descriptions() {
- return new ReadOnlyListIterator<String>(this.descriptions);
- }
- public String getDescription(int index) {
- return this.descriptions.get(index);
- }
- public void addDescription(int index, String description) {
- this.descriptions.add(index, description);
- this.fireItemAdded(DESCRIPTIONS_LIST, index, description);
- }
- public void addDescription(String description) {
- this.addDescription(this.descriptions.size(), description);
- }
- public void addDescriptions(ListIterator<String> newDescriptions) {
- while (newDescriptions.hasNext()) {
- this.addDescription(newDescriptions.next());
- }
- }
- public void addDescriptions(List<String> newDescriptions) {
- this.addDescriptions(newDescriptions.listIterator());
- }
- public String removeDescription(int index) {
- String removedDescription = this.descriptions.remove(index);
- this.fireItemRemoved(DESCRIPTIONS_LIST, index, removedDescription);
- return removedDescription;
- }
- public String setDescription(int index, String description) {
- String replacedDescription = this.descriptions.set(index, description);
- this.fireItemReplaced(DESCRIPTIONS_LIST, index, description, replacedDescription);
- return replacedDescription;
- }
- }
-
-
- // this is not a typical aspect adapter - the value is determined by the aspect name
- private class LocalListAspectAdapter extends ListAspectAdapter<TestSubject, String> {
-
- LocalListAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- super(subjectHolder, TestSubject.NAMES_LIST);
- }
-
- @Override
- protected ListIterator<String> listIterator_() {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.names();
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.descriptions();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void add(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- this.subject.addName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- this.subject.addDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public void addAll(int index, List<String> items) {
- for (int i = 0; i < items.size(); i++) {
- this.add(index + i, items.get(i));
- }
- }
-
- public String remove(int index) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.removeName(index);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.removeDescription(index);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
-
- public List<String> remove(int index, int length) {
- List<String> removedItems = new ArrayList<String>(length);
- for (int i = 0; i < length; i++) {
- removedItems.add(this.remove(index));
- }
- return removedItems;
- }
-
- public Object replace(int index, Object item) {
- if (this.listNames[0] == TestSubject.NAMES_LIST) {
- return this.subject.setName(index, (String) item);
- } else if (this.listNames[0] == TestSubject.DESCRIPTIONS_LIST) {
- return this.subject.setDescription(index, (String) item);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.listNames[0]);
- }
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
deleted file mode 100644
index 6ec4c5d711..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-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.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListCollectionValueModelAdapterTests extends TestCase {
- CollectionValueModel<String> adapter;
- private SimpleListValueModel<String> wrappedListHolder;
- private List<String> wrappedList;
-
- public ListCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedList = new ArrayList<String>();
- this.wrappedListHolder = new SimpleListValueModel<String>(this.wrappedList);
- this.adapter = new ListCollectionValueModelAdapter<String>(this.wrappedListHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(this.wrappedList.iterator());
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testStaleValues() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testAdd() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- assertTrue(this.wrappedList.contains("foo"));
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals(6, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testRemove() {
- Bag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- List<String> synchList = new CoordinatedList<String>(this.wrappedListHolder);
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- assertEquals("jaz", this.wrappedListHolder.remove(5));
- assertFalse(this.wrappedList.contains("jaz"));
- assertEquals("foo", this.wrappedListHolder.remove(0));
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals(this.wrappedCollection(), CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection(), synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- this.wrappedListHolder.add(3, "joo");
- this.wrappedListHolder.add(4, "jar");
- this.wrappedListHolder.add(5, "jaz");
- this.wrappedListHolder.remove(5);
- assertFalse(this.wrappedList.contains("jaz"));
- this.wrappedListHolder.remove(0);
- assertFalse(this.wrappedList.contains("foo"));
- assertEquals(4, this.wrappedList.size());
-
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testReplace() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- // override failure
- }
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- // override failure
- }
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {
- assertEquals("foo", e.items().next());
- assertFalse(CollectionTools.contains(ListCollectionValueModelAdapterTests.this.adapter.iterator(), "joo"));
- assertEquals(2, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- @Override
- public void itemsAdded(CollectionChangeEvent e) {
- assertEquals("joo", e.items().next());
- assertEquals(3, ListCollectionValueModelAdapterTests.this.adapter.size());
- }
- });
- this.wrappedListHolder.set(0, "joo");
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(3, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedListHolder.add(0, "foo");
- this.wrappedListHolder.add(1, "bar");
- this.wrappedListHolder.add(2, "baz");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedListHolder.setList(new ArrayList<String>());
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- list.add("foo");
- list.add("bar");
- this.wrappedListHolder.setList(list);
- assertEquals(2, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- ArrayList<String> list = new ArrayList<String>();
- this.wrappedListHolder.setList(list);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** inner class **********
-
- class TestListener implements CollectionChangeListener {
- public void itemsAdded(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- public void collectionChanged(CollectionChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
deleted file mode 100644
index d96ee8ea53..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCurator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public final class ListCuratorTests
- extends TestCase
-{
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
-
- private ListCurator<TestSubject, String> curator;
- private ListChangeListener listener1;
- private ListChangeEvent event1;
-
- private TestSubject subject2;
-
- public ListCuratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject(this.subject1Names());
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.curator = this.buildListCurator(this.subjectHolder1);
- this.listener1 = this.buildListChangeListener1();
- this.curator.addListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject(this.subject2Names());
- }
-
- private List<String> subject1Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("alpha");
- list.add("bravo");
- list.add("charlie");
- list.add("delta");
- return list;
- }
-
- private List<String> subject2Names() {
- ArrayList<String> list = new ArrayList<String>();
- list.add("echo");
- list.add("foxtrot");
- list.add("glove");
- list.add("hotel");
- return list;
- }
-
- private ListCurator<TestSubject, String> buildListCurator(PropertyValueModel<TestSubject> subjectHolder) {
- return new ListCurator<TestSubject, String>(subjectHolder) {
- @Override
- public Iterator<String> iteratorForRecord() {
- return this.subject.strings();
- }
- };
- }
-
- private ListChangeListener buildListChangeListener1() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsRemoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsReplaced(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void itemsMoved(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listCleared(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- public void listChanged(ListChangeEvent e) {
- ListCuratorTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(ListChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject2Names(), CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertFalse(this.curator.iterator().hasNext());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(-1, this.event1.index());
- assertFalse(this.event1.items().hasNext());
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testAdd() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.addString("echo");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(this.subject1Names().size(), this.event1.index());
- assertEquals("echo", this.event1.items().next());
- List<String> stringsPlus = this.subject1Names();
- stringsPlus.add("echo");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
-
- this.event1 = null;
- this.subject1.addString(0, "zulu");
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(0, this.event1.index());
- assertEquals("zulu", this.event1.items().next());
- stringsPlus.add(0, "zulu");
- assertEquals(stringsPlus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testRemove() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- String removedString = this.subject1.removeString(0); // should be "alpha"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(0, this.event1.index());
- assertEquals(removedString, this.event1.items().next());
- List<String> stringsMinus = this.subject1Names();
- stringsMinus.remove(0);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
-
- removedString = this.subject1.removeString(2); // should be "delta"
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(2, this.event1.index());
- assertEquals(removedString, this.event1.items().next());
- stringsMinus.remove(2);
- assertEquals(stringsMinus, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testCompleteListChange() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- assertNull(this.event1);
-
- this.subject1.setStrings(this.subject2Names());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- List<String> newStrings = this.subject2Names();
- assertEquals(newStrings, CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testPartialListChange() {
- List<String> startingList = CollectionTools.list(this.curator.listIterator());
- assertEquals(this.subject1Names(), startingList);
- assertNull(this.event1);
-
- String identicalString = startingList.get(1); // should be "bravo"
- String nonidenticalString = startingList.get(0); // should be "alpha"
- List<String> newStrings = CollectionTools.list(new String[] {new String("bravo"), new String("alpha"), "echo", "delta", "foxtrot"});
- this.subject1.setStrings(newStrings);
-
- List<String> finalList = CollectionTools.list(this.curator.listIterator());
- assertNotNull(this.event1);
- assertEquals(this.curator, this.event1.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event1.listName());
- assertEquals(newStrings, finalList);
- assertTrue(identicalString == finalList.get(0));
- assertTrue(nonidenticalString != finalList.get(1));
- }
-
- public void testIterator() {
- assertEquals(this.subject1Names(), CollectionTools.list(this.subject1.strings()));
- assertEquals(this.subject1Names(), CollectionTools.list(this.curator.listIterator()));
- }
-
- public void testGet() {
- assertEquals(this.subject1Names().get(0), this.subject1.getString(0));
- assertEquals(this.subject1Names().get(0), this.curator.get(0));
- }
-
- public void testSize() {
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.subject1.strings()));
- assertEquals(this.subject1Names().size(), CollectionTools.size(this.curator.listIterator()));
- assertEquals(this.subject1Names().size(), this.curator.size());
- }
-
- public void testHasListeners() {
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(ListValueModel.LIST_VALUES, this.listener1);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener2 = this.buildListChangeListener1();
- this.curator.addListChangeListener(listener2);
- assertTrue(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(this.subject1.hasAnyStateChangeListeners());
- this.curator.removeListChangeListener(listener2);
- assertFalse(this.subject1.hasAnyStateChangeListeners());
- assertFalse(this.curator.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- // **************** Inner Class *******************************************
-
- class TestSubject extends AbstractModel {
- private List<String> strings;
-
- public TestSubject() {
- this.strings = new ArrayList<String>();
- }
-
- public TestSubject(List<String> strings) {
- this();
- this.setStrings(strings);
- }
-
- public String getString(int index) {
- return this.strings.get(index);
- }
-
- public ListIterator<String> strings() {
- return new ReadOnlyListIterator<String>(this.strings);
- }
-
- public void addString(int index, String string) {
- this.strings.add(index, string);
- this.fireStateChanged();
- }
-
- public void addString(String string) {
- this.addString(this.strings.size(), string);
- }
-
- public String removeString(int index) {
- String string = this.strings.get(index);
- this.removeString(string);
- return string;
- }
-
- public void removeString(String string) {
- this.strings.remove(string);
- this.fireStateChanged();
- }
-
- public void setStrings(List<String> strings) {
- this.strings = new ArrayList<String>(strings);
- this.fireStateChanged();
- }
-
- public void setStrings(String[] strings) {
- this.strings = CollectionTools.list(strings);
- this.fireStateChanged();
- }
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java
deleted file mode 100644
index 3fefeb9437..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullCollectionValueModelTests extends TestCase {
- private CollectionValueModel<Object> collectionHolder;
-
- public NullCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = new NullCollectionValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSize() {
- assertEquals(0, this.collectionHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.collectionHolder.iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java
deleted file mode 100644
index b4fed3568b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullListValueModelTests extends TestCase {
- private ListValueModel<Object> listHolder;
-
- public NullListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new NullListValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- boolean exCaught = false;
- try {
- this.listHolder.get(0);
- } catch (IndexOutOfBoundsException ex) {
- exCaught = true;
- }
- assertTrue(exCaught);
- }
-
- public void testSize() {
- assertEquals(0, this.listHolder.size());
- }
-
- public void testIterator() {
- assertFalse(this.listHolder.iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java
deleted file mode 100644
index 0691c1b1f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.NullPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NullPropertyValueModelTests extends TestCase {
- private PropertyValueModel<Object> valueHolder;
-
- public NullPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new NullPropertyValueModel<Object>();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertNull(this.valueHolder.value());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
deleted file mode 100644
index 141db5f524..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private PropertyAspectAdapter<TestSubject, String> aa1;
- private PropertyChangeEvent event1;
- private PropertyChangeListener listener1;
-
- private TestSubject subject2;
-
- private PropertyChangeEvent multipleValueEvent;
-
- private PropertyChangeEvent customValueEvent;
-
-
- public PropertyAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject("foo", "test subject 1");
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject> (this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject("bar", "test subject 2");
- }
-
- private PropertyAspectAdapter<TestSubject, String> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- // this is not a aspect adapter - the value is determined by the aspect name
- @Override
- protected String buildValue_() {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- return this.subject.getName();
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- return this.subject.getDescription();
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- @Override
- protected void setValue_(String value) {
- if (this.propertyNames[0] == TestSubject.NAME_PROPERTY) {
- this.subject.setName(value);
- } else if (this.propertyNames[0] == TestSubject.DESCRIPTION_PROPERTY) {
- this.subject.setDescription(value);
- } else {
- throw new IllegalStateException("invalid aspect name: " + this.propertyNames[0]);
- }
- }
- };
- }
-
- private PropertyChangeListener buildValueChangeListener1() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(PropertyChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertEquals("foo", this.aa1.value());
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals("foo", this.event1.oldValue());
- assertEquals("bar", this.event1.newValue());
- assertEquals("bar", this.aa1.value());
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals("bar", this.event1.oldValue());
- assertNull(this.event1.newValue());
- assertNull(this.aa1.value());
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals(null, this.event1.oldValue());
- assertEquals("foo", this.event1.newValue());
- assertEquals("foo", this.aa1.value());
- }
-
- public void testPropertyChange() {
- assertEquals("foo", this.aa1.value());
- assertNull(this.event1);
-
- this.subject1.setName("baz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals("foo", this.event1.oldValue());
- assertEquals("baz", this.event1.newValue());
- assertEquals("baz", this.aa1.value());
-
- this.event1 = null;
- this.subject1.setName(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals("baz", this.event1.oldValue());
- assertEquals(null, this.event1.newValue());
- assertEquals(null, this.aa1.value());
-
- this.event1 = null;
- this.subject1.setName("foo");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event1.propertyName());
- assertEquals(null, this.event1.oldValue());
- assertEquals("foo", this.event1.newValue());
- assertEquals("foo", this.aa1.value());
- }
-
- public void testValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.value());
- }
-
- public void testStaleValue() {
- assertEquals("foo", this.subject1.getName());
- assertEquals("foo", this.aa1.value());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals(null, this.aa1.value());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("foo", this.aa1.value());
-
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- this.subjectHolder1.setValue(this.subject2);
- assertEquals(null, this.aa1.value());
-
- this.aa1.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertEquals("bar", this.aa1.value());
- }
-
- public void testSetValue() {
- this.aa1.setValue("baz");
- assertEquals("baz", this.aa1.value());
- assertEquals("baz", this.subject1.getName());
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener1);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addPropertyChangeListener(listener2);
- assertTrue(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- this.aa1.removePropertyChangeListener(listener2);
- assertFalse(this.subject1.hasAnyPropertyChangeListeners(TestSubject.NAME_PROPERTY));
- assertFalse(this.aa1.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testMultipleAspectAdapter() {
- TestSubject testSubject = new TestSubject("fred", "husband");
- WritablePropertyValueModel<TestSubject> testSubjectHolder = new SimplePropertyValueModel<TestSubject>(testSubject);
- WritablePropertyValueModel<String> testAA = this.buildMultipleAspectAdapter(testSubjectHolder);
- PropertyChangeListener testListener = this.buildMultipleValueChangeListener();
- testAA.addPropertyChangeListener(PropertyValueModel.VALUE, testListener);
- assertEquals("fred:husband", testAA.value());
-
- this.multipleValueEvent = null;
- testSubject.setName("wilma");
- assertEquals("wilma:husband", testAA.value());
- assertEquals("fred:husband", this.multipleValueEvent.oldValue());
- assertEquals("wilma:husband", this.multipleValueEvent.newValue());
-
- this.multipleValueEvent = null;
- testSubject.setDescription("wife");
- assertEquals("wilma:wife", testAA.value());
- assertEquals("wilma:husband", this.multipleValueEvent.oldValue());
- assertEquals("wilma:wife", this.multipleValueEvent.newValue());
- }
-
- private WritablePropertyValueModel<String> buildMultipleAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY, TestSubject.DESCRIPTION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName() + ":" + this.subject.getDescription();
- }
- };
- }
-
- private PropertyChangeListener buildMultipleValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.multipleValueChanged(e);
- }
- };
- }
-
- void multipleValueChanged(PropertyChangeEvent e) {
- this.multipleValueEvent = e;
- }
-
- /**
- * test a bug where we would call #buildValue() in
- * #engageNonNullSubject(), when we needed to call
- * it in #engageSubject(), so the cached value would
- * be rebuilt when the this.subject was set to null
- */
- public void testCustomBuildValueWithNullSubject() {
- TestSubject customSubject = new TestSubject("fred", "laborer");
- WritablePropertyValueModel<TestSubject> customSubjectHolder = new SimplePropertyValueModel<TestSubject>(customSubject);
- WritablePropertyValueModel<String> customAA = this.buildCustomAspectAdapter(customSubjectHolder);
- PropertyChangeListener customListener = this.buildCustomValueChangeListener();
- customAA.addPropertyChangeListener(PropertyValueModel.VALUE, customListener);
- assertEquals("fred", customAA.value());
-
- this.customValueEvent = null;
- customSubject.setName("wilma");
- assertEquals("wilma", customAA.value());
- assertEquals("fred", this.customValueEvent.oldValue());
- assertEquals("wilma", this.customValueEvent.newValue());
-
- this.customValueEvent = null;
- customSubjectHolder.setValue(null);
- // this would fail - the value would be null...
- assertEquals("<unnamed>", customAA.value());
- assertEquals("wilma", this.customValueEvent.oldValue());
- assertEquals("<unnamed>", this.customValueEvent.newValue());
- }
-
- private WritablePropertyValueModel<String> buildCustomAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new PropertyAspectAdapter<TestSubject, String>(subjectHolder, TestSubject.NAME_PROPERTY) {
- @Override
- protected String buildValue() {
- return (this.subject == null) ? "<unnamed>" : this.subject.getName();
- }
- };
- }
-
- private PropertyChangeListener buildCustomValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- PropertyAspectAdapterTests.this.customValueChanged(e);
- }
- };
- }
-
- void customValueChanged(PropertyChangeEvent e) {
- this.customValueEvent = e;
- }
-
-
- // ********** inner class **********
-
- private class TestSubject extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private String description;
- public static final String DESCRIPTION_PROPERTY = "description";
-
- public TestSubject(String name, String description) {
- this.name = name;
- this.description = description;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- public String getDescription() {
- return this.description;
- }
- public void setDescription(String description) {
- Object old = this.description;
- this.description = description;
- this.firePropertyChanged(DESCRIPTION_PROPERTY, old, description);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
deleted file mode 100644
index 27b3047f6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyCollectionValueModelAdapterTests extends TestCase {
- private CollectionValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyCollectionValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyCollectionValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedCollection() {
- return CollectionTools.collection(new SingleElementIterator<String>(this.wrappedValueHolder.value()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testStaleValue() {
- CollectionChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- };
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- Collection<String> adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
-
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(0, adapterCollection.size());
- assertEquals(new HashBag<String>(), adapterCollection);
-
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, listener);
- adapterCollection = CollectionTools.collection(this.adapter.iterator());
- assertEquals(1, adapterCollection.size());
- assertEquals(this.wrappedCollection(), adapterCollection);
- assertEquals("foo", adapterCollection.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- CoordinatedBag<String> synchCollection = new CoordinatedBag<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(CollectionValueModel.VALUES, synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.addCollectionChangeListener(synchCollection);
- assertTrue(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- this.adapter.removeCollectionChangeListener(synchCollection);
- assertFalse(((AbstractModel) this.adapter).hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(CollectionChangeEvent e) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener() {
- @Override
- public void itemsAdded(CollectionChangeEvent e) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testCollectionChangedFromEmptyToEmpty() {
- this.adapter.addCollectionChangeListener(CollectionValueModel.VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements CollectionChangeListener {
- public void collectionChanged(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void collectionCleared(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(CollectionChangeEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
deleted file mode 100644
index d35c653732..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JList;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PropertyListValueModelAdapterTests extends TestCase {
- private ListValueModel<String> adapter;
- private WritablePropertyValueModel<String> wrappedValueHolder;
-
- public PropertyListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedValueHolder = new SimplePropertyValueModel<String>();
- this.adapter = new PropertyListValueModelAdapter<String>(this.wrappedValueHolder);
- }
-
- private Collection<String> wrappedList() {
- return CollectionTools.list(new SingleElementIterator<String>(this.wrappedValueHolder.value()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- assertFalse(this.adapter.iterator().hasNext());
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testGetInt() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- assertEquals("foo", this.adapter.get(0));
- }
-
- public void testToArray1() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- this.wrappedValueHolder.setValue("foo");
- Object[] array = this.adapter.toArray();
- assertEquals("foo", array[0]);
- assertEquals(1, array.length);
- }
-
- public void testToArray2() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- Object[] array = this.adapter.toArray();
- assertEquals(0, array.length);
- }
-
- public void testStaleValue() {
- ListChangeListener listener = new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- };
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- this.wrappedValueHolder.setValue("foo");
- List<String> adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
-
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(0, adapterList.size());
- assertEquals(new ArrayList<String>(), adapterList);
-
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- adapterList = CollectionTools.list(this.adapter.iterator());
- assertEquals(1, adapterList.size());
- assertEquals(this.wrappedList(), adapterList);
- assertEquals("foo", adapterList.iterator().next());
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- public void testListChangedToEmpty() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsRemoved(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
- public void testListChangedFromEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsAdded(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue("foo");
- assertEquals(1, jList.getModel().getSize());
- }
-
- public void testListItemChanged() {
- this.wrappedValueHolder.setValue("foo");
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener() {
- @Override
- public void itemsReplaced(ListChangeEvent event) {/* OK */}
- });
- JList jList = new JList(new ListModelAdapter(this.adapter));
- assertEquals(1, jList.getModel().getSize());
- assertEquals("foo", jList.getModel().getElementAt(0));
-
- this.wrappedValueHolder.setValue("bar");
- assertEquals(1, jList.getModel().getSize());
- assertEquals("bar", jList.getModel().getElementAt(0));
- }
-
- public void testListChangedFromEmptyToEmpty() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListener());
- JList jList = new JList(new ListModelAdapter(this.adapter));
-
- this.wrappedValueHolder.setValue(null);
- assertEquals(0, jList.getModel().getSize());
- }
-
-
- // ********** member class **********
-
- static class TestListener implements ListChangeListener {
- public void listChanged(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsAdded(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent event) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent event) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
deleted file mode 100644
index 272926933f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-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.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimpleCollectionValueModelTests extends TestCase {
- private SimpleCollectionValueModel<String> bagHolder;
- CollectionChangeEvent bagEvent;
- String bagEventType;
-
- private SimpleCollectionValueModel<String> setHolder;
- CollectionChangeEvent setEvent;
- String setEventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String CHANGE = "change";
- private static final String CLEAR = "clear";
-
-
- public SimpleCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.bagHolder = new SimpleCollectionValueModel<String>(this.buildBag());
- this.setHolder = new SimpleCollectionValueModel<String>(this.buildSet());
- }
-
- private Bag<String> buildBag() {
- Bag<String> result = new HashBag<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private Set<String> buildSet() {
- Set<String> result = new HashSet<String>();
- this.addItemsTo(result);
- return result;
- }
-
- private void addItemsTo(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- }
-
- private Bag<String> buildAddItems() {
- Bag<String> result = new HashBag<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private Bag<String> buildRemoveItems() {
- Bag<String> result = new HashBag<String>();
- result.add("foo");
- result.add("baz");
- return result;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagHolder.iterator()));
- assertEquals(this.buildSet(), CollectionTools.set(this.setHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(this.buildBag().size(), CollectionTools.size(this.bagHolder.iterator()));
- assertEquals(this.buildSet().size(), CollectionTools.size(this.setHolder.iterator()));
- }
-
- private boolean bagHolderContains(Object item) {
- return CollectionTools.contains(this.bagHolder.iterator(), item);
- }
-
- private boolean setHolderContains(Object item) {
- return CollectionTools.contains(this.setHolder.iterator(), item);
- }
-
- private boolean bagHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.bagHolder.iterator(), items);
- }
-
- private boolean setHolderContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.setHolder.iterator(), items);
- }
-
- private boolean bagHolderContainsAny(Collection<String> items) {
- Bag<String> bag = CollectionTools.bag(this.bagHolder.iterator());
- for (String string : items) {
- if (bag.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean setHolderContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.setHolder.iterator());
- for (String string : items) {
- if (set.contains(string)) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- assertFalse(this.bagHolderContains("joo"));
- this.bagHolder.add("joo");
- assertTrue(this.bagHolderContains("joo"));
-
- assertFalse(this.bagHolderContains(null));
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
-
- assertFalse(this.setHolderContains("joo"));
- this.setHolder.add("joo");
- assertTrue(this.setHolderContains("joo"));
-
- assertFalse(this.setHolderContains(null));
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- }
-
- public void testAddAll() {
- assertFalse(this.bagHolderContainsAny(this.buildAddItems()));
- this.bagHolder.addAll(this.buildAddItems());
- assertTrue(this.bagHolderContainsAll(this.buildAddItems()));
-
- assertFalse(this.setHolderContainsAny(this.buildAddItems()));
- this.setHolder.addAll(this.buildAddItems());
- assertTrue(this.setHolderContainsAll(this.buildAddItems()));
- }
-
- public void testRemove() {
- assertTrue(this.bagHolderContains("bar"));
- this.bagHolder.remove("bar");
- assertFalse(this.bagHolderContains("bar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- assertTrue(this.setHolderContains("bar"));
- this.setHolder.remove("bar");
- assertFalse(this.setHolderContains("bar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
- }
-
- public void testRemoveAll() {
- assertTrue(this.bagHolderContainsAll(this.buildRemoveItems()));
- this.bagHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.bagHolderContainsAny(this.buildRemoveItems()));
-
- assertTrue(this.setHolderContainsAll(this.buildRemoveItems()));
- this.setHolder.removeAll(this.buildRemoveItems());
- assertFalse(this.setHolderContainsAny(this.buildRemoveItems()));
- }
-
- public void testSetCollection() {
- assertTrue(this.bagHolderContains("bar"));
- assertFalse(this.bagHolderContains("jar"));
- this.bagHolder.setCollection(this.buildAddItems());
- assertFalse(this.bagHolderContains("bar"));
- assertTrue(this.bagHolderContains("jar"));
-
- this.bagHolder.add(null);
- assertTrue(this.bagHolderContains(null));
- this.bagHolder.remove(null);
- assertFalse(this.bagHolderContains(null));
-
- this.bagHolder.setCollection(new HashBag<String>());
- assertFalse(this.bagHolderContains("jar"));
-
- assertTrue(this.setHolderContains("bar"));
- assertFalse(this.setHolderContains("jar"));
- this.setHolder.setCollection(this.buildAddItems());
- assertFalse(this.setHolderContains("bar"));
- assertTrue(this.setHolderContains("jar"));
-
- this.setHolder.add(null);
- assertTrue(this.setHolderContains(null));
- this.setHolder.remove(null);
- assertFalse(this.setHolderContains(null));
-
- this.setHolder.setCollection(new HashBag<String>());
- assertFalse(this.setHolderContains("jar"));
- }
-
- public void testCollectionChange1() {
- this.bagHolder.addCollectionChangeListener(this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(this.buildSetListener());
- this.verifySetChange();
- }
-
- public void testCollectionChange2() {
- this.bagHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildBagListener());
- this.verifyBagChange();
-
- this.setHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.buildSetListener());
- this.verifySetChange();
- }
-
- private void verifyBagChange() {
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("foo");
- this.verifyBagEvent(ADD, "foo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add("joo");
- this.verifyBagEvent(ADD, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.add(null);
- this.verifyBagEvent(ADD, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove("joo");
- this.verifyBagEvent(REMOVE, "joo");
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.remove(null);
- this.verifyBagEvent(REMOVE, null);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.setCollection(this.buildBag());
- this.verifyBagEvent(CHANGE);
-
- this.bagEvent = null;
- this.bagEventType = null;
- this.bagHolder.addAll(this.buildBag());
- this.verifyBagEvent(ADD);
- assertEquals(this.buildBag(), CollectionTools.bag(this.bagEvent.items()));
- }
-
- private void verifySetChange() {
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("foo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- this.verifySetEvent(ADD, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- this.verifySetEvent(ADD, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.add(null);
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- this.verifySetEvent(REMOVE, "joo");
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove("joo");
- assertNull(this.setEvent);
- assertNull(this.setEventType);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.remove(null);
- this.verifySetEvent(REMOVE, null);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.setCollection(this.buildSet());
- this.verifySetEvent(CHANGE);
-
- this.setEvent = null;
- this.setEventType = null;
- this.setHolder.addAll(this.buildSet());
- assertNull(this.setEvent);
- assertNull(this.setEventType);
- }
-
- private CollectionChangeListener buildBagListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = ADD;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = REMOVE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CLEAR;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.bagEventType = CHANGE;
- SimpleCollectionValueModelTests.this.bagEvent = e;
- }
- };
- }
-
- private CollectionChangeListener buildSetListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = ADD;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = REMOVE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void collectionCleared(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CLEAR;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- public void collectionChanged(CollectionChangeEvent e) {
- SimpleCollectionValueModelTests.this.setEventType = CHANGE;
- SimpleCollectionValueModelTests.this.setEvent = e;
- }
- };
- }
-
- private void verifyBagEvent(String eventType) {
- assertEquals(eventType, this.bagEventType);
- assertEquals(this.bagHolder, this.bagEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.bagEvent.collectionName());
- }
-
- private void verifyBagEvent(String eventType, Object item) {
- this.verifyBagEvent(eventType);
- assertEquals(item, this.bagEvent.items().next());
- }
-
- private void verifySetEvent(String eventType) {
- assertEquals(eventType, this.setEventType);
- assertEquals(this.setHolder, this.setEvent.getSource());
- assertEquals(CollectionValueModel.VALUES, this.setEvent.collectionName());
- }
-
- private void verifySetEvent(String eventType, Object item) {
- this.verifySetEvent(eventType);
- assertEquals(item, this.setEvent.items().next());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
deleted file mode 100644
index 9686e1e5cd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimpleListValueModelTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public SimpleListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.iterator()));
- }
-
- public void testListIterator() {
- assertEquals(this.buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testListIteratorInt() {
- assertEquals(CollectionTools.list(this.buildList().listIterator(1)), CollectionTools.list(this.listHolder.listIterator(1)));
- }
-
- public void testSize() {
- assertEquals(this.buildList().size(), this.listHolder.size());
- }
-
- private boolean listContains(Object item) {
- return CollectionTools.contains(this.listHolder.listIterator(), item);
- }
-
- private boolean listContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.listHolder.listIterator(), items);
- }
-
- private boolean listContainsAny(Collection<String> items) {
- Set<String> set = CollectionTools.set(this.listHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (set.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAddObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add("joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddIntObject() {
- assertFalse(this.listContains("joo"));
- this.listHolder.add(2, "joo");
- assertTrue(this.listContains("joo"));
-
- assertFalse(this.listContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.listContains(null));
- }
-
- public void testAddAllCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testAddAllIntCollection() {
- assertFalse(this.listContainsAny(this.buildAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.listContainsAll(this.buildAddList()));
- }
-
- public void testClear() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testContainsObject() {
- assertTrue(this.listHolder.contains("foo"));
- assertFalse(this.listHolder.contains("joo"));
- }
-
- public void testContainsAllCollection() {
- Collection<String> c = new ArrayList<String>();
- c.add("foo");
- c.add("bar");
- assertTrue(this.listHolder.containsAll(c));
-
- c.add("joo");
- assertFalse(this.listHolder.containsAll(c));
- }
-
- public void testEquals() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()), this.listHolder);
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>(this.buildAddList())));
- assertFalse(this.listHolder.equals(this.buildList()));
- assertFalse(this.listHolder.equals(new SimpleListValueModel<String>()));
- }
-
- public void testGetInt() {
- assertEquals("foo", this.listHolder.get(0));
- assertEquals("bar", this.listHolder.get(1));
- assertEquals("baz", this.listHolder.get(2));
- }
-
- public void testHashCode() {
- assertEquals(new SimpleListValueModel<String>(this.buildList()).hashCode(), this.listHolder.hashCode());
- }
-
- public void testIndexOfObject() {
- assertEquals(0, this.listHolder.indexOf("foo"));
- assertEquals(1, this.listHolder.indexOf("bar"));
- assertEquals(2, this.listHolder.indexOf("baz"));
- assertEquals(-1, this.listHolder.indexOf("joo"));
- }
-
- public void testLastIndexOfObject() {
- assertEquals(0, this.listHolder.lastIndexOf("foo"));
- assertEquals(1, this.listHolder.lastIndexOf("bar"));
- assertEquals(2, this.listHolder.lastIndexOf("baz"));
- assertEquals(-1, this.listHolder.lastIndexOf("joo"));
-
- this.listHolder.add("foo");
- assertEquals(3, this.listHolder.lastIndexOf("foo"));
- }
-
- public void testIsEmpty() {
- assertFalse(this.listHolder.isEmpty());
- this.listHolder.clear();
- assertTrue(this.listHolder.isEmpty());
- }
-
- public void testRemove() {
- assertTrue(this.listContains("bar"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.listContains("bar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
- }
-
- public void testSetValues() {
- List<String> newList = new ArrayList<String>();
- newList.add("joo");
- newList.add("jar");
- newList.add("jaz");
-
- assertTrue(this.listContains("bar"));
- assertFalse(this.listContains("jar"));
- this.listHolder.setList(newList);
- assertFalse(this.listContains("bar"));
- assertTrue(this.listContains("jar"));
-
- this.listHolder.add(1, null);
- assertTrue(this.listContains(null));
- this.listHolder.remove(1);
- assertFalse(this.listContains(null));
-
- this.listHolder.setList(new ArrayList<String>());
- assertFalse(this.listContains("jar"));
- }
-
- public void testListChange1() {
- this.listHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChange2() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "joo");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.setList(this.buildList());
- this.verifyEvent(CHANGE);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "foo"));
- assertTrue(CollectionTools.contains(this.event.items(), "joo"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = ADD;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REMOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = REPLACE;
- SimpleListValueModelTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = MOVE;
- SimpleListValueModelTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CLEAR;
- SimpleListValueModelTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- SimpleListValueModelTests.this.eventType = CHANGE;
- SimpleListValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String e) {
- assertEquals(e, this.eventType);
- assertEquals(this.listHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.listName());
- }
-
- private void verifyEvent(String e, int index, Object item) {
- this.verifyEvent(e);
- assertEquals(index, this.event.index());
- assertEquals(item, this.event.items().next());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
deleted file mode 100644
index 10e475cacc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SimplePropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
-
- public SimplePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.value());
- }
-
- public void testSetValue() {
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.value());
- this.objectHolder.setValue(null);
- assertEquals(null, this.objectHolder.value());
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.value());
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.verifyPropertyChange();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.verifyPropertyChange();
- }
-
- private void verifyPropertyChange() {
- this.event = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent("foo", "bar");
-
- this.event = null;
- this.objectHolder.setValue(null);
- this.verifyEvent("bar", null);
-
- this.event = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(null, "baz");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SimplePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- assertEquals(this.objectHolder, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.propertyName());
- assertEquals(oldValue, this.event.oldValue());
- assertEquals(newValue, this.event.newValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
deleted file mode 100644
index d867d2275f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.TreeSet;
-
-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.ReverseComparator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SortedListValueModelAdapterTests extends TestCase {
- private SortedListValueModelAdapter<String> adapter;
- private SimpleCollectionValueModel<String> wrappedCollectionHolder;
- private Collection<String> wrappedCollection;
-
-
- public SortedListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.wrappedCollection = new HashBag<String>();
- this.wrappedCollectionHolder = new SimpleCollectionValueModel<String>(this.wrappedCollection);
- this.adapter = new SortedListValueModelAdapter<String>(this.wrappedCollectionHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual) {
- this.verifyList(expected, actual, null);
- }
-
- private void verifyList(Collection<String> expected, ListValueModel<String> actual, Comparator<String> comparator) {
- Collection<String> sortedSet = new TreeSet<String>(comparator);
- sortedSet.addAll(expected);
- List<String> expectedList = new ArrayList<String>(sortedSet);
- List<String> actualList = CollectionTools.list(actual.iterator());
- assertEquals(expectedList, actualList);
- }
-
- public void testAdd() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- assertEquals(3, this.adapter.size());
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testAddItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testRemoveItem() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testListSynch() {
- this.adapter.addListChangeListener(ListValueModel.LIST_VALUES, new TestListChangeListener() {
- @Override
- public void itemsAdded(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsRemoved(ListChangeEvent e) {/* OK */}
- @Override
- public void itemsReplaced(ListChangeEvent e) {/* OK */}
- });
- this.wrappedCollectionHolder.add("foo");
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- this.wrappedCollectionHolder.remove("jaz");
- assertFalse(this.wrappedCollection.contains("jaz"));
- this.wrappedCollectionHolder.remove("foo");
- assertFalse(this.wrappedCollection.contains("foo"));
- assertEquals(4, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- }
-
- public void testSetComparator() {
- List<String> synchList = new CoordinatedList<String>(this.adapter);
- Bag<String> synchCollection = new CoordinatedBag<String>(this.wrappedCollectionHolder);
- this.wrappedCollectionHolder.add("foo");
- assertTrue(this.wrappedCollection.contains("foo"));
- this.wrappedCollectionHolder.add("bar");
- this.wrappedCollectionHolder.add("baz");
- this.wrappedCollectionHolder.add("joo");
- this.wrappedCollectionHolder.add("jar");
- this.wrappedCollectionHolder.add("jaz");
- assertEquals(6, this.wrappedCollection.size());
-
- this.verifyList(this.wrappedCollection, this.adapter);
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
-
- this.adapter.setComparator(new ReverseComparator<String>());
- this.verifyList(this.wrappedCollection, this.adapter, new ReverseComparator<String>());
- assertEquals(this.wrappedCollection, CollectionTools.collection(synchList.iterator()));
- assertEquals(this.wrappedCollection, synchCollection);
- }
-
- public void testHasListeners() {
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- CoordinatedList<String> synchList = new CoordinatedList<String>(this.adapter);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(ListValueModel.LIST_VALUES, synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.addListChangeListener(synchList);
- assertTrue(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.adapter.removeListChangeListener(synchList);
- assertFalse(((AbstractModel) this.adapter).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- class TestListChangeListener implements ListChangeListener {
- public void itemsAdded(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsRemoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsReplaced(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void itemsMoved(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listCleared(ListChangeEvent e) {
- fail("unexpected event");
- }
- public void listChanged(ListChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
deleted file mode 100644
index b2839e2299..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticCollectionValueModelTests extends TestCase {
-
- private static final Collection<String> COLLECTION = buildCollection();
- private static Collection<String> buildCollection() {
- Collection<String> result = new HashBag<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private CollectionValueModel<String> collectionHolder;
-
-
- public StaticCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.collectionHolder = this.buildCollectionHolder();
- }
-
- private CollectionValueModel<String> buildCollectionHolder() {
- return new StaticCollectionValueModel<String>(COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- assertEquals(buildCollection(), CollectionTools.bag(this.collectionHolder.iterator()));
- }
-
- public void testSize() {
- assertEquals(buildCollection().size(), this.collectionHolder.size());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
deleted file mode 100644
index 65dd9ef176..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticListValueModelTests extends TestCase {
-
- private static final List<String> LIST = buildList();
- private static List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- return result;
- }
-
- private ListValueModel<String> listHolder;
-
-
- public StaticListValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new StaticListValueModel<String>(LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGet() {
- List<String> expected = buildList();
- for (int i = 0; i < this.listHolder.size(); i++) {
- assertEquals(expected.get(i), this.listHolder.get(i));
- }
- }
-
- public void testIterator() {
- assertEquals(buildList(), CollectionTools.list(this.listHolder.listIterator()));
- }
-
- public void testSize() {
- assertEquals(buildList().size(), this.listHolder.size());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
deleted file mode 100644
index 4af69d9a3e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class StaticValueModelTests extends TestCase {
- private PropertyValueModel<String> objectHolder;
- private static final PropertyValueModel<String> OBJECT_HOLDER = new StaticPropertyValueModel<String>("foo");
-
-
- public StaticValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = OBJECT_HOLDER;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.value());
- }
-
- public void testToString() {
- assertTrue(this.objectHolder.toString().indexOf("foo") >= 0);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
deleted file mode 100644
index d52bc22578..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class TransformationListValueModelAdapterTests extends TestCase {
- private SimpleListValueModel<String> listHolder;
- private ListValueModel<String> transformedListHolder;
- ListChangeEvent event;
- String eventType;
-
- private static final String ADD = "add";
- private static final String REMOVE = "remove";
- private static final String REPLACE = "replace";
- private static final String MOVE = "move";
- private static final String CLEAR = "clear";
- private static final String CHANGE = "change";
-
-
- public TransformationListValueModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listHolder = new SimpleListValueModel<String>(this.buildList());
- this.transformedListHolder = this.buildTransformedListHolder(this.listHolder);
- }
-
- private List<String> buildList() {
- List<String> result = new ArrayList<String>();
- result.add("foo");
- result.add("bar");
- result.add("baz");
- return result;
- }
-
- private List<String> buildTransformedList() {
- return this.transform(this.buildList());
- }
-
- private List<String> transform(List<String> list) {
- List<String> result = new ArrayList<String>(list.size());
- for (String string : list) {
- if (string == null) {
- result.add(null);
- } else {
- result.add(string.toUpperCase());
- }
- }
- return result;
- }
-
- private List<String> buildAddList() {
- List<String> result = new ArrayList<String>();
- result.add("joo");
- result.add("jar");
- result.add("jaz");
- return result;
- }
-
- private List<String> buildTransformedAddList() {
- return this.transform(this.buildAddList());
- }
-
-// private List<String> buildRemoveList() {
-// List<String> result = new ArrayList<String>();
-// result.add("foo");
-// result.add("bar");
-// return result;
-// }
-//
-// private List<String> buildTransformedRemoveList() {
-// return this.transform(this.buildRemoveList());
-// }
-//
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModelAdapter<String, String>(lvm) {
- @Override
- protected String transformItem(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testIterator() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testStaleValues() {
- ListChangeListener listener = this.buildListener();
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.transformedListHolder.iterator()));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertEquals(Collections.EMPTY_LIST, CollectionTools.list(this.transformedListHolder.iterator()));
- }
-
- public void testSize() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- assertEquals(this.buildTransformedList().size(), CollectionTools.size(this.transformedListHolder.iterator()));
- }
-
- private boolean transformedListContains(Object item) {
- return CollectionTools.contains(this.transformedListHolder.iterator(), item);
- }
-
- private boolean transformedListContainsAll(Collection<String> items) {
- return CollectionTools.containsAll(this.transformedListHolder.iterator(), items);
- }
-
- private boolean transformedListContainsAny(Collection<String> items) {
- List<String> transformedList = CollectionTools.list(this.transformedListHolder.iterator());
- for (Iterator<String> stream = items.iterator(); stream.hasNext(); ) {
- if (transformedList.contains(stream.next())) {
- return true;
- }
- }
- return false;
- }
-
- public void testAdd() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContains("JOO"));
- this.listHolder.add(2, "joo");
- assertTrue(this.transformedListContains("JOO"));
-
- assertFalse(this.transformedListContains(null));
- this.listHolder.add(0, null);
- assertTrue(this.transformedListContains(null));
- }
-
- public void testAddAll() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertFalse(this.transformedListContainsAny(this.buildTransformedAddList()));
- this.listHolder.addAll(2, this.buildAddList());
- assertTrue(this.transformedListContainsAll(this.buildTransformedAddList()));
- }
-
- public void testRemove() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
-
- assertTrue(this.transformedListContains("BAR"));
- this.listHolder.remove(this.buildList().indexOf("bar"));
- assertFalse(this.transformedListContains("BAR"));
-
- this.listHolder.add(1, null);
- assertTrue(this.transformedListContains(null));
- this.listHolder.remove(1);
- assertFalse(this.transformedListContains(null));
- }
-
- public void testListChangeGeneric() {
- this.transformedListHolder.addListChangeListener(this.buildListener());
- this.verifyListChange();
- }
-
- public void testListChangeNamed() {
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.buildListener());
- this.verifyListChange();
- }
-
- private void verifyListChange() {
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, "joo");
- this.verifyEvent(ADD, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.add(1, null);
- this.verifyEvent(ADD, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, null);
-
- this.event = null;
- this.eventType = null;
- this.listHolder.remove(1);
- this.verifyEvent(REMOVE, 1, "JOO");
-
- this.event = null;
- this.eventType = null;
- this.listHolder.addAll(0, this.buildList());
- this.verifyEvent(ADD);
- assertEquals(this.buildTransformedList(), CollectionTools.list(this.event.items()));
-
- this.event = null;
- this.eventType = null;
- this.listHolder.set(0, "joo");
- this.verifyEvent(REPLACE);
- assertFalse(CollectionTools.contains(this.event.items(), "FOO"));
- assertTrue(CollectionTools.contains(this.event.items(), "JOO"));
- }
-
- private ListChangeListener buildListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = ADD;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsRemoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REMOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsReplaced(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REPLACE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void itemsMoved(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = MOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void listCleared(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CLEAR;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- public void listChanged(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CHANGE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- };
- }
-
- private void verifyEvent(String type) {
- assertEquals(type, this.eventType);
- assertEquals(this.transformedListHolder, this.event.getSource());
- assertEquals(ListValueModel.LIST_VALUES, this.event.listName());
- }
-
- private void verifyEvent(String type, int index, Object item) {
- this.verifyEvent(type);
- assertEquals(index, this.event.index());
- assertEquals(item, this.event.items().next());
- }
-
- public void testHasListeners() {
- /*
- * adding listeners to the transformed list will cause listeners
- * to be added to the wrapped list;
- * likewise, removing listeners from the transformed list will
- * cause listeners to be removed from the wrapped list
- */
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListChangeListener listener = this.buildListener();
-
- this.transformedListHolder.addListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(ListValueModel.LIST_VALUES, listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.addListChangeListener(listener);
- assertTrue(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- this.transformedListHolder.removeListChangeListener(listener);
- assertFalse(((AbstractModel) this.listHolder).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
-
- /**
- * execute the same set of tests again, but by passing a Transformer to the adapter
- * (as opposed to overriding #transformItem(Object))
- */
- public static class TransformerTests extends TransformationListValueModelAdapterTests {
- public TransformerTests(String name) {
- super(name);
- }
- @Override
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModelAdapter<String, String>(lvm, this.buildTransformer());
- }
- private Transformer<String, String> buildTransformer() {
- return new Transformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- };
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
deleted file mode 100644
index a098b6db30..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class TransformationPropertyValueModelTests extends TestCase {
- private WritablePropertyValueModel<String> objectHolder;
- PropertyChangeEvent event;
-
- private WritablePropertyValueModel<String> transformationObjectHolder;
- PropertyChangeEvent transformationEvent;
-
- public TransformationPropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.objectHolder = new SimplePropertyValueModel<String>("foo");
- this.transformationObjectHolder = new TransformationWritablePropertyValueModel<String, String>(this.objectHolder, this.buildTransformer());
- }
-
- private BidiTransformer<String, String> buildTransformer() {
- return new BidiTransformer<String, String>() {
- public String transform(String s) {
- return (s == null) ? null : s.toUpperCase();
- }
- public String reverseTransform(String s) {
- return (s == null) ? null : s.toLowerCase();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testValue() {
- assertEquals("foo", this.objectHolder.value());
- assertEquals("FOO", this.transformationObjectHolder.value());
-
- this.objectHolder.setValue("bar");
- assertEquals("bar", this.objectHolder.value());
- assertEquals("BAR", this.transformationObjectHolder.value());
-
- this.objectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.value());
- assertEquals("BAZ", this.transformationObjectHolder.value());
-
- this.objectHolder.setValue(null);
- assertNull(this.objectHolder.value());
- assertNull(this.transformationObjectHolder.value());
-
- this.objectHolder.setValue("foo");
- assertEquals("foo", this.objectHolder.value());
- assertEquals("FOO", this.transformationObjectHolder.value());
- }
-
- public void testSetValue() {
- this.transformationObjectHolder.setValue("BAR");
- assertEquals("bar", this.objectHolder.value());
- assertEquals("BAR", this.transformationObjectHolder.value());
-
- this.transformationObjectHolder.setValue("Foo");
- assertEquals("foo", this.objectHolder.value());
- assertEquals("FOO", this.transformationObjectHolder.value());
-
- this.transformationObjectHolder.setValue(null);
- assertNull(this.objectHolder.value());
- assertNull(this.transformationObjectHolder.value());
-
- this.transformationObjectHolder.setValue("baz");
- assertEquals("baz", this.objectHolder.value());
- assertEquals("BAZ", this.transformationObjectHolder.value());
- }
-
- public void testLazyListening() {
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- PropertyChangeListener listener = this.buildTransformationListener();
- this.transformationObjectHolder.addPropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.transformationObjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, listener);
- assertTrue(((AbstractModel) this.objectHolder).hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testPropertyChange1() {
- this.objectHolder.addPropertyChangeListener(this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- public void testPropertyChange2() {
- this.objectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildListener());
- this.transformationObjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildTransformationListener());
- this.verifyPropertyChanges();
- }
-
- private void verifyPropertyChanges() {
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, "foo", "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", "BAR");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("baz");
- this.verifyEvent(this.event, this.objectHolder, "bar", "baz");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAR", "BAZ");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("Foo");
- this.verifyEvent(this.event, this.objectHolder, "baz", "Foo");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "BAZ", "FOO");
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("FOO");
- this.verifyEvent(this.event, this.objectHolder, "Foo", "FOO");
- assertNull(this.transformationEvent);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue(null);
- this.verifyEvent(this.event, this.objectHolder, "FOO", null);
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, "FOO", null);
-
- this.event = null;
- this.transformationEvent = null;
- this.objectHolder.setValue("bar");
- this.verifyEvent(this.event, this.objectHolder, null, "bar");
- this.verifyEvent(this.transformationEvent, this.transformationObjectHolder, null, "BAR");
- }
-
- private PropertyChangeListener buildListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildTransformationListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TransformationPropertyValueModelTests.this.transformationEvent = e;
- }
- };
- }
-
- private void verifyEvent(PropertyChangeEvent e, Object source, Object oldValue, Object newValue) {
- assertEquals(source, e.getSource());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- assertEquals(oldValue, e.oldValue());
- assertEquals(newValue, e.newValue());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
deleted file mode 100644
index 58dd200cd0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TreeAspectAdapter;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class TreeAspectAdapterTests extends TestCase {
- private TestSubject subject1;
- private WritablePropertyValueModel<TestSubject> subjectHolder1;
- private TreeAspectAdapter<TestSubject, TestNode[]> aa1;
- private TreeChangeEvent event1;
- private TreeChangeListener listener1;
-
- private TestSubject subject2;
-
-
- public TreeAspectAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject1 = new TestSubject();
- TestNode root, node;
-
- root = this.subject1.getRootNameNode();
- node = this.subject1.addName(root, "name 1.1");
- this.subject1.addName(node, "name 1.1.1");
- this.subject1.addName(node, "name 1.1.2");
- node = this.subject1.addName(root, "name 1.2");
- this.subject1.addName(node, "name 1.2.1");
- node = this.subject1.addName(root, "name 1.3");
-
- root = this.subject1.getRootDescriptionNode();
- node = this.subject1.addDescription(root, "description 1.1");
- this.subject1.addDescription(node, "description 1.1.1");
- this.subject1.addDescription(node, "description 1.1.2");
- node = this.subject1.addDescription(root, "description 1.2");
- this.subject1.addDescription(node, "description 1.2.1");
- node = this.subject1.addDescription(root, "description 1.3");
-
- this.subjectHolder1 = new SimplePropertyValueModel<TestSubject>(this.subject1);
- this.aa1 = this.buildAspectAdapter(this.subjectHolder1);
- this.listener1 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(TreeValueModel.NODES, this.listener1);
- this.event1 = null;
-
- this.subject2 = new TestSubject();
-
- root = this.subject2.getRootNameNode();
- node = this.subject2.addName(root, "name 2.1");
- this.subject2.addName(node, "name 2.1.1");
- this.subject2.addName(node, "name 2.1.2");
- node = this.subject2.addName(root, "name 2.2");
- this.subject2.addName(node, "name 2.2.1");
- node = this.subject2.addName(root, "name 2.3");
-
- root = this.subject2.getRootDescriptionNode();
- node = this.subject2.addDescription(root, "description 2.1");
- this.subject2.addDescription(node, "description 2.1.1");
- this.subject2.addDescription(node, "description 2.1.2");
- node = this.subject2.addDescription(root, "description 2.2");
- this.subject2.addDescription(node, "description 2.2.1");
- node = this.subject2.addDescription(root, "description 2.3");
- }
-
- private TreeAspectAdapter<TestSubject, TestNode[]> buildAspectAdapter(PropertyValueModel<TestSubject> subjectHolder) {
- return new TreeAspectAdapter<TestSubject, TestNode[]>(subjectHolder, TestSubject.NAMES_TREE) {
- // this is not a typical aspect adapter - the value is determined by the aspect name
- @Override
- protected Iterator<TestNode[]> nodes_() {
- if (this.treeNames[0] == TestSubject.NAMES_TREE) {
- return this.subject.namePaths();
- }
- if (this.treeNames[0] == TestSubject.DESCRIPTIONS_TREE) {
- return this.subject.descriptionPaths();
- }
- throw new IllegalStateException("invalid aspect name: " + this.treeNames[0]);
- }
- };
- }
-
- private TreeChangeListener buildValueChangeListener1() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void nodeRemoved(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeCleared(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- public void treeChanged(TreeChangeEvent e) {
- TreeAspectAdapterTests.this.value1Changed(e);
- }
- };
- }
-
- void value1Changed(TreeChangeEvent e) {
- this.event1 = e;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSubjectHolder() {
- assertNull(this.event1);
-
- this.subjectHolder1.setValue(this.subject2);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.treeName());
- assertEquals(0, this.event1.path().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(null);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.treeName());
- assertEquals(0, this.event1.path().length);
-
- this.event1 = null;
- this.subjectHolder1.setValue(this.subject1);
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.treeName());
- assertEquals(0, this.event1.path().length);
- }
-
- public void testTreeStructureChange() {
- assertNull(this.event1);
-
- this.subject1.addTwoNames(this.subject1.getRootNameNode(), "jam", "jaz");
- assertNotNull(this.event1);
- assertEquals(this.aa1, this.event1.getSource());
- assertEquals(TreeValueModel.NODES, this.event1.treeName());
- Object[] path = this.event1.path();
- assertEquals(this.subject1.getRootNameNode(), path[path.length - 1]);
- assertTrue(this.subject1.containsNameNode("jam"));
- assertTrue(this.subject1.containsNameNode("jaz"));
- }
-
- public void testNodes() {
- assertEquals(this.convertToNames(this.subject1.namePaths()), this.convertToNames(this.aa1.nodes()));
- }
-
- private Collection<String> convertToNames(Iterator<TestNode[]> namePaths) {
- Collection<String> result = new HashBag<String>();
- while (namePaths.hasNext()) {
- Object[] path = namePaths.next();
- StringBuffer sb = new StringBuffer();
- sb.append('[');
- for (int i = 0; i < path.length; i++) {
- sb.append(((TestNode) path[i]).getText());
- if (i < path.length - 1) {
- sb.append(':');
- }
- }
- sb.append(']');
- result.add(sb.toString());
- }
- return result;
- }
-
- public void testHasListeners() {
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(TreeValueModel.NODES, this.listener1);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
-
- TreeChangeListener listener2 = this.buildValueChangeListener1();
- this.aa1.addTreeChangeListener(listener2);
- assertTrue(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- assertTrue(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- this.aa1.removeTreeChangeListener(listener2);
- assertFalse(this.subject1.hasAnyTreeChangeListeners(TestSubject.NAMES_TREE));
- assertFalse(this.aa1.hasAnyTreeChangeListeners(TreeValueModel.NODES));
- }
-
- // ********** inner classes **********
-
- private class TestSubject extends AbstractModel {
- private TestNode rootNameNode;
- public static final String NAMES_TREE = "names";
- private TestNode rootDescriptionNode;
- public static final String DESCRIPTIONS_TREE = "descriptions";
-
- public TestSubject() {
- this.rootNameNode = new TestNode("root name");
- this.rootDescriptionNode = new TestNode("root description");
- }
- public TestNode getRootNameNode() {
- return this.rootNameNode;
- }
- public Iterator<TestNode> nameNodes() {
- return new TreeIterator<TestNode>(this.rootNameNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<TestNode[]> namePaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.nameNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addName(TestNode parent, String name) {
- TestNode child = new TestNode(name);
- parent.addChild(child);
- this.fireNodeAdded(NAMES_TREE, child.path());
- return child;
- }
- public void addTwoNames(TestNode parent, String name1, String name2) {
- parent.addChild(new TestNode(name1));
- parent.addChild(new TestNode(name2));
- this.fireTreeChanged(NAMES_TREE, parent.path());
- }
- public void removeNameNode(TestNode nameNode) {
- nameNode.getParent().removeChild(nameNode);
- this.fireNodeRemoved(NAMES_TREE, nameNode.path());
- }
- public boolean containsNameNode(String name) {
- return this.nameNode(name) != null;
- }
- public TestNode nameNode(String name) {
- for (Iterator<TestNode> stream = this.nameNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return node;
- }
- }
- return null;
- }
- public TestNode getRootDescriptionNode() {
- return this.rootDescriptionNode;
- }
- public Iterator<TestNode> descriptionNodes() {
- return new TreeIterator<TestNode>(this.rootDescriptionNode) {
- @Override
- public Iterator<TestNode> children(TestNode next) {
- return next.children();
- }
- };
- }
- public Iterator<TestNode[]> descriptionPaths() {
- return new TransformationIterator<TestNode, TestNode[]>(this.descriptionNodes()) {
- @Override
- protected TestNode[] transform(TestNode next) {
- return next.path();
- }
- };
- }
- public TestNode addDescription(TestNode parent, String description) {
- TestNode child = new TestNode(description);
- parent.addChild(child);
- this.fireNodeAdded(DESCRIPTIONS_TREE, child.path());
- return child;
- }
- public void removeDescriptionNode(TestNode descriptionNode) {
- descriptionNode.getParent().removeChild(descriptionNode);
- this.fireNodeRemoved(DESCRIPTIONS_TREE, descriptionNode.path());
- }
- public boolean containsDescriptionNode(String name) {
- for (Iterator<TestNode> stream = this.descriptionNodes(); stream.hasNext(); ) {
- TestNode node = stream.next();
- if (node.getText().equals(name)) {
- return true;
- }
- }
- return false;
- }
- }
-
- private class TestNode {
- private final String text;
- private TestNode parent;
- private final Collection<TestNode> children;
-
- public TestNode(String text) {
- this.text = text;
- this.children = new HashBag<TestNode>();
- }
- public String getText() {
- return this.text;
- }
- public TestNode getParent() {
- return this.parent;
- }
- private void setParent(TestNode parent) {
- this.parent = parent;
- }
- public Iterator<TestNode> children() {
- return new ReadOnlyIterator<TestNode>(this.children);
- }
- public void addChild(TestNode child) {
- this.children.add(child);
- child.setParent(this);
- }
- public void removeChild(TestNode child) {
- this.children.remove(child);
- }
- public TestNode[] path() {
- return CollectionTools.reverseList(this.buildAntiPath()).toArray(new TestNode[0]);
- }
- private Iterator<TestNode> buildAntiPath() {
- return new ChainIterator<TestNode>(this) {
- @Override
- protected TestNode nextLink(TestNode currentLink) {
- return currentLink.getParent();
- }
- };
- }
- @Override
- public String toString() {
- return "TestNode(" + this.text + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
deleted file mode 100644
index a4901771c5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueCollectionAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueCollectionAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueCollectionAdapter<Junk> junkHolder2;
-
-
- public ValueCollectionAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueCollectionAdapter<Junk>(this.junkHolder, Junk.STUFF_COLLECTION);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyCollectionChangeListeners(Junk.STUFF_COLLECTION));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testCollectionAdd() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testCollectionRemove() {
- LocalListener l = new LocalListener(this.junkHolder2);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.aspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
-
- private class Junk extends AbstractModel {
- private Collection<String> stuff;
- public static final String STUFF_COLLECTION = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromCollection(stuffItem, this.stuff, STUFF_COLLECTION);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
deleted file mode 100644
index 4eb13a52ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueListAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueListAdapter<Junk> junkHolder2;
-
-
-
- public ValueListAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueListAdapter<Junk>(this.junkHolder, Junk.STUFF_LIST);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyListChangeListeners(Junk.STUFF_LIST));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testListAdd() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.addStuff("bar");
- assertTrue(l.eventReceived());
- }
-
- public void testListRemove() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.removeStuff("foo");
- assertTrue(l.eventReceived());
- }
-
- public void testListReplace() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.replaceStuff("foo", "bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.aspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private List<String> stuff;
- public static final String STUFF_LIST = "stuff";
-
- public Junk(String stuffItem) {
- this.stuff = new ArrayList<String>();
- this.stuff.add(stuffItem);
- }
-
- public void addStuff(String stuffItem) {
- this.addItemToList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void removeStuff(String stuffItem) {
- this.removeItemFromList(stuffItem, this.stuff, STUFF_LIST);
- }
-
- public void replaceStuff(String oldStuffItem, String newStuffItem) {
- this.replaceItemInList(oldStuffItem, newStuffItem, this.stuff, STUFF_LIST);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.stuff + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
deleted file mode 100644
index ab40631db4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValuePropertyAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValuePropertyAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValuePropertyAdapter<Junk> junkHolder2;
-
-
- public ValuePropertyAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValuePropertyAdapter<Junk>(this.junkHolder, Junk.NAME_PROPERTY);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyPropertyChangeListeners(Junk.NAME_PROPERTY));
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeProperty() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.aspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
deleted file mode 100644
index ea38edc622..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueStateAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ValueStateAdapterTests extends TestCase {
- private Junk junk;
- private SimplePropertyValueModel<Junk> junkHolder;
- private ValueStateAdapter<Junk> junkHolder2;
-
-
- public ValueStateAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.junk = new Junk("foo");
- this.junkHolder = new SimplePropertyValueModel<Junk>(this.junk);
- this.junkHolder2 = new ValueStateAdapter<Junk>(this.junkHolder);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testWrappedPVM() {
- Junk junk2 = new Junk("bar");
- LocalListener l = new LocalListener(this.junkHolder2, this.junk, junk2);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder.setValue(junk2);
- assertTrue(l.eventReceived());
- }
-
- public void testHasPropertyChangeListeners() throws Exception {
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- assertTrue(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- this.junkHolder2.removePropertyChangeListener(l);
- assertFalse(this.junkHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertFalse(this.junkHolder2.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testHasStateChangeListeners() throws Exception {
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
-
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addStateChangeListener(l);
- assertTrue(this.junk.hasAnyStateChangeListeners());
- assertTrue(this.junkHolder2.hasAnyStateChangeListeners());
-
- this.junkHolder2.removeStateChangeListener(l);
- assertFalse(this.junk.hasAnyStateChangeListeners());
- assertFalse(this.junkHolder2.hasAnyStateChangeListeners());
- }
-
- public void testChangeState() {
- LocalListener l = new LocalListener(this.junkHolder2, null, this.junk);
- this.junkHolder2.addPropertyChangeListener(l);
- this.junkHolder2.addStateChangeListener(l);
- this.junk.setName("bar");
- assertTrue(l.eventReceived());
- }
-
-
- private class LocalListener implements PropertyChangeListener, StateChangeListener {
- private boolean eventReceived = false;
- private final Object source;
- private final Object oldValue;
- private final Object newValue;
- LocalListener(Object source) {
- this(source, null, null);
- }
- LocalListener(Object source, Object oldValue, Object newValue) {
- super();
- this.source = source;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
- public void propertyChanged(PropertyChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertEquals(this.oldValue, e.oldValue());
- assertEquals(this.newValue, e.newValue());
- assertEquals(PropertyValueModel.VALUE, e.propertyName());
- }
- public void stateChanged(StateChangeEvent e) {
- this.eventReceived = true;
- assertEquals(this.source, e.getSource());
- assertNull(e.aspectName());
- }
- boolean eventReceived() {
- return this.eventReceived;
- }
- }
-
- private class Junk extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public Junk(String name) {
- this.name = name;
- }
-
- public void setName(String name) {
- this.name = name;
- this.fireStateChanged();
- }
-
- @Override
- public String toString() {
- return "Junk(" + this.name + ")";
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
deleted file mode 100644
index 043da07fbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
+++ /dev/null
@@ -1,31 +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.utility.tests.internal.model.value.prefs;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValuePrefsTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValuePrefsTests.class.getPackage().getName());
-
- suite.addTestSuite(PreferencesCollectionValueModelTests.class);
- suite.addTestSuite(PreferencePropertyValueModelTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValuePrefsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
deleted file mode 100644
index 562a376373..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-public class PreferencePropertyValueModelTests extends PreferencesTestCase {
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencePropertyValueModel<String> preferenceAdapter;
- PropertyChangeEvent event;
- PropertyChangeListener listener;
- boolean listenerRemoved = false;
- PreferenceChangeEvent preferenceEvent;
- private static final String KEY_NAME = "foo";
- private static final String STRING_VALUE = "original string value";
-
- public PreferencePropertyValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testNode.put(KEY_NAME, STRING_VALUE);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.listener = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.event = null;
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- private PropertyChangeListener buildValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if (PreferencePropertyValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencePropertyValueModelTests.this.event = e;
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- assertNull(this.event);
-
- String ANOTHER_STRING_VALUE = "some other value";
- Preferences anotherNode = this.classNode.node("another test node");
- anotherNode.put(KEY_NAME, ANOTHER_STRING_VALUE);
-
- this.nodeHolder.setValue(anotherNode);
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.value());
-
- this.event = null;
- this.nodeHolder.setValue(null);
- this.verifyEvent(ANOTHER_STRING_VALUE, null);
- assertNull(this.preferenceAdapter.value());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testPreferenceChange() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- assertNull(this.event);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE, STRING_VALUE + STRING_VALUE);
- assertEquals(STRING_VALUE + STRING_VALUE, this.preferenceAdapter.value());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(STRING_VALUE + STRING_VALUE, null);
- assertNull(this.preferenceAdapter.value());
-
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testValue() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testSetValue() throws Exception {
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
- assertEquals(ANOTHER_STRING_VALUE, this.preferenceAdapter.value());
- assertEquals(ANOTHER_STRING_VALUE, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyChangeListener listener2 = this.buildValueChangeListener();
- this.preferenceAdapter.addPropertyChangeListener(listener2);
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferenceAdapter.removePropertyChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- public void testRemoveAndReAddPreference() throws Exception {
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, null);
- assertNull(this.preferenceAdapter.value());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(null, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testDefaultValue() throws Exception {
- // rebuild the adapter with a default value
- String DEFAULT_VALUE = "default value";
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new PreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME, DEFAULT_VALUE);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- assertNull(this.event);
-
- // remove the preference entirely...
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.testNode.get(KEY_NAME, null));
- this.verifyEvent(STRING_VALUE, DEFAULT_VALUE);
- assertEquals(DEFAULT_VALUE, this.preferenceAdapter.value());
-
- // ...then re-add it with the same key
- this.event = null;
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertEquals(STRING_VALUE, this.testNode.get(KEY_NAME, null));
- this.verifyEvent(DEFAULT_VALUE, STRING_VALUE);
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testUnsynchronizedValue() throws Exception {
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- assertNull(this.event);
-
- // remove the this.listener so the adapter no longer listens to the preference
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.put(KEY_NAME, STRING_VALUE + STRING_VALUE);
- this.waitForEventQueueToClear();
- // no this.event should have been fired...
- assertNull(this.event);
- // ...and the adapter's value should be null
- assertNull(this.preferenceAdapter.value());
-
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.value());
-
- this.testNode.put(KEY_NAME, STRING_VALUE);
- this.waitForEventQueueToClear();
- assertNull(this.event);
- assertNull(this.preferenceAdapter.value());
-
- // add the this.listener so the adapter synchs
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(STRING_VALUE, this.preferenceAdapter.value());
- }
-
- public void testIntegerPreference() throws Exception {
- // stop listening to the node and convert it to an integer
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- PreferencePropertyValueModel<Integer> integerPreferenceAdapter = new PreferencePropertyValueModel<Integer>(this.nodeHolder, KEY_NAME);
- this.testNode.putInt(KEY_NAME, 123);
- integerPreferenceAdapter = PreferencePropertyValueModel.forInteger(this.testNode, KEY_NAME, 0);
- integerPreferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- assertEquals(new Integer(123), integerPreferenceAdapter.value());
- assertNull(this.event);
-
- this.testNode.putInt(KEY_NAME, 246);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(123), new Integer(246));
- assertEquals(new Integer(246), integerPreferenceAdapter.value());
-
- this.event = null;
- this.testNode.remove(KEY_NAME);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(246), new Integer(0));
- assertEquals(new Integer(0), integerPreferenceAdapter.value());
-
- this.event = null;
- this.testNode.putInt(KEY_NAME, 123);
- this.waitForEventQueueToClear();
- this.verifyEvent(integerPreferenceAdapter, new Integer(0), new Integer(123));
- assertEquals(new Integer(123), integerPreferenceAdapter.value());
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferenceAdapter.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertTrue(this.preferenceAdapter.hasNoPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencePropertyValueModelTests.this.testNode) {
- PreferencePropertyValueModelTests.this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, PreferencePropertyValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencePropertyValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testSetSameValue() {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - nothing should happen...
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- assertNull(this.preferenceEvent);
- }
-
- public void testSetSameValueForcePassThrough() throws Exception {
- assertNull(this.event);
- assertNull(this.preferenceEvent);
-
- this.preferenceAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
- this.preferenceAdapter = new AlwaysUpdatePreferencePropertyValueModel<String>(this.nodeHolder, KEY_NAME);
- this.preferenceAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.listener);
-
- this.testNode.addPreferenceChangeListener(this.buildPreferenceChangeListener());
-
- String ANOTHER_STRING_VALUE = "some other value";
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- this.verifyEvent(STRING_VALUE, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
-
- // now set to *same* value - only one this.event should fire
- this.event = null;
- this.preferenceEvent = null;
- this.preferenceAdapter.setValue(ANOTHER_STRING_VALUE);
-
- assertNull(this.event);
- this.waitForEventQueueToClear();
- this.verifyPreferenceEvent(ANOTHER_STRING_VALUE);
- assertNull(this.event);
- }
-
- private PreferenceChangeListener buildPreferenceChangeListener() {
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent evt) {
- PreferencePropertyValueModelTests.this.preferenceEvent = evt;
- }
- };
- }
-
- private void verifyEvent(Model source, Object oldValue, Object newValue) {
- assertNotNull(this.event);
- assertEquals(source, this.event.getSource());
- assertEquals(PropertyValueModel.VALUE, this.event.propertyName());
- assertEquals(oldValue, this.event.oldValue());
- assertEquals(newValue, this.event.newValue());
- }
-
- private void verifyEvent(Object oldValue, Object newValue) {
- this.verifyEvent(this.preferenceAdapter, oldValue, newValue);
- }
-
- private void verifyPreferenceEvent(Object newValue) {
- assertNotNull(this.preferenceEvent);
- assertEquals(this.testNode, this.preferenceEvent.getSource());
- assertEquals(KEY_NAME, this.preferenceEvent.getKey());
- assertEquals(newValue, this.preferenceEvent.getNewValue());
- assertEquals(newValue, this.testNode.get(KEY_NAME, "<missing preference>"));
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ClassTools.fieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-
- /**
- * Use this adapter to test out always passing through the new value
- * to the preference.
- */
- private class AlwaysUpdatePreferencePropertyValueModel<P> extends PreferencePropertyValueModel<P> {
-
- AlwaysUpdatePreferencePropertyValueModel(PropertyValueModel<Preferences> preferencesHolder, String key) {
- super(preferencesHolder, key);
- }
-
- @Override
- protected boolean shouldSetPreference(Object oldValue, Object newValue) {
- return true;
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
deleted file mode 100644
index 405930f10b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.prefs.NodeChangeEvent;
-import java.util.prefs.NodeChangeListener;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencesCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-public class PreferencesCollectionValueModelTests extends PreferencesTestCase {
- private Map<String, String> expectedValues;
- private WritablePropertyValueModel<Preferences> nodeHolder;
- PreferencesCollectionValueModel<String> preferencesAdapter;
- CollectionChangeEvent event;
- CollectionChangeListener listener;
- private PropertyChangeListener itemListener;
- boolean listenerRemoved = false;
- private static final String KEY_NAME_1 = "foo 1";
- private static final String KEY_NAME_2 = "foo 2";
- private static final String KEY_NAME_3 = "foo 3";
- private static final String STRING_VALUE_1 = "original string value 1";
- private static final String STRING_VALUE_2 = "original string value 2";
- private static final String STRING_VALUE_3 = "original string value 3";
-
- public PreferencesCollectionValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.expectedValues = new HashMap<String, String>();
- this.testNode.put(KEY_NAME_1, STRING_VALUE_1); this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.testNode.put(KEY_NAME_2, STRING_VALUE_2); this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.testNode.put(KEY_NAME_3, STRING_VALUE_3); this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
-
- this.nodeHolder = new SimplePropertyValueModel<Preferences>(this.testNode);
- this.preferencesAdapter = new PreferencesCollectionValueModel<String>(this.nodeHolder);
- this.listener = this.buildCollectionChangeListener();
- this.itemListener = this.buildItemListener();
- this.preferencesAdapter.addCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- this.event = null;
- }
-
- private CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void collectionChanged(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void collectionCleared(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsAdded(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- public void itemsRemoved(CollectionChangeEvent e) {
- this.logEvent(e);
- }
- private void logEvent(CollectionChangeEvent e) {
- if (PreferencesCollectionValueModelTests.this.event != null) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- PreferencesCollectionValueModelTests.this.event = e;
- }
- };
- }
-
- private PropertyChangeListener buildItemListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- };
- }
-
- public void testSubjectHolder() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME_1 = "another key 1";
- String ANOTHER_KEY_NAME_2 = "another key 2";
- String ANOTHER_KEY_NAME_3 = "another key 3";
- String ANOTHER_STRING_VALUE_1 = "another string value 1";
- String ANOTHER_STRING_VALUE_2 = "another string value 2";
- String ANOTHER_STRING_VALUE_3 = "another string value 3";
- Preferences anotherNode = this.classNode.node("another test node");
- this.expectedValues.clear();
- anotherNode.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1); this.expectedValues.put(ANOTHER_KEY_NAME_1, ANOTHER_STRING_VALUE_1);
- anotherNode.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2); this.expectedValues.put(ANOTHER_KEY_NAME_2, ANOTHER_STRING_VALUE_2);
- anotherNode.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3); this.expectedValues.put(ANOTHER_KEY_NAME_3, ANOTHER_STRING_VALUE_3);
-
- this.nodeHolder.setValue(anotherNode);
- // collectionChanged does not pass any items in the this.event
- this.verifyEvent(Collections.<String, String>emptyMap());
- this.verifyAdapter(this.preferencesAdapter);
-
- this.event = null;
- this.expectedValues.clear();
- this.nodeHolder.setValue(null);
- this.verifyEvent(this.expectedValues);
- assertFalse(this.preferencesAdapter.iterator().hasNext());
-
- this.event = null;
- this.nodeHolder.setValue(this.testNode);
- this.verifyEvent(Collections.<String, String>emptyMap());
- this.expectedValues.clear();
- this.expectedValues.put(KEY_NAME_1, STRING_VALUE_1);
- this.expectedValues.put(KEY_NAME_2, STRING_VALUE_2);
- this.expectedValues.put(KEY_NAME_3, STRING_VALUE_3);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testAddPreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String ANOTHER_KEY_NAME = "another key";
- String ANOTHER_STRING_VALUE = "another string value";
- this.testNode.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.waitForEventQueueToClear();
- Map<String, String> expectedItems = new HashMap<String, String>();
- expectedItems.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyEvent(expectedItems);
- this.expectedValues.put(ANOTHER_KEY_NAME, ANOTHER_STRING_VALUE);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testRemovePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- this.testNode.remove(KEY_NAME_2);
- this.waitForEventQueueToClear();
-
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.collectionName());
- assertEquals(1, this.event.itemsSize());
- @SuppressWarnings("unchecked")
- String key = ((PreferencePropertyValueModel<String>) this.event.items().next()).key();
- assertEquals(KEY_NAME_2, key);
-
- this.expectedValues.remove(KEY_NAME_2);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testChangePreference() throws Exception {
- this.verifyAdapter(this.preferencesAdapter);
- assertNull(this.event);
-
- String DIFFERENT = "something completely different";
- this.testNode.put(KEY_NAME_2, DIFFERENT);
- this.waitForEventQueueToClear();
-
- assertNull(this.event);
-
- this.expectedValues.put(KEY_NAME_2, DIFFERENT);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- public void testValues() throws Exception {
- this.verifyNode(this.testNode);
- this.verifyAdapter(this.preferencesAdapter);
- }
-
- /**
- * test a situation where
- * - we are listening to the node when it gets removed from the preferences "repository"
- * - we get notification that it has been removed
- * - we try to remove our this.listener
- * - the node will throw an IllegalStateException - the adapter should handle it OK...
- */
- public void testRemoveNode() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- Preferences parent = this.testNode.parent();
- parent.addNodeChangeListener(this.buildParentNodeChangeListener());
- this.testNode.removeNode();
- this.testNode.flush(); // this seems to be required for the this.event to trigger...
- this.waitForEventQueueToClear();
-
- assertTrue(this.listenerRemoved);
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private NodeChangeListener buildParentNodeChangeListener() {
- return new NodeChangeListener() {
- public void childAdded(NodeChangeEvent e) {
- throw new IllegalStateException("unexpected this.event: " + e);
- }
- public void childRemoved(NodeChangeEvent e) {
- if (e.getChild() == PreferencesCollectionValueModelTests.this.testNode) {
- PreferencesCollectionValueModelTests.this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, PreferencesCollectionValueModelTests.this.listener);
- // this line of code will not execute if the line above triggers an exception
- PreferencesCollectionValueModelTests.this.listenerRemoved = true;
- }
- }
- };
- }
-
- public void testHasListeners() throws Exception {
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(CollectionValueModel.VALUES, this.listener);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
-
- CollectionChangeListener listener2 = this.buildCollectionChangeListener();
- this.preferencesAdapter.addCollectionChangeListener(listener2);
- assertTrue(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- assertTrue(this.nodeHasAnyPrefListeners(this.testNode));
- this.preferencesAdapter.removeCollectionChangeListener(listener2);
- assertFalse(this.nodeHasAnyPrefListeners(this.testNode));
- assertFalse(this.preferencesAdapter.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES));
- }
-
- private void verifyEvent(Map<String, String> items) {
- assertNotNull(this.event);
- assertEquals(this.preferencesAdapter, this.event.getSource());
- assertEquals(CollectionValueModel.VALUES, this.event.collectionName());
- assertEquals(items.size(), this.event.itemsSize());
- @SuppressWarnings("unchecked")
- Iterator<PreferencePropertyValueModel<String>> eventItems = (Iterator<PreferencePropertyValueModel<String>>) this.event.items();
- this.verifyItems(items, eventItems);
- }
-
- private void verifyNode(Preferences node) throws Exception {
- String[] keys = node.keys();
- assertEquals(this.expectedValues.size(), keys.length);
- for (int i = 0; i < keys.length; i++) {
- assertEquals(this.expectedValues.get(keys[i]), node.get(keys[i], "<missing preference>"));
- }
- }
-
- private void verifyAdapter(PreferencesCollectionValueModel<String> cvm) {
- assertEquals(this.expectedValues.size(), cvm.size());
- this.verifyItems(this.expectedValues, cvm.iterator());
- }
-
- private void verifyItems(Map<String, String> expected, Iterator<PreferencePropertyValueModel<String>> stream) {
- while (stream.hasNext()) {
- PreferencePropertyValueModel<String> model = stream.next();
- model.addPropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- assertEquals(expected.get(model.key()), model.value());
- model.removePropertyChangeListener(PropertyValueModel.VALUE, this.itemListener);
- }
- }
-
- private boolean nodeHasAnyPrefListeners(Preferences node) throws Exception {
- PreferenceChangeListener[] prefListeners = (PreferenceChangeListener[]) ClassTools.fieldValue(node, "prefListeners");
- return prefListeners.length > 0;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
deleted file mode 100644
index bca284a8fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.prefs;
-
-import java.util.EventObject;
-import java.util.List;
-import java.util.prefs.AbstractPreferences;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- * set up and tear down a test node for any subclass that
- * needs to test preferences-related stuff
- */
-public abstract class PreferencesTestCase extends TestCase {
- protected Preferences classNode;
- public Preferences testNode;
- protected static final String TEST_NODE_NAME = "test node";
-
- public PreferencesTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Preferences packageNode = Preferences.userNodeForPackage(this.getClass());
- this.classNode = packageNode.node(ClassTools.shortClassNameForObject(this));
- // clean out any leftover crap...
- if ((this.classNode.keys().length > 0) || (this.classNode.childrenNames().length > 0)) {
- this.classNode.removeNode();
- // ...and re-create the node
- this.classNode = packageNode.node(ClassTools.shortClassNameForObject(this));
- }
- this.testNode = this.classNode.node(TEST_NODE_NAME);
- }
-
- @Override
- protected void tearDown() throws Exception {
- // wait for all the events to be delivered before tearing down
- this.waitForEventQueueToClear();
- Preferences node = this.classNode.parent();
- this.classNode.removeNode();
- while (this.nodeIsVestigial(node)) {
- Preferences parent = node.parent();
- node.removeNode();
- node = parent;
- }
- TestTools.clear(this);
- super.tearDown();
- }
-
- private boolean nodeIsVestigial(Preferences node) throws Exception {
- return (node != null)
- && (node.keys().length == 0)
- && (node.childrenNames().length == 0)
- && (node != Preferences.userRoot());
- }
-
- protected void waitForEventQueueToClear() {
- try {
- while ( ! this.preferencesEventQueue().isEmpty()) {
- Thread.sleep(100);
- }
- Thread.sleep(100);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @SuppressWarnings("unchecked")
- private List<EventObject> preferencesEventQueue() {
- return (List<EventObject>) ClassTools.staticFieldValue(AbstractPreferences.class, "eventQueue");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
deleted file mode 100644
index 24915ffd2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class CheckBoxModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Boolean> booleanHolder;
- private ButtonModel buttonModelAdapter;
- boolean eventFired;
-
- public CheckBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.booleanHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.buttonModelAdapter = new CheckBoxModelAdapter(this.booleanHolder) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- this.buttonModelAdapter.setSelected(false);
- assertTrue(this.eventFired);
- assertEquals(Boolean.FALSE, this.booleanHolder.value());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(Boolean.FALSE);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.buttonModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- CheckBoxModelAdapterTests.this.eventFired = true;
- }
- });
- assertTrue(this.buttonModelAdapter.isSelected());
- this.booleanHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
-
- this.eventFired = false;
- this.booleanHolder.setValue(Boolean.FALSE);
- assertFalse(this.eventFired);
- assertFalse(this.buttonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Boolean> localBooleanHolder = (SimplePropertyValueModel<Boolean>) this.booleanHolder;
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.buttonModelAdapter.addChangeListener(listener);
- assertTrue(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.buttonModelAdapter);
-
- this.buttonModelAdapter.removeChangeListener(listener);
- assertFalse(localBooleanHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.buttonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- // ********** member class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index d41842e632..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of check boxes.
- */
-public class CheckBoxModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Boolean> flag1Holder;
- private WritablePropertyValueModel<Boolean> flag2Holder;
- private WritablePropertyValueModel<Boolean> notFlag2Holder;
- private ButtonModel flag1ButtonModel;
- private ButtonModel flag2ButtonModel;
- private ButtonModel notFlag2ButtonModel;
-
- public static void main(String[] args) throws Exception {
- new CheckBoxModelAdapterUITest().exec(args);
- }
-
- private CheckBoxModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel(true, true);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.flag1Holder = this.buildFlag1Holder(this.testModelHolder);
- this.flag1ButtonModel = this.buildCheckBoxModelAdapter(this.flag1Holder);
- this.flag2Holder = this.buildFlag2Holder(this.testModelHolder);
- this.flag2ButtonModel = this.buildCheckBoxModelAdapter(this.flag2Holder);
- this.notFlag2Holder = this.buildNotFlag2Holder(this.testModelHolder);
- this.notFlag2ButtonModel = this.buildCheckBoxModelAdapter(this.notFlag2Holder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag1Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG1_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag1());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag1(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setFlag2(value.booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNotFlag2Holder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Boolean>(vm, TestModel.NOT_FLAG2_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNotFlag2());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNotFlag2(value.booleanValue());
- }
- };
- }
-
- private ButtonModel buildCheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- return new CheckBoxModelAdapter(booleanHolder);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildCheckBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildCheckBoxPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildFlag1CheckBox());
- taskListPanel.add(this.buildFlag2CheckBox());
- taskListPanel.add(this.buildNotFlag2CheckBox());
- taskListPanel.add(this.buildUnattachedCheckBox());
- return taskListPanel;
- }
-
- private JCheckBox buildFlag1CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 1");
- checkBox.setModel(this.flag1ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("flag 2");
- checkBox.setModel(this.flag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildNotFlag2CheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("not flag 2");
- checkBox.setModel(this.notFlag2ButtonModel);
- return checkBox;
- }
-
- private JCheckBox buildUnattachedCheckBox() {
- JCheckBox checkBox = new JCheckBox("unattached");
- checkBox.getModel().addItemListener(this.buildUnattachedItemListener());
- return checkBox;
- }
-
- private ItemListener buildUnattachedItemListener() {
- return new ItemListener() {
- public void itemStateChanged(ItemEvent e) {
- System.out.println("unattached state changed: " + e);
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildFlipFlag1Button());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildFlipFlag1Button() {
- return new JButton(this.buildFlipFlag1Action());
- }
-
- private Action buildFlipFlag1Action() {
- Action action = new AbstractAction("flip flag 1") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.flipFlag1();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void flipFlag1() {
- this.testModel.setFlag1( ! this.testModel.isFlag1());
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- CheckBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("flag 1: " + this.testModel.isFlag1());
- System.out.println("flag 2: " + this.testModel.isFlag2());
- System.out.println("not flag 2: " + this.testModel.isNotFlag2());
- System.out.println("***");
- }
-
-
- private class TestModel extends AbstractModel {
- private boolean flag1;
- public static final String FLAG1_PROPERTY = "flag1";
- private boolean flag2;
- public static final String FLAG2_PROPERTY = "flag2";
- private boolean notFlag2;
- public static final String NOT_FLAG2_PROPERTY = "notFlag2";
-
- public TestModel(boolean flag1, boolean flag2) {
- this.flag1 = flag1;
- this.flag2 = flag2;
- this.notFlag2 = ! flag2;
- }
- public boolean isFlag1() {
- return this.flag1;
- }
- public void setFlag1(boolean flag1) {
- boolean old = this.flag1;
- this.flag1 = flag1;
- this.firePropertyChanged(FLAG1_PROPERTY, old, flag1);
- }
- public boolean isFlag2() {
- return this.flag2;
- }
- public void setFlag2(boolean flag2) {
- boolean old = this.flag2;
- this.flag2 = flag2;
- this.firePropertyChanged(FLAG2_PROPERTY, old, flag2);
-
- old = this.notFlag2;
- this.notFlag2 = ! flag2;
- this.firePropertyChanged(NOT_FLAG2_PROPERTY, old, this.notFlag2);
- }
- public boolean isNotFlag2() {
- return this.notFlag2;
- }
- public void setNotFlag2(boolean notFlag2) {
- this.setFlag2( ! notFlag2);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.isFlag1() + " - " + this.isFlag2() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
deleted file mode 100644
index 82a1dc622d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.ListModel;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.CoordinatedList;
-
-import junit.framework.TestCase;
-
-public class ComboBoxModelAdapterTests extends TestCase {
-
- public ComboBoxModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<Displayable> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- SimplePropertyValueModel<Object> selectionHolder = new SimplePropertyValueModel<Object>(listHolder.iterator().next());
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- ComboBoxModel comboBoxModel = new ComboBoxModelAdapter(listHolder, selectionHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
-
- CoordinatedList<Displayable> synchList = new CoordinatedList<Displayable>(comboBoxModel);
- PropertyChangeListener selectionListener = this.buildSelectionListener();
- selectionHolder.addPropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(comboBoxModel);
-
- comboBoxModel.removeListDataListener(synchList);
- selectionHolder.removePropertyChangeListener(PropertyValueModel.VALUE, selectionListener);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertFalse(selectionHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(comboBoxModel);
- }
-
- private PropertyChangeListener buildSelectionListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent evt) {
- // do nothing...
- }
- };
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleListValueModel<Displayable> buildListHolder() {
- return new SimpleListValueModel<Displayable>(this.buildList());
- }
-
- private List<Displayable> buildList() {
- List<Displayable> list = new ArrayList<Displayable>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<Displayable> c) {
- c.add(new SimpleDisplayable("foo"));
- c.add(new SimpleDisplayable("bar"));
- c.add(new SimpleDisplayable("baz"));
- c.add(new SimpleDisplayable("joo"));
- c.add(new SimpleDisplayable("jar"));
- c.add(new SimpleDisplayable("jaz"));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
deleted file mode 100644
index 91d7713c4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.ListCellRenderer;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.FilteringListBrowser;
-import org.eclipse.jpt.utility.internal.swing.ListChooser;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of combo-boxes.
- *
- * DefaultLongListBrowserDialogUITest subclasses this class; so be
- * careful when making changes.
- */
-public class ComboBoxModelAdapterUITest {
-
- protected JFrame window;
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private SimpleListValueModel<String> colorListHolder;
- protected ComboBoxModel colorComboBoxModel;
- private int nextColorNumber = 0;
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest().exec(args);
- }
-
- protected ComboBoxModelAdapterUITest() {
- super();
- }
-
- protected void exec(String[] args) throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); // Metal LAF
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel.class.getName());
-// UIManager.setLookAndFeel(oracle.bali.ewt.olaf.OracleLookAndFeel.class.getName());
- this.testModel = this.buildTestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.colorListHolder = this.buildColorListHolder();
- this.colorComboBoxModel = this.buildComboBoxModelAdapter(this.colorListHolder, this.colorHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.COLOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- protected TestModel buildTestModel() {
- return new TestModel();
- }
-
- private SimpleListValueModel<String> buildColorListHolder() {
- return new SimpleListValueModel<String>(TestModel.validColors());
-// return new AbstractReadOnlyListValueModel() {
-// public Object value() {
-// return new ArrayListIterator(TestModel.VALID_COLORS);
-// }
-// public int size() {
-// return TestModel.VALID_COLORS.length;
-// }
-// };
- }
-
- protected ListValueModel<String> uiColorListHolder() {
- return this.colorListHolder;
- }
-
- private ComboBoxModel buildComboBoxModelAdapter(ListValueModel<String> listHolder, WritablePropertyValueModel<Object> selectionHolder) {
- return new ComboBoxModelAdapter(listHolder, selectionHolder);
- }
-
- private void openWindow() {
- this.window = new JFrame(ClassTools.shortNameFor(this.getClass()));
- this.window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- this.window.addWindowListener(this.buildWindowListener());
- this.window.getContentPane().add(this.buildMainPanel(), "Center");
- this.window.setLocation(300, 300);
- this.window.setSize(400, 150);
- this.window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildComboBoxPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- protected JPanel buildComboBoxPanel() {
- JPanel panel = new JPanel(new GridLayout(1, 0));
- panel.add(this.buildComboBox());
- panel.add(this.buildComboBox());
- panel.add(this.buildListChooser1());
- panel.add(this.buildListChooser2());
- return panel;
- }
-
- private JComboBox buildComboBox() {
- JComboBox comboBox = new JComboBox(this.colorComboBoxModel);
- comboBox.setRenderer(this.buildComboBoxRenderer());
- return comboBox;
- }
-
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return super.buildText(value);
- }
- };
- }
-
- private ListChooser buildListChooser1() {
- return new LocalListChooser1(this.colorComboBoxModel);
- }
-
- private ListChooser buildListChooser2() {
- return new LocalListChooser2(this.colorComboBoxModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(2, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- controlPanel.add(this.buildAddTenButton());
- controlPanel.add(this.buildRemoveTenButton());
- return controlPanel;
- }
-
- // ********** reset color button **********
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- // ********** clear model button **********
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- // ********** restore model button **********
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- // ********** print model button **********
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
- // ********** add 20 button **********
- private JButton buildAddTenButton() {
- return new JButton(this.buildAddTenAction());
- }
-
- private Action buildAddTenAction() {
- Action action = new AbstractAction("add 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.addTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addTen() {
- for (int i = this.nextColorNumber; i < this.nextColorNumber + 20; i++) {
- this.colorListHolder.add(this.colorListHolder.size(), "color" + i);
- }
- this.nextColorNumber += 20;
- }
-
- // ********** remove 20 button **********
- private JButton buildRemoveTenButton() {
- return new JButton(this.buildRemoveTenAction());
- }
-
- private Action buildRemoveTenAction() {
- Action action = new AbstractAction("remove 20") {
- public void actionPerformed(ActionEvent event) {
- ComboBoxModelAdapterUITest.this.removeTen();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void removeTen() {
- for (int i = 0; i < 20; i++) {
- if (this.colorListHolder.size() > 0) {
- this.colorListHolder.remove(this.colorListHolder.size() - 1);
- }
- }
- }
-
-
- protected static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String ORANGE = "orange";
- public static final String YELLOW = "yellow";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String INDIGO = "indigo";
- public static final String VIOLET = "violet";
- public static final String DEFAULT_COLOR = RED;
- public static List<String> validColors;
- public static final String[] DEFAULT_VALID_COLORS = {
- RED,
- ORANGE,
- YELLOW,
- GREEN,
- BLUE,
- INDIGO,
- VIOLET
- };
-
- public static List<String> validColors() {
- if (validColors == null) {
- validColors = buildDefaultValidColors();
- }
- return validColors;
- }
- public static List<String> buildDefaultValidColors() {
- List<String> result = new ArrayList<String>();
- CollectionTools.addAll(result, DEFAULT_VALID_COLORS);
- return result;
- }
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- this.checkColor(color);
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- public void checkColor(String c) {
- if ( ! validColors().contains(c)) {
- throw new IllegalArgumentException(c);
- }
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-
- private class LocalListChooser1 extends ListChooser {
- public LocalListChooser1(ComboBoxModel model) {
- super(model);
- }
- }
-
-
- private class LocalListChooser2 extends ListChooser {
- public LocalListChooser2(ComboBoxModel model) {
- super(model);
- }
- @Override
- protected ListBrowser buildBrowser() {
- return new FilteringListBrowser<String>();
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
deleted file mode 100644
index 1cd1c04947..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ListCellRenderer;
-
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- *
- */
-public class ComboBoxModelAdapterUITest2 extends ComboBoxModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ComboBoxModelAdapterUITest2().exec(args);
- }
-
- public ComboBoxModelAdapterUITest2() {
- super();
- }
-
- /**
- * use a different model that allows the color to be set to null
- */
- @Override
- protected TestModel buildTestModel() {
- return new TestModel2();
- }
-
- /**
- * add a null to the front of the list
- */
- @Override
- protected ListValueModel<String> uiColorListHolder() {
- // the default is to prepend the wrapped list with a null item
- return new ExtendedListValueModelWrapper<String>(super.uiColorListHolder());
- }
-
- /**
- * convert null to some text
- */
- @Override
- protected ListCellRenderer buildComboBoxRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- protected String buildText(Object value) {
- return (value == null) ? "<none selected>" : super.buildText(value);
- }
- };
- }
-
-
- protected static class TestModel2 extends TestModel {
- /**
- * null is OK here
- */
- @Override
- public void checkColor(String color) {
- if (color == null) {
- return;
- }
- super.checkColor(color);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
deleted file mode 100644
index 0d604cb10a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.Date;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class DateSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public DateSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Date());
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.spinnerModelAdapter.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.valueHolder.value()).getTime());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
- public void testDefaultValue() throws Exception {
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertFalse(((Date) this.spinnerModelAdapter.getValue()).getTime() == 777777);
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((DateSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((DateSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- Date today = new Date();
- this.valueHolder = new SimplePropertyValueModel<Object>();
- this.spinnerModelAdapter = new DateSpinnerModelAdapter(this.valueHolder, today) {
- @Override
- protected PropertyChangeListener buildDateChangeListener() {
- return this.buildDateChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- DateSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(today, this.spinnerModelAdapter.getValue());
-
- Date newDate = new Date();
- newDate.setTime(777777);
- this.valueHolder.setValue(newDate);
-
- assertTrue(this.eventFired);
- assertEquals(777777, ((Date) this.spinnerModelAdapter.getValue()).getTime());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
deleted file mode 100644
index 5cb84299a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent.EventType;
-import javax.swing.text.Document;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class DocumentAdapterTests extends TestCase {
- private WritablePropertyValueModel<String> stringHolder;
- Document documentAdapter;
- boolean eventFired;
-
- public DocumentAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.stringHolder = new SimplePropertyValueModel<String>("0123456789");
- this.documentAdapter = new DocumentAdapter(this.stringHolder) {
- @Override
- protected PropertyChangeListener buildStringListener() {
- return this.buildStringListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testRemove() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void removeUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "23456"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.remove(2, 5);
- assertTrue(this.eventFired);
- assertEquals("01789", this.stringHolder.value());
- }
-
- public void testInsert() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "xxxxxx"
- assertEquals(2, e.getOffset());
- assertEquals(5, e.getLength());
- }
- });
- this.documentAdapter.insertString(2, "xxxxx", null);
- assertTrue(this.eventFired);
- assertEquals("01xxxxx23456789", this.stringHolder.value());
- }
-
- public void testSetValue() throws Exception {
- this.eventFired = false;
- this.documentAdapter.addDocumentListener(new TestDocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- DocumentAdapterTests.this.eventFired = true;
- assertEquals(EventType.INSERT, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the insert of "foo"
- assertEquals(0, e.getOffset());
- assertEquals(3, e.getLength());
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- assertEquals(EventType.REMOVE, e.getType());
- assertEquals(DocumentAdapterTests.this.documentAdapter, e.getDocument());
- // this will be the removal of "0123456789"
- assertEquals(0, e.getOffset());
- assertEquals(10, e.getLength());
- }
- });
- assertEquals("0123456789", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- this.stringHolder.setValue("foo");
- assertTrue(this.eventFired);
- assertEquals("foo", this.documentAdapter.getText(0, this.documentAdapter.getLength()));
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<String> localStringHolder = (SimplePropertyValueModel<String>) this.stringHolder;
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
-
- DocumentListener listener = new TestDocumentListener();
- this.documentAdapter.addDocumentListener(listener);
- assertTrue(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.documentAdapter);
-
- this.documentAdapter.removeDocumentListener(listener);
- assertFalse(localStringHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.documentAdapter);
- }
-
- private void verifyHasNoListeners(Object document) throws Exception {
- Object delegate = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getDocumentListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object document) throws Exception {
- Object delegate = ClassTools.fieldValue(document, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getDocumentListeners");
- assertFalse(listeners.length == 0);
- }
-
-
-private class TestDocumentListener implements DocumentListener {
- TestDocumentListener() {
- super();
- }
- public void changedUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void insertUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
- public void removeUpdate(DocumentEvent e) {
- fail("unexpected event");
- }
-}
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
deleted file mode 100644
index e38b4eaafa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.WindowConstants;
-import javax.swing.text.AbstractDocument;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.PlainDocument;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of entry fields.
- */
-public class DocumentAdapterUITest {
-
- private TestModel testModel;
- private static final String DEFAULT_NAME = "Scooby Doo";
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<String> nameHolder;
- private Document nameDocument;
- private Document upperCaseNameDocument;
-
- public static void main(String[] args) throws Exception {
- new DocumentAdapterUITest().exec(args);
- }
-
- private DocumentAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel(DEFAULT_NAME);
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.nameHolder = this.buildNameHolder(this.testModelHolder);
- this.nameDocument = this.buildNameDocument(this.nameHolder);
- this.upperCaseNameDocument = this.buildUpperCaseNameDocument(this.nameHolder);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<String> buildNameHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, String>(vm, TestModel.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private Document buildNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder);
- }
-
- private Document buildUpperCaseNameDocument(WritablePropertyValueModel<String> stringHolder) {
- return new DocumentAdapter(stringHolder, this.buildUpperCaseNameDocumentDelegate());
- }
-
- private AbstractDocument buildUpperCaseNameDocumentDelegate() {
- return new PlainDocument() {
- @Override
- public void insertString(int offset, String string, AttributeSet a) throws BadLocationException {
- if (string == null) {
- return;
- }
- char[] upper = string.toCharArray();
- for (int i = 0; i < upper.length; i++) {
- upper[i] = Character.toUpperCase(upper[i]);
- }
- super.insertString(offset, new String(upper), a);
- }
- };
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTextFieldPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTextFieldPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildNameTextField());
- taskListPanel.add(this.buildReadOnlyNameTextField());
- taskListPanel.add(this.buildUpperCaseNameTextField());
- return taskListPanel;
- }
-
- private JTextField buildNameTextField() {
- return new JTextField(this.nameDocument, null, 0);
- }
-
- private JTextField buildReadOnlyNameTextField() {
- JTextField nameTextField = this.buildNameTextField();
- nameTextField.setEditable(false);
- return nameTextField;
- }
-
- private JTextField buildUpperCaseNameTextField() {
- return new JTextField(this.upperCaseNameDocument, null, 0);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetNameButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetNameButton() {
- return new JButton(this.buildResetNameAction());
- }
-
- private Action buildResetNameAction() {
- Action action = new AbstractAction("reset name") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.resetName();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetName() {
- this.testModel.setName(DEFAULT_NAME);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- DocumentAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("name: " + this.testModel.getName());
- }
-
-
- private class TestModel extends AbstractModel {
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- public TestModel(String name) {
- this.name = name;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.getName() + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
deleted file mode 100644
index b531bd3c73..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
+++ /dev/null
@@ -1,42 +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.utility.tests.internal.model.value.swing;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityModelValueSwingTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityModelValueSwingTests.class.getPackage().getName());
-
- suite.addTestSuite(CheckBoxModelAdapterTests.class);
- suite.addTestSuite(ComboBoxModelAdapterTests.class);
- suite.addTestSuite(DateSpinnerModelAdapterTests.class);
- suite.addTestSuite(DocumentAdapterTests.class);
- suite.addTestSuite(ListModelAdapterTests.class);
- suite.addTestSuite(ListSpinnerModelAdapterTests.class);
- suite.addTestSuite(NumberSpinnerModelAdapterTests.class);
- suite.addTestSuite(ObjectListSelectionModelTests.class);
- suite.addTestSuite(PrimitiveListTreeModelTests.class);
- suite.addTestSuite(RadioButtonModelAdapterTests.class);
- suite.addTestSuite(SpinnerModelAdapterTests.class);
- suite.addTestSuite(TableModelAdapterTests.class);
- suite.addTestSuite(TreeModelAdapterTests.class);
-
- return suite;
- }
-
- private JptUtilityModelValueSwingTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
deleted file mode 100644
index 1488e5fab9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.swing.ListModel;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.CoordinatedList;
-
-import junit.framework.TestCase;
-
-public class ListModelAdapterTests extends TestCase {
-
- public ListModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- // nothing yet...
- }
-
- @Override
- protected void tearDown() throws Exception {
- // nothing yet...
- super.tearDown();
- }
-
- private ListModelAdapter buildListModel(ListValueModel<String> listHolder) {
- return new ListModelAdapter(listHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListModel buildListModel(CollectionValueModel<String> collectionHolder) {
- return new ListModelAdapter(collectionHolder) {
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- public void testCollectionSynchronization() {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(collectionHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- collectionHolder.add(null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- collectionHolder.remove(null);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testListSynchronization() {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.add(6, "tom");
- listHolder.add(7, "dick");
- listHolder.add(8, "harry");
- listHolder.add(9, null);
- assertEquals(10, synchList.size());
- this.compare(listModel, synchList);
-
- listHolder.remove(9);
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
- }
-
- public void testSetModel() {
- SimpleListValueModel<String> listHolder1 = this.buildListHolder();
- ListModelAdapter listModel = this.buildListModel(listHolder1);
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder1.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- assertEquals(6, synchList.size());
- this.compare(listModel, synchList);
-
- SimpleListValueModel<String> listHolder2 = this.buildListHolder2();
- listModel.setModel(listHolder2);
- assertEquals(3, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- listModel.setModel(new SimpleListValueModel<String>());
- assertEquals(0, synchList.size());
- this.compare(listModel, synchList);
- assertTrue(listHolder1.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- assertTrue(listHolder2.hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- private void compare(ListModel listModel, List<String> list) {
- assertEquals(listModel.getSize(), list.size());
- for (int i = 0; i < listModel.getSize(); i++) {
- assertEquals(listModel.getElementAt(i), list.get(i));
- }
- }
-
- public void testCollectionSort() {
- this.verifyCollectionSort(null);
- }
-
- public void testListSort() {
- this.verifyListSort(null);
- }
-
- public void testCustomCollectionSort() {
- this.verifyCollectionSort(this.buildCustomComparator());
- }
-
- public void testCustomListSort() {
- this.verifyListSort(this.buildCustomComparator());
- }
-
- private Comparator<String> buildCustomComparator() {
- // sort with reverse order
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private void verifyCollectionSort(Comparator<String> comparator) {
- SimpleCollectionValueModel<String> collectionHolder = this.buildCollectionHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(collectionHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.add("tom");
- collectionHolder.add("dick");
- collectionHolder.add("harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- collectionHolder.remove("foo");
- collectionHolder.remove("jar");
- collectionHolder.remove("harry");
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void verifyListSort(Comparator<String> comparator) {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(listHolder, comparator));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertEquals(6, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.add(0, "tom");
- listHolder.add(0, "dick");
- listHolder.add(0, "harry");
- assertEquals(9, synchList.size());
- this.compareSort(listModel, synchList, comparator);
-
- listHolder.remove(8);
- listHolder.remove(4);
- listHolder.remove(0);
- listHolder.remove(5);
- assertEquals(5, synchList.size());
- this.compareSort(listModel, synchList, comparator);
- }
-
- private void compareSort(ListModel listModel, List<String> list, Comparator<String> comparator) {
- SortedSet<String> ss = new TreeSet<String>(comparator);
- for (int i = 0; i < listModel.getSize(); i++) {
- ss.add((String) listModel.getElementAt(i));
- }
- assertEquals(ss.size(), list.size());
- for (Iterator<String> stream1 = ss.iterator(), stream2 = list.iterator(); stream1.hasNext(); ) {
- assertEquals(stream1.next(), stream2.next());
- }
- }
-
- public void testHasListeners() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
-
- ListModel listModel = this.buildListModel(listHolder);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- assertTrue(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasListeners(listModel);
-
- listModel.removeListDataListener(synchList);
- assertFalse(listHolder.hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- this.verifyHasNoListeners(listModel);
- }
-
- public void testGetSize() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(listHolder);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals(6, listModel.getSize());
-
- listModel.removeListDataListener(synchList);
- this.verifyHasNoListeners(listModel);
- assertEquals(6, listModel.getSize());
- }
-
- public void testGetElementAt() throws Exception {
- SimpleListValueModel<String> listHolder = this.buildListHolder();
- ListModel listModel = this.buildListModel(new SortedListValueModelAdapter<String>(listHolder));
- CoordinatedList<String> synchList = new CoordinatedList<String>(listModel);
- this.verifyHasListeners(listModel);
- assertEquals("bar", listModel.getElementAt(0));
- assertEquals("bar", synchList.get(0));
- }
-
- private void verifyHasNoListeners(ListModel listModel) throws Exception {
- boolean hasNoListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasNoListDataListeners")).booleanValue();
- assertTrue(hasNoListeners);
- }
-
- private void verifyHasListeners(ListModel listModel) throws Exception {
- boolean hasListeners = ((Boolean) ClassTools.executeMethod(listModel, "hasListDataListeners")).booleanValue();
- assertTrue(hasListeners);
- }
-
- private SimpleCollectionValueModel<String> buildCollectionHolder() {
- return new SimpleCollectionValueModel<String>(this.buildCollection());
- }
-
- private Collection<String> buildCollection() {
- Bag<String> bag = new HashBag<String>();
- this.populateCollection(bag);
- return bag;
- }
-
- private SimpleListValueModel<String> buildListHolder() {
- return new SimpleListValueModel<String>(this.buildList());
- }
-
- private List<String> buildList() {
- List<String> list = new ArrayList<String>();
- this.populateCollection(list);
- return list;
- }
-
- private void populateCollection(Collection<String> c) {
- c.add("foo");
- c.add("bar");
- c.add("baz");
- c.add("joo");
- c.add("jar");
- c.add("jaz");
- }
-
- private SimpleListValueModel<String> buildListHolder2() {
- return new SimpleListValueModel<String>(this.buildList2());
- }
-
- private List<String> buildList2() {
- List<String> list = new ArrayList<String>();
- this.populateCollection2(list);
- return list;
- }
-
- private void populateCollection2(Collection<String> c) {
- c.add("tom");
- c.add("dick");
- c.add("harry");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
deleted file mode 100644
index 05f08ad0ee..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.ListModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * an example UI for testing various permutations of the ListModelAdapter
- */
-public class ListModelAdapterUITest {
-
- private WritablePropertyValueModel<TaskList> taskListHolder;
- private TextField taskTextField;
-
- public static void main(String[] args) throws Exception {
- new ListModelAdapterUITest().exec(args);
- }
-
- private ListModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.taskListHolder = new SimplePropertyValueModel<TaskList>(new TaskList());
- this.openWindow();
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(800, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTaskListPanel(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(0, 1));
- taskListPanel.add(this.buildPrimitiveTaskListPanel());
- taskListPanel.add(this.buildDisplayableTaskListPanel());
- return taskListPanel;
- }
-
- private Component buildPrimitiveTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedPrimitiveListPanel());
- taskListPanel.add(this.buildStandardSortedPrimitiveListPanel());
- taskListPanel.add(this.buildCustomSortedPrimitiveListPanel());
- return taskListPanel;
- }
-
- private Component buildDisplayableTaskListPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildUnsortedDisplayableListPanel());
- taskListPanel.add(this.buildStandardSortedDisplayableListPanel());
- taskListPanel.add(this.buildCustomSortedDisplayableListPanel());
- return taskListPanel;
- }
-
- private Component buildUnsortedPrimitiveListPanel() {
- return this.buildListPanel("primitive unsorted", this.buildUnsortedPrimitiveListModel());
- }
-
- private Component buildStandardSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive sorted", this.buildStandardSortedPrimitiveListModel());
- }
-
- private Component buildCustomSortedPrimitiveListPanel() {
- return this.buildListPanel("primitive reverse sorted", this.buildCustomSortedPrimitiveListModel());
- }
-
- private Component buildUnsortedDisplayableListPanel() {
- return this.buildListPanel("displayable unsorted", this.buildUnsortedDisplayableListModel());
- }
-
- private Component buildStandardSortedDisplayableListPanel() {
- return this.buildListPanel("displayable sorted", this.buildStandardSortedDisplayableListModel());
- }
-
- private Component buildCustomSortedDisplayableListPanel() {
- return this.buildListPanel("displayable reverse sorted", this.buildCustomSortedDisplayableListModel());
- }
-
- private ListModel buildUnsortedPrimitiveListModel() {
- return new ListModelAdapter(this.buildPrimitiveTaskListAdapter());
- }
-
- private ListModel buildStandardSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedPrimitiveListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<String>(this.buildPrimitiveTaskListAdapter(), this.buildCustomStringComparator()));
- }
-
- private ListModel buildUnsortedDisplayableListModel() {
- return new ListModelAdapter(this.buildDisplayableTaskListAdapter());
- }
-
- private ListModel buildStandardSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<Task>(this.buildDisplayableTaskListAdapter()));
- }
-
- private ListModel buildCustomSortedDisplayableListModel() {
- return new ListModelAdapter(new SortedListValueModelAdapter<Task>(this.buildDisplayableTaskListAdapter(), this.buildCustomTaskObjectComparator()));
- }
-
- private Component buildListPanel(String label, ListModel listModel) {
- JPanel listPanel = new JPanel(new BorderLayout());
- JLabel listLabel = new JLabel(" " + label);
- listPanel.add(listLabel, BorderLayout.NORTH);
-
- JList listBox = new JList();
- listBox.setModel(listModel);
- listBox.setDoubleBuffered(true);
- listLabel.setLabelFor(listBox);
- listPanel.add(new JScrollPane(listBox), BorderLayout.CENTER);
- return listPanel;
- }
-
- private Comparator<String> buildCustomStringComparator() {
- return new Comparator<String>() {
- public int compare(String s1, String s2) {
- return s2.compareTo(s1);
- }
- };
- }
-
- private Comparator<Task> buildCustomTaskObjectComparator() {
- return new Comparator<Task>() {
- public int compare(Task to1, Task to2) {
- return to2.compareTo(to1);
- }
- };
- }
-
- private ListValueModel<String> buildPrimitiveTaskListAdapter() {
- return new ListAspectAdapter<TaskList, String>(TaskList.TASK_NAMES_LIST, this.taskList()) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.taskNames();
- }
- };
- }
-
- private ListValueModel<Task> buildDisplayableTaskListAdapter() {
- return new ListAspectAdapter<TaskList, Task>(TaskList.TASKS_LIST, this.taskList()) {
- @Override
- protected ListIterator<Task> listIterator_() {
- return this.subject.tasks();
- }
- };
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new BorderLayout());
- controlPanel.add(this.buildAddRemoveTaskPanel(), BorderLayout.CENTER);
- controlPanel.add(this.buildClearButton(), BorderLayout.EAST);
- return controlPanel;
- }
-
- private Component buildAddRemoveTaskPanel() {
- JPanel addRemoveTaskPanel = new JPanel(new BorderLayout());
- addRemoveTaskPanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRemoveTaskPanel.add(this.buildTaskTextField(), BorderLayout.CENTER);
- addRemoveTaskPanel.add(this.buildRemoveButton(), BorderLayout.EAST);
- return addRemoveTaskPanel;
- }
-
- private String getTask() {
- return this.taskTextField.getText();
- }
-
- private TaskList taskList() {
- return this.taskListHolder.value();
- }
-
- void addTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().addTask(task);
- }
- }
-
- void removeTask() {
- String task = this.getTask();
- if (task.length() != 0) {
- this.taskList().removeTask(task);
- }
- }
-
- void clearTasks() {
- this.taskList().clearTasks();
- }
-
- private TextField buildTaskTextField() {
- this.taskTextField = new TextField();
- return this.taskTextField;
- }
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.addTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.removeTask();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private JButton buildClearButton() {
- return new JButton(this.buildClearAction());
- }
-
- private Action buildClearAction() {
- Action action = new AbstractAction("clear") {
- public void actionPerformed(ActionEvent event) {
- ListModelAdapterUITest.this.clearTasks();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- private class TaskList extends AbstractModel {
- private List<String> taskNames = new ArrayList<String>();
- private List<Task> taskObjects = new ArrayList<Task>();
- public static final String TASK_NAMES_LIST = "taskNames";
- public static final String TASKS_LIST = "tasks";
- TaskList() {
- super();
- }
- public ListIterator<String> taskNames() {
- return this.taskNames.listIterator();
- }
- public ListIterator<Task> tasks() {
- return this.taskObjects.listIterator();
- }
- public void addTask(String taskName) {
- int index = this.taskNames.size();
- this.taskNames.add(index, taskName);
- this.fireItemAdded(TASK_NAMES_LIST, index, taskName);
-
- Task taskObject = new Task(taskName);
- this.taskObjects.add(index, taskObject);
- this.fireItemAdded(TASKS_LIST, index, taskObject);
- }
- public void removeTask(String taskName) {
- int index = this.taskNames.indexOf(taskName);
- if (index != -1) {
- Object removedTask = this.taskNames.remove(index);
- this.fireItemRemoved(TASK_NAMES_LIST, index, removedTask);
- // assume the indexes match...
- Object removedTaskObject = this.taskObjects.remove(index);
- this.fireItemRemoved(TASKS_LIST, index, removedTaskObject);
- }
- }
- public void clearTasks() {
- this.taskNames.clear();
- this.fireListChanged(TASK_NAMES_LIST);
- this.taskObjects.clear();
- this.fireListChanged(TASKS_LIST);
- }
- }
-
- private class Task extends AbstractModel implements Displayable {
- private String name;
- private Date creationTimeStamp;
- public Task(String name) {
- this.name = name;
- this.creationTimeStamp = new Date();
- }
- public String displayString() {
- return this.name + ": " + this.creationTimeStamp.getTime();
- }
- public Icon icon() {
- return null;
- }
- public int compareTo(Displayable o) {
- return DEFAULT_COMPARATOR.compare(this, o);
- }
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, old, name);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.displayString());
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
deleted file mode 100644
index 584ce1e8ba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ListSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
- private static final String[] VALUE_LIST = {"red", "green", "blue"};
- private static final String DEFAULT_VALUE = VALUE_LIST[0];
-
- public ListSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(DEFAULT_VALUE);
- this.spinnerModelAdapter = new ListSpinnerModelAdapter(this.valueHolder, VALUE_LIST) {
- @Override
- protected PropertyChangeListener buildValueChangeListener() {
- return this.buildValueChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.valueHolder.value());
- this.spinnerModelAdapter.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.valueHolder.value());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- ListSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(DEFAULT_VALUE, this.spinnerModelAdapter.getValue());
-
- this.valueHolder.setValue(VALUE_LIST[2]);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[2], this.spinnerModelAdapter.getValue());
-
- this.eventFired = false;
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(VALUE_LIST[0], this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((ListSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((ListSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
deleted file mode 100644
index 10a93dc216..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class NumberSpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Number> valueHolder;
- private SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public NumberSpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Number>(new Integer(0));
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, -33, 33, 1) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.value());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testDefaultValue() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(null);
- assertTrue(this.eventFired);
- assertEquals(new Integer(-33), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Number> localValueHolder = (SimplePropertyValueModel<Number>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(SpinnerModel adapter) throws Exception {
- assertEquals(0, ((NumberSpinnerModelAdapter) adapter).getChangeListeners().length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- assertFalse(((NumberSpinnerModelAdapter) adapter).getChangeListeners().length == 0);
- }
-
- public void testNullInitialValue() {
- this.valueHolder = new SimplePropertyValueModel<Number>();
- this.spinnerModelAdapter = new NumberSpinnerModelAdapter(this.valueHolder, new Integer(-33), new Integer(33), new Integer(1), new Integer(0)) {
- @Override
- protected PropertyChangeListener buildNumberChangeListener() {
- return this.buildNumberChangeListener_();
- }
- };
-
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NumberSpinnerModelAdapterTests.this.eventFired = true;
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
-
- // ********** inner class **********
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
deleted file mode 100644
index 1935068f27..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.DefaultListModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class ObjectListSelectionModelTests extends TestCase {
- private DefaultListModel listModel;
- private ObjectListSelectionModel selectionModel;
-
- public ObjectListSelectionModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.listModel = this.buildListModel();
- this.selectionModel = this.buildSelectionModel(this.listModel);
- }
-
- private DefaultListModel buildListModel() {
- DefaultListModel lm = new DefaultListModel();
- lm.addElement("foo");
- lm.addElement("bar");
- lm.addElement("baz");
- return lm;
- }
-
- private ObjectListSelectionModel buildSelectionModel(ListModel lm) {
- return new ObjectListSelectionModel(lm);
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testListDataListener() {
- this.selectionModel.addListSelectionListener(this.buildListSelectionListener());
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- this.listModel.set(0, "jar");
- assertEquals("jar", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValue() {
- this.selectionModel.setSelectionInterval(0, 0);
- assertEquals("foo", this.selectionModel.selectedValue());
- }
-
- public void testGetSelectedValues() {
- this.selectionModel.setSelectionInterval(0, 0);
- this.selectionModel.addSelectionInterval(2, 2);
- assertEquals(2, this.selectionModel.selectedValues().length);
- assertTrue(CollectionTools.contains(this.selectionModel.selectedValues(), "foo"));
- assertTrue(CollectionTools.contains(this.selectionModel.selectedValues(), "baz"));
- }
-
- public void testSetSelectedValue() {
- this.selectionModel.setSelectedValue("foo");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(0, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testSetSelectedValues() {
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- }
-
- public void testAddSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValue("jaz");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(5, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertTrue(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testAddSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertTrue(this.selectionModel.isSelectedIndex(1));
- assertFalse(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "jar"});
- this.selectionModel.removeSelectedValue("jar");
- assertEquals(0, this.selectionModel.getMinSelectionIndex());
- assertEquals(2, this.selectionModel.getMaxSelectionIndex());
- assertTrue(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertFalse(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testRemoveSelectedValues() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz", "joo", "jar"});
- this.selectionModel.removeSelectedValues(new Object[] {"foo", "joo"});
- assertEquals(2, this.selectionModel.getMinSelectionIndex());
- assertEquals(4, this.selectionModel.getMaxSelectionIndex());
- assertFalse(this.selectionModel.isSelectedIndex(0));
- assertFalse(this.selectionModel.isSelectedIndex(1));
- assertTrue(this.selectionModel.isSelectedIndex(2));
- assertFalse(this.selectionModel.isSelectedIndex(3));
- assertTrue(this.selectionModel.isSelectedIndex(4));
- assertFalse(this.selectionModel.isSelectedIndex(5));
- }
-
- public void testGetAnchorSelectedValue() {
- this.selectionModel.setAnchorSelectionIndex(1);
- assertEquals("bar", this.selectionModel.getAnchorSelectedValue());
- }
-
- public void testGetLeadSelectedValue() {
- this.selectionModel.setSelectedValue("bar");
- assertEquals("bar", this.selectionModel.getLeadSelectedValue());
- this.selectionModel.setSelectedValues(new Object[] {"foo", "baz"});
- assertEquals("baz", this.selectionModel.getLeadSelectedValue());
- }
-
- public void testGetMinMaxSelectedValue() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertEquals("foo", this.selectionModel.getMinSelectedValue());
- assertEquals("jar", this.selectionModel.getMaxSelectedValue());
- }
-
- public void testValueIsSelected() {
- this.listModel.addElement("joo");
- this.listModel.addElement("jar");
- this.listModel.addElement("jaz");
- this.selectionModel.setSelectedValue("foo");
- this.selectionModel.addSelectedValues(new Object[] {"bar", "jar"});
- assertTrue(this.selectionModel.valueIsSelected("foo"));
- assertTrue(this.selectionModel.valueIsSelected("bar"));
- assertTrue(this.selectionModel.valueIsSelected("jar"));
- assertFalse(this.selectionModel.valueIsSelected("baz"));
- }
-
- public void testHasListeners() throws Exception {
- ListSelectionListener listener = this.buildListSelectionListener();
- assertEquals(0, this.listModel.getListDataListeners().length);
- this.selectionModel.addListSelectionListener(listener);
- assertEquals(1, this.listModel.getListDataListeners().length);
- this.selectionModel.removeListSelectionListener(listener);
- assertEquals(0, this.listModel.getListDataListeners().length);
- }
-
- private ListSelectionListener buildListSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- // do nothing for now...
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
deleted file mode 100644
index df9e200232..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeModel;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.PrimitiveListTreeModel;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class PrimitiveListTreeModelTests extends TestCase {
- TestModel testModel;
- private TreeModel treeModel;
-
- public PrimitiveListTreeModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testModel = this.buildTestModel();
- this.treeModel = this.buildTreeModel();
- }
-
- private TestModel buildTestModel() {
- return new TestModel();
- }
-
- private TreeModel buildTreeModel() {
- return new PrimitiveListTreeModel(this.buildListValueModel()) {
- @Override
- protected void primitiveChanged(int index, Object newValue) {
- if ( ! newValue.equals("")) {
- PrimitiveListTreeModelTests.this.testModel.replaceName(index, (String) newValue);
- }
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<?> buildListValueModel() {
- return new ListAspectAdapter<TestModel, String>(TestModel.NAMES_LIST, this.testModel) {
- @Override
- protected ListIterator<String> listIterator_() {
- return this.subject.names();
- }
- @Override
- public String get(int index) {
- return this.subject.getName(index);
- }
- @Override
- public int size() {
- return this.subject.namesSize();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testAddPrimitive() {
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {0}, new String[] {"foo"});
- }
- });
- this.testModel.addName("foo");
- }
-
- public void testRemovePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"bar"});
- }
- });
- String name = this.testModel.removeName(1);
- assertEquals("bar", name);
- }
-
- public void testReplacePrimitive() {
- this.testModel.addName("foo");
- this.testModel.addName("bar");
- this.testModel.addName("baz");
- this.treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- PrimitiveListTreeModelTests.this.verifyTreeModelEvent(e, new int[] {1}, new String[] {"jar"});
- }
- });
- String name = this.testModel.replaceName(1, "jar");
- assertEquals("bar", name);
- }
-
- void verifyTreeModelEvent(TreeModelEvent e, int[] expectedChildIndices, String[] expectedNames) {
- assertTrue(Arrays.equals(expectedChildIndices, e.getChildIndices()));
- Object[] actualChildren = e.getChildren();
- assertEquals(expectedNames.length, actualChildren.length);
- for (int i = 0; i < expectedNames.length; i++) {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) actualChildren[i];
- assertEquals(expectedNames[i], node.getUserObject());
- }
- assertEquals(1, e.getPath().length);
- assertEquals(this.treeModel.getRoot(), e.getPath()[0]);
- assertEquals(this.treeModel, e.getSource());
- }
-
-
-// ********** inner classes **********
-
- private class TestModel extends AbstractModel {
- private final List<String> names;
- static final String NAMES_LIST = "names";
-
- TestModel() {
- super();
- this.names = new ArrayList<String>();
- }
-
- public ListIterator<String> names() {
- return new ReadOnlyListIterator<String>(this.names);
- }
- public int namesSize() {
- return this.names.size();
- }
- public String getName(int index) {
- return this.names.get(index);
- }
- public void addName(int index, String name) {
- this.addItemToList(index, name, this.names, NAMES_LIST);
- }
- public void addName(String name) {
- this.addName(this.namesSize(), name);
- }
- public void addNames(int index, List<String> list) {
- this.addItemsToList(index, this.names, list, NAMES_LIST);
- }
- public void addNames(List<String> list) {
- this.addNames(this.namesSize(), list);
- }
- public String removeName(int index) {
- return this.removeItemFromList(index, this.names, NAMES_LIST);
- }
- public List<String> removeNames(int index, int length) {
- return this.removeItemsFromList(index, length, this.names, NAMES_LIST);
- }
- public String replaceName(int index, String newName) {
- return this.setItemInList(index, newName, this.names, NAMES_LIST);
- }
- }
-
-
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
deleted file mode 100644
index afede650c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.ButtonModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.EventListenerList;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class RadioButtonModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
-
- private ButtonModel redButtonModelAdapter;
- private ChangeListener redListener;
- boolean redEventFired;
-
- private ButtonModel greenButtonModelAdapter;
- private ChangeListener greenListener;
- boolean greenEventFired;
-
- private ButtonModel blueButtonModelAdapter;
- private ChangeListener blueListener;
- boolean blueEventFired;
-
-// private ButtonGroup buttonGroup; // DO NOT use a ButtonGroup
-
- private static final String RED = "red";
- private static final String GREEN = "green";
- private static final String BLUE = "blue";
-
- public RadioButtonModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(null);
-// buttonGroup = new ButtonGroup();
-
- this.redButtonModelAdapter = this.buildButtonModel(this.valueHolder, RED);
-// this.redButtonModelAdapter.setGroup(buttonGroup);
- this.redListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.redEventFired = true;
- }
- };
-
- this.greenButtonModelAdapter = this.buildButtonModel(this.valueHolder, GREEN);
-// this.greenButtonModelAdapter.setGroup(buttonGroup);
- this.greenListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.greenEventFired = true;
- }
- };
-
- this.blueButtonModelAdapter = this.buildButtonModel(this.valueHolder, BLUE);
-// this.blueButtonModelAdapter.setGroup(buttonGroup);
- this.blueListener = new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- RadioButtonModelAdapterTests.this.blueEventFired = true;
- }
- };
-
- this.clearFlags();
- }
-
- private ButtonModel buildButtonModel(WritablePropertyValueModel<Object> pvm, Object buttonValue) {
- return new RadioButtonModelAdapter(pvm, buttonValue) {
- @Override
- protected PropertyChangeListener buildBooleanChangeListener() {
- return this.buildBooleanChangeListener_();
- }
- };
- }
-
- private void listenToModelAdapters() {
- this.redButtonModelAdapter.addChangeListener(this.redListener);
- this.greenButtonModelAdapter.addChangeListener(this.greenListener);
- this.blueButtonModelAdapter.addChangeListener(this.blueListener);
- }
-
- private void clearFlags() {
- this.redEventFired = false;
- this.greenEventFired = false;
- this.blueEventFired = false;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetSelected() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertEquals(GREEN, this.valueHolder.value());
-
- this.clearFlags();
- this.blueButtonModelAdapter.setSelected(true);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(BLUE, this.valueHolder.value());
-
- this.clearFlags();
- this.redButtonModelAdapter.setSelected(true);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertEquals(RED, this.valueHolder.value());
- }
-
- public void testSetValue() throws Exception {
- this.listenToModelAdapters();
-
- this.greenButtonModelAdapter.setSelected(true);
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(RED);
- assertTrue(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertTrue(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testDefaultValue() throws Exception {
- this.listenToModelAdapters();
-
- this.valueHolder.setValue(GREEN);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertTrue(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(null);
- assertFalse(this.redEventFired);
- assertTrue(this.greenEventFired);
- assertFalse(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertFalse(this.blueButtonModelAdapter.isSelected());
-
- this.clearFlags();
- this.valueHolder.setValue(BLUE);
- assertFalse(this.redEventFired);
- assertFalse(this.greenEventFired);
- assertTrue(this.blueEventFired);
- assertFalse(this.redButtonModelAdapter.isSelected());
- assertFalse(this.greenButtonModelAdapter.isSelected());
- assertTrue(this.blueButtonModelAdapter.isSelected());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.redButtonModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
-
- this.redButtonModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.redButtonModelAdapter);
- this.verifyHasNoListeners(this.greenButtonModelAdapter);
- this.verifyHasNoListeners(this.blueButtonModelAdapter);
- }
-
- private void verifyHasNoListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertEquals(0, listenerList.getListenerList().length);
- }
-
- private void verifyHasListeners(Object model) throws Exception {
- EventListenerList listenerList = (EventListenerList) ClassTools.fieldValue(model, "listenerList");
- assertFalse(listenerList.getListenerList().length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
deleted file mode 100644
index b75725f49d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JRadioButton;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-
-/**
- * Play around with a set of radio buttons.
- */
-public class RadioButtonModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
- private WritablePropertyValueModel<Object> colorHolder;
- private ButtonModel redButtonModel;
- private ButtonModel greenButtonModel;
- private ButtonModel blueButtonModel;
-
- public static void main(String[] args) throws Exception {
- new RadioButtonModelAdapterUITest().exec(args);
- }
-
- private RadioButtonModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
- this.colorHolder = this.buildColorHolder(this.testModelHolder);
- this.redButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.RED);
- this.greenButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.GREEN);
- this.blueButtonModel = this.buildRadioButtonModelAdapter(this.colorHolder, TestModel.BLUE);
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildColorHolder(PropertyValueModel<TestModel> subjectHolder) {
- return new PropertyAspectAdapter<TestModel, Object>(subjectHolder, TestModel.COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setColor((String) value);
- }
- };
- }
-
- private ButtonModel buildRadioButtonModelAdapter(WritablePropertyValueModel<Object> colorPVM, String color) {
- return new RadioButtonModelAdapter(colorPVM, color);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(400, 100);
- window.setLocation(200, 200);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildRadioButtonPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildRadioButtonPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildRedRadioButton());
- taskListPanel.add(this.buildGreenRadioButton());
- taskListPanel.add(this.buildBlueRadioButton());
- return taskListPanel;
- }
-
- private JRadioButton buildRedRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("red");
- radioButton.setModel(this.redButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildGreenRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("green");
- radioButton.setModel(this.greenButtonModel);
- return radioButton;
- }
-
- private JRadioButton buildBlueRadioButton() {
- JRadioButton radioButton = new JRadioButton();
- radioButton.setText("blue");
- radioButton.setModel(this.blueButtonModel);
- return radioButton;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetColorButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetColorButton() {
- return new JButton(this.buildResetColorAction());
- }
-
- private Action buildResetColorAction() {
- Action action = new AbstractAction("reset color") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.resetColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetColor() {
- this.testModel.setColor(TestModel.DEFAULT_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- RadioButtonModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println(this.testModel);
- }
-
-
- private static class TestModel extends AbstractModel {
- private String color;
- public static final String COLOR_PROPERTY = "color";
- public static final String RED = "red";
- public static final String GREEN = "green";
- public static final String BLUE = "blue";
- public static final String DEFAULT_COLOR = RED;
- public static final String[] VALID_COLORS = {
- RED,
- GREEN,
- BLUE
- };
-
- public TestModel() {
- this(DEFAULT_COLOR);
- }
- public TestModel(String color) {
- this.color = color;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor(String color) {
- if ( ! CollectionTools.contains(VALID_COLORS, color)) {
- throw new IllegalArgumentException(color);
- }
- Object old = this.color;
- this.color = color;
- this.firePropertyChanged(COLOR_PROPERTY, old, color);
- }
- @Override
- public String toString() {
- return "TestModel(" + this.color + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
deleted file mode 100644
index 3bfb66f4ba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * Make it easy to test the table model adapter and
- * renderers without any editing allowed.
- */
-public class ReadOnlyTableModelAdapterUITest extends TableModelAdapterUITest {
-
- public static void main(String[] args) throws Exception {
- new ReadOnlyTableModelAdapterUITest().exec(args);
- }
-
- protected ReadOnlyTableModelAdapterUITest() {
- super();
- }
-
- @Override
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter() {
- @Override
- public boolean columnIsEditable(int index) {
- return false;
- }
- };
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
deleted file mode 100644
index 273e974c61..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import javax.swing.SpinnerModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.SpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class SpinnerModelAdapterTests extends TestCase {
- private WritablePropertyValueModel<Object> valueHolder;
- SpinnerModel spinnerModelAdapter;
- boolean eventFired;
-
- public SpinnerModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.valueHolder = new SimplePropertyValueModel<Object>(new Integer(0));
- this.spinnerModelAdapter = new SpinnerModelAdapter(this.valueHolder) {
- @Override
- protected PropertyChangeListener buildValueListener() {
- return this.buildValueListener_();
- }
- };
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testSetValueSpinnerModel() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- this.spinnerModelAdapter.setValue(new Integer(5));
- assertTrue(this.eventFired);
- assertEquals(new Integer(5), this.valueHolder.value());
- }
-
- public void testSetValueValueHolder() throws Exception {
- this.eventFired = false;
- this.spinnerModelAdapter.addChangeListener(new TestChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- SpinnerModelAdapterTests.this.eventFired = true;
- assertEquals(SpinnerModelAdapterTests.this.spinnerModelAdapter, e.getSource());
- }
- });
- assertEquals(new Integer(0), this.spinnerModelAdapter.getValue());
- this.valueHolder.setValue(new Integer(7));
- assertTrue(this.eventFired);
- assertEquals(new Integer(7), this.spinnerModelAdapter.getValue());
- }
-
- public void testHasListeners() throws Exception {
- SimplePropertyValueModel<Object> localValueHolder = (SimplePropertyValueModel<Object>) this.valueHolder;
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
-
- ChangeListener listener = new TestChangeListener();
- this.spinnerModelAdapter.addChangeListener(listener);
- assertTrue(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasListeners(this.spinnerModelAdapter);
-
- this.spinnerModelAdapter.removeChangeListener(listener);
- assertFalse(localValueHolder.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- this.verifyHasNoListeners(this.spinnerModelAdapter);
- }
-
- private void verifyHasNoListeners(Object adapter) throws Exception {
- Object delegate = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getChangeListeners");
- assertEquals(0, listeners.length);
- }
-
- private void verifyHasListeners(Object adapter) throws Exception {
- Object delegate = ClassTools.fieldValue(adapter, "delegate");
- Object[] listeners = (Object[]) ClassTools.executeMethod(delegate, "getChangeListeners");
- assertFalse(listeners.length == 0);
- }
-
-
- private class TestChangeListener implements ChangeListener {
- TestChangeListener() {
- super();
- }
- public void stateChanged(ChangeEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
deleted file mode 100644
index f2a66e0611..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JSpinner;
-import javax.swing.SpinnerModel;
-import javax.swing.WindowConstants;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Play around with a set of spinners.
- */
-public class SpinnerModelAdapterUITest {
-
- private TestModel testModel;
- private WritablePropertyValueModel<TestModel> testModelHolder;
-
- private WritablePropertyValueModel<Object> birthDateHolder;
- private SpinnerModel birthDateSpinnerModel;
-
- private WritablePropertyValueModel<Number> ageHolder;
- private SpinnerModel ageSpinnerModel;
-
- private WritablePropertyValueModel<Object> eyeColorHolder;
- private SpinnerModel eyeColorSpinnerModel;
-
-
- public static void main(String[] args) throws Exception {
- new SpinnerModelAdapterUITest().exec(args);
- }
-
- private SpinnerModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.testModel = new TestModel();
- this.testModelHolder = new SimplePropertyValueModel<TestModel>(this.testModel);
-
- this.birthDateHolder = this.buildBirthDateHolder(this.testModelHolder);
- this.birthDateSpinnerModel = this.buildBirthDateSpinnerModel(this.birthDateHolder);
-
- this.ageHolder = this.buildAgeHolder(this.testModelHolder);
- this.ageSpinnerModel = this.buildAgeSpinnerModel(this.ageHolder);
-
- this.eyeColorHolder = this.buildEyeColorHolder(this.testModelHolder);
- this.eyeColorSpinnerModel = this.buildEyeColorSpinnerModel(this.eyeColorHolder);
-
- this.openWindow();
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.BIRTH_DATE_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private SpinnerModel buildBirthDateSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new DateSpinnerModelAdapter(valueHolder);
- }
-
- private WritablePropertyValueModel<Number> buildAgeHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Number>(vm, TestModel.AGE_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAge());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAge(value.intValue());
- }
- };
- }
-
- private SpinnerModel buildAgeSpinnerModel(WritablePropertyValueModel<Number> valueHolder) {
- return new NumberSpinnerModelAdapter(valueHolder, valueHolder.value().intValue(), TestModel.MIN_AGE, TestModel.MAX_AGE, 1);
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorHolder(PropertyValueModel<TestModel> vm) {
- return new PropertyAspectAdapter<TestModel, Object>(vm, TestModel.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private SpinnerModel buildEyeColorSpinnerModel(WritablePropertyValueModel<Object> valueHolder) {
- return new ListSpinnerModelAdapter(valueHolder, TestModel.VALID_EYE_COLORS);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setSize(600, 100);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildSpinnerPanel(), BorderLayout.NORTH);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildSpinnerPanel() {
- JPanel taskListPanel = new JPanel(new GridLayout(1, 0));
- taskListPanel.add(this.buildBirthDateSpinner());
- taskListPanel.add(this.buildAgeSpinner());
- taskListPanel.add(this.buildEyeColorSpinner());
- return taskListPanel;
- }
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.birthDateSpinnerModel);
- }
-
- private JSpinner buildAgeSpinner() {
- return new JSpinner(this.ageSpinnerModel);
- }
-
- private JSpinner buildEyeColorSpinner() {
- return new JSpinner(this.eyeColorSpinnerModel);
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(1, 0));
- controlPanel.add(this.buildResetModelButton());
- controlPanel.add(this.buildClearModelButton());
- controlPanel.add(this.buildRestoreModelButton());
- controlPanel.add(this.buildPrintModelButton());
- return controlPanel;
- }
-
- private JButton buildResetModelButton() {
- return new JButton(this.buildResetModelAction());
- }
-
- private Action buildResetModelAction() {
- Action action = new AbstractAction("reset model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.resetModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void resetModel() {
- this.testModel.setBirthDate(TestModel.DEFAULT_BIRTH_DATE);
- this.testModel.setEyeColor(TestModel.DEFAULT_EYE_COLOR);
- }
-
- private JButton buildClearModelButton() {
- return new JButton(this.buildClearModelAction());
- }
-
- private Action buildClearModelAction() {
- Action action = new AbstractAction("clear model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.clearModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void clearModel() {
- this.testModelHolder.setValue(null);
- }
-
- private JButton buildRestoreModelButton() {
- return new JButton(this.buildRestoreModelAction());
- }
-
- private Action buildRestoreModelAction() {
- Action action = new AbstractAction("restore model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.restoreModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void restoreModel() {
- this.testModelHolder.setValue(this.testModel);
- }
-
- private JButton buildPrintModelButton() {
- return new JButton(this.buildPrintModelAction());
- }
-
- private Action buildPrintModelAction() {
- Action action = new AbstractAction("print model") {
- public void actionPerformed(ActionEvent event) {
- SpinnerModelAdapterUITest.this.printModel();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printModel() {
- System.out.println("birth date: " + this.testModel.getBirthDate());
- System.out.println("age: " + this.testModel.getAge());
- System.out.println("eyes: " + this.testModel.getEyeColor());
- }
-
-
- private static class TestModel extends AbstractModel {
- private Calendar birthCal = Calendar.getInstance();
- // "virtual" properties
- public static final String BIRTH_DATE_PROPERTY = "birthDate";
- public static final String AGE_PROPERTY = "age";
- public static final Date DEFAULT_BIRTH_DATE = new Date();
- public static final int DEFAULT_AGE = 0;
- public static final int MIN_AGE = 0;
- public static final int MAX_AGE = 150;
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY = "eyeColor";
- public static final String[] VALID_EYE_COLORS = {"blue", "brown", "green", "hazel", "pink"};
- public static final String DEFAULT_EYE_COLOR = VALID_EYE_COLORS[3];
-
- public TestModel() {
- this(DEFAULT_BIRTH_DATE, DEFAULT_EYE_COLOR);
- }
- public TestModel(Date birthDate, String eyeColor) {
- this.setBirthDate(birthDate);
- this.setEyeColor(eyeColor);
- }
- public Date getBirthDate() {
- return (Date) this.birthCal.getTime().clone();
- }
- public void setBirthDate(Date birthDate) {
- Date oldBirthDate = this.getBirthDate();
- int oldAge = this.getAge();
- this.birthCal.setTimeInMillis(birthDate.getTime());
- int newAge = this.getAge();
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(birthDate.toString());
- }
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, oldBirthDate, this.getBirthDate());
- this.firePropertyChanged(AGE_PROPERTY, oldAge, newAge);
- }
- public int getAge() {
- Calendar currentCal = Calendar.getInstance();
- int age = currentCal.get(Calendar.YEAR) - this.birthCal.get(Calendar.YEAR);
- if (currentCal.get(Calendar.MONTH) < this.birthCal.get(Calendar.MONTH)) {
- age--;
- } else if (currentCal.get(Calendar.MONTH) == this.birthCal.get(Calendar.MONTH)) {
- if (currentCal.get(Calendar.DAY_OF_MONTH) < this.birthCal.get(Calendar.DAY_OF_MONTH)) {
- age--;
- }
- }
- return age;
- }
- public void setAge(int newAge) {
- if (newAge < MIN_AGE || newAge > MAX_AGE) {
- throw new IllegalArgumentException(String.valueOf(newAge));
- }
-
- int oldAge = this.getAge();
- int delta = newAge - oldAge;
-
- Calendar newBirthCal = Calendar.getInstance();
- newBirthCal.setTimeInMillis(this.birthCal.getTime().getTime());
- // if the age increased, the birth date must be "decreased"; and vice versa
- newBirthCal.set(Calendar.YEAR, newBirthCal.get(Calendar.YEAR) - delta);
- this.setBirthDate(newBirthCal.getTime());
- }
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if ( ! CollectionTools.contains(VALID_EYE_COLORS, eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
- @Override
- public String toString() {
- return "TestModel(birth: " + this.getBirthDate() + " - eyes: " + this.eyeColor + ")";
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
deleted file mode 100644
index c253c723a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
+++ /dev/null
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TableModelAdapterTests extends TestCase {
- private Crowd crowd;
- TableModelEvent event;
-
- public TableModelAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.crowd = this.buildCrowd();
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testGetRowCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(0, tableModelAdapter.getRowCount());
- // we need to add a listener to wake up the adapter
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
- assertEquals(this.crowd.peopleSize(), tableModelAdapter.getRowCount());
- }
-
- public void testGetColumnCount() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- assertEquals(PersonColumnAdapter.COLUMN_COUNT, tableModelAdapter.getColumnCount());
- }
-
- public void testGetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- tableModelAdapter.addTableModelListener(this.buildTableModelListener());
-
- List<String> sortedNames = this.sortedNames();
- for (int i = 0; i < this.crowd.peopleSize(); i++) {
- assertEquals(sortedNames.get(i), tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN));
- }
- }
-
- public void testSetValueAt() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- TableModelAdapterTests.this.event = e;
- }
- });
-
- Person person = this.crowd.personNamed("Gollum");
- assertEquals(Person.EYE_COLOR_BLUE, person.getEyeColor());
- assertFalse(person.isEvil());
- assertEquals(0, person.getRank());
-
- for (int i = 0; i < tableModelAdapter.getRowCount(); i++) {
- if (tableModelAdapter.getValueAt(i, PersonColumnAdapter.NAME_COLUMN).equals("Gollum")) {
- tableModelAdapter.setValueAt(Person.EYE_COLOR_HAZEL, i, PersonColumnAdapter.EYE_COLOR_COLUMN);
- tableModelAdapter.setValueAt(Boolean.TRUE, i, PersonColumnAdapter.EVIL_COLUMN);
- tableModelAdapter.setValueAt(new Integer(-1), i, PersonColumnAdapter.RANK_COLUMN);
- break;
- }
- }
- assertNotNull(this.event);
- assertEquals(Person.EYE_COLOR_HAZEL, person.getEyeColor());
- assertTrue(person.isEvil());
- assertEquals(-1, person.getRank());
- }
-
- public void testAddRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- this.crowd.addPerson("Zzzzz");
- assertNotNull(this.event);
- assertEquals(TableModelEvent.INSERT, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testRemoveRow() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // removing a person should only trigger one event, since a re-sort is not needed
- this.crowd.removePerson(this.crowd.personNamed("Gollum"));
- assertNotNull(this.event);
- assertEquals(TableModelEvent.DELETE, this.event.getType());
- assertEquals(TableModelEvent.ALL_COLUMNS, this.event.getColumn());
- }
-
- public void testChangeCell() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- this.event = null;
- tableModelAdapter.addTableModelListener(this.buildSingleEventListener());
- // add a person to the end of the list so we only trigger one event
- Person person = this.crowd.personNamed("Gollum");
- person.setEvil(true);
- assertNotNull(this.event);
- assertEquals(TableModelEvent.UPDATE, this.event.getType());
- assertEquals(PersonColumnAdapter.EVIL_COLUMN, this.event.getColumn());
- }
-
- public void testLazyListListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(this.crowd.hasAnyCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(this.crowd.hasNoCollectionChangeListeners(Crowd.PEOPLE_COLLECTION));
- }
-
- public void testLazyCellListener() throws Exception {
- TableModelAdapter<Person> tableModelAdapter = this.buildTableModelAdapter();
- TableModelListener listener = this.buildTableModelListener();
- Person person = this.crowd.personNamed("Gollum");
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.addTableModelListener(listener);
- assertTrue(person.hasAnyPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasAnyPropertyChangeListeners(Person.RANK_PROPERTY));
-
- tableModelAdapter.removeTableModelListener(listener);
- assertTrue(person.hasNoPropertyChangeListeners(Person.NAME_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.BIRTH_DATE_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EYE_COLOR_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.EVIL_PROPERTY));
- assertTrue(person.hasNoPropertyChangeListeners(Person.RANK_PROPERTY));
- }
-
- private TableModelAdapter<Person> buildTableModelAdapter() {
- return new TableModelAdapter<Person>(this.buildSortedPeopleAdapter(), this.buildColumnAdapter()) {
- @Override
- protected PropertyChangeListener buildCellListener() {
- return this.buildCellListener_();
- }
- @Override
- protected ListChangeListener buildListChangeListener() {
- return this.buildListChangeListener_();
- }
- };
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelAdapter<Person>(this.buildPeopleAdapter());
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(Crowd.PEOPLE_COLLECTION, this.crowd) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private Crowd buildCrowd() {
- Crowd result = new Crowd();
- result.addPerson("Bilbo");
- result.addPerson("Gollum");
- result.addPerson("Frodo");
- result.addPerson("Samwise");
- return result;
- }
-
- private ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private TableModelListener buildTableModelListener() {
- return new TestTableModelListener();
- }
-
- private List<String> sortedNames() {
- return new ArrayList<String>(CollectionTools.sortedSet(this.crowd.peopleNames()));
- }
-
- private TableModelListener buildSingleEventListener() {
- return new TestTableModelListener() {
- @Override
- public void tableChanged(TableModelEvent e) {
- // we expect only a single event
- if (TableModelAdapterTests.this.event == null) {
- TableModelAdapterTests.this.event = e;
- } else {
- fail("unexpected event");
- }
- }
- };
- }
-
-
- // ********** classes **********
-
- public static class PersonColumnAdapter implements ColumnAdapter {
- public static final int COLUMN_COUNT = 7;
-
- public static final int NAME_COLUMN = 0;
- public static final int BIRTH_DATE_COLUMN = 1;
- public static final int GONE_WEST_DATE_COLUMN = 2;
- public static final int EYE_COLOR_COLUMN = 3;
- public static final int EVIL_COLUMN = 4;
- public static final int RANK_COLUMN = 5;
- public static final int ADVENTURE_COUNT_COLUMN = 6;
-
- private static final String[] COLUMN_NAMES = new String[] {
- "Name",
- "Birth",
- "Gone West",
- "Eyes",
- "Evil",
- "Rank",
- "Adventures"
- };
-
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int index) {
- return COLUMN_NAMES[index];
- }
-
- public Class<?> columnClass(int index) {
- switch (index) {
- case NAME_COLUMN: return Object.class;
- case BIRTH_DATE_COLUMN: return Date.class;
- case GONE_WEST_DATE_COLUMN: return Date.class;
- case EYE_COLOR_COLUMN: return Object.class;
- case EVIL_COLUMN: return Boolean.class;
- case RANK_COLUMN: return Integer.class;
- case ADVENTURE_COUNT_COLUMN:return Integer.class;
- default: return Object.class;
- }
- }
-
- public boolean columnIsEditable(int index) {
- return index != NAME_COLUMN;
- }
-
- public WritablePropertyValueModel<Object>[] cellModels(Object subject) {
- Person person = (Person) subject;
- @SuppressWarnings("unchecked")
- WritablePropertyValueModel<Object>[] result = new WritablePropertyValueModel[COLUMN_COUNT];
-
- result[NAME_COLUMN] = this.buildNameAdapter(person);
- result[BIRTH_DATE_COLUMN] = this.buildBirthDateAdapter(person);
- result[GONE_WEST_DATE_COLUMN] = this.buildGoneWestDateAdapter(person);
- result[EYE_COLOR_COLUMN] = this.buildEyeColorAdapter(person);
- result[EVIL_COLUMN] = this.buildEvilAdapter(person);
- result[RANK_COLUMN] = this.buildRankAdapter(person);
- result[ADVENTURE_COUNT_COLUMN] = this.buildAdventureCountAdapter(person);
-
- return result;
- }
-
- private WritablePropertyValueModel<Object> buildNameAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.NAME_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setName((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.BIRTH_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.GONE_WEST_DATE_PROPERTY, person) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EYE_COLOR_PROPERTY, person) {
- @Override
- protected String buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildEvilAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.EVIL_PROPERTY, person) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEvil(((Boolean)value).booleanValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildRankAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.RANK_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setRank(((Integer) value).intValue());
- }
- };
- }
-
- private WritablePropertyValueModel<Object> buildAdventureCountAdapter(Person person) {
- return new PropertyAspectAdapter<Person, Object>(Person.ADVENTURE_COUNT_PROPERTY, person) {
- @Override
- protected Integer buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setAdventureCount(((Integer) value).intValue());
- }
- };
- }
-
- }
-
-
- public static class Crowd extends AbstractModel {
- private final Collection<Person> people;
- public static final String PEOPLE_COLLECTION = "people";
-
- public Crowd() {
- super();
- this.people = new ArrayList<Person>();
- }
-
-
- public Iterator<Person> people() {
- return new CloneIterator<Person>(this.people) {
- @Override
- protected void remove(Person person) {
- Crowd.this.removePerson(person);
- }
- };
- }
-
- public int peopleSize() {
- return this.people.size();
- }
-
- public Person addPerson(String name) {
- this.checkPersonName(name);
- return this.addPerson(new Person(this, name));
- }
-
- private Person addPerson(Person person) {
- this.addItemToCollection(person, this.people, PEOPLE_COLLECTION);
- return person;
- }
-
- public void removePerson(Person person) {
- this.removeItemFromCollection(person, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Collection<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- public void removePeople(Iterator<Person> persons) {
- this.removeItemsFromCollection(persons, this.people, PEOPLE_COLLECTION);
- }
-
- void checkPersonName(String personName) {
- if (personName == null) {
- throw new NullPointerException();
- }
- if (CollectionTools.contains(this.peopleNames(), personName)) {
- throw new IllegalArgumentException(personName);
- }
- }
-
- public Iterator<String> peopleNames() {
- return new TransformationIterator<Person, String>(this.people.iterator()) {
- @Override
- protected String transform(Person person) {
- return person.getName();
- }
- };
- }
-
- public Person personNamed(String name) {
- for (Iterator<Person> stream = this.people.iterator(); stream.hasNext(); ) {
- Person person = stream.next();
- if (person.getName().equals(name)) {
- return person;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, String.valueOf(this.people.size()) + " people");
- }
-
- }
-
-
- public static class Person extends AbstractModel implements Comparable<Person> {
- private Crowd crowd;
- private String name;
- public static final String NAME_PROPERTY= "name";
- private Date birthDate;
- public static final String BIRTH_DATE_PROPERTY= "birthDate";
- private Date goneWestDate;
- public static final String GONE_WEST_DATE_PROPERTY= "goneWestDate";
- private String eyeColor;
- public static final String EYE_COLOR_PROPERTY= "eyeColor";
- public static final String EYE_COLOR_BLUE = "blue";
- public static final String EYE_COLOR_GREEN = "green";
- public static final String EYE_COLOR_BROWN = "brown";
- public static final String EYE_COLOR_HAZEL = "hazel";
- public static final String EYE_COLOR_PINK = "pink";
- private static Collection<String> validEyeColors;
- public static final String DEFAULT_EYE_COLOR = EYE_COLOR_BLUE;
- private boolean evil;
- public static final String EVIL_PROPERTY= "evil";
- private int rank;
- public static final String RANK_PROPERTY= "rank";
- private int adventureCount;
- public static final String ADVENTURE_COUNT_PROPERTY= "adventureCount";
-
- Person(Crowd crowd, String name) {
- super();
- this.crowd = crowd;
- this.name = name;
- this.birthDate = new Date();
- Calendar c = Calendar.getInstance();
- c.add(Calendar.YEAR, 250);
- this.goneWestDate = new Date(c.getTimeInMillis());
- this.eyeColor = DEFAULT_EYE_COLOR;
- this.evil = false;
- this.rank = 0;
- this.adventureCount = 0;
- }
-
- public static Collection<String> getValidEyeColors() {
- if (validEyeColors == null) {
- validEyeColors = buildValidEyeColors();
- }
- return validEyeColors;
- }
-
- private static Collection<String> buildValidEyeColors() {
- Collection<String> result = new ArrayList<String>();
- result.add(EYE_COLOR_BLUE);
- result.add(EYE_COLOR_GREEN);
- result.add(EYE_COLOR_BROWN);
- result.add(EYE_COLOR_HAZEL);
- result.add(EYE_COLOR_PINK);
- return result;
- }
-
- public Crowd getCrowd() {
- return this.crowd;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- this.crowd.checkPersonName(name);
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Date getBirthDate() {
- return this.birthDate;
- }
- public void setBirthDate(Date birthDate) {
- Object old = this.birthDate;
- this.birthDate = birthDate;
- this.firePropertyChanged(BIRTH_DATE_PROPERTY, old, birthDate);
- }
-
- public Date getGoneWestDate() {
- return this.goneWestDate;
- }
- public void setGoneWestDate(Date goneWestDate) {
- Object old = this.goneWestDate;
- this.goneWestDate = goneWestDate;
- this.firePropertyChanged(GONE_WEST_DATE_PROPERTY, old, goneWestDate);
- }
-
- public String getEyeColor() {
- return this.eyeColor;
- }
- public void setEyeColor(String eyeColor) {
- if (! getValidEyeColors().contains(eyeColor)) {
- throw new IllegalArgumentException(eyeColor);
- }
- Object old = this.eyeColor;
- this.eyeColor = eyeColor;
- this.firePropertyChanged(EYE_COLOR_PROPERTY, old, eyeColor);
- }
-
- public boolean isEvil() {
- return this.evil;
- }
- public void setEvil(boolean evil) {
- boolean old = this.evil;
- this.evil = evil;
- this.firePropertyChanged(EVIL_PROPERTY, old, evil);
- }
-
- public int getRank() {
- return this.rank;
- }
- public void setRank(int rank) {
- int old = this.rank;
- this.rank = rank;
- this.firePropertyChanged(RANK_PROPERTY, old, rank);
- }
-
- public int getAdventureCount() {
- return this.adventureCount;
- }
- public void setAdventureCount(int adventureCount) {
- int old = this.adventureCount;
- this.adventureCount = adventureCount;
- this.firePropertyChanged(ADVENTURE_COUNT_PROPERTY, old, adventureCount);
- }
-
- public int compareTo(Person p) {
- return this.name.compareToIgnoreCase(p.name);
- }
-
- @Override
- public String toString() {
- return this.name +
- "\tborn: " + DateFormat.getDateInstance().format(this.birthDate) +
- "\tgone west: " + DateFormat.getDateInstance().format(this.goneWestDate) +
- "\teyes: " + this.eyeColor +
- "\tevil: " + this.evil +
- "\trank: " + this.rank +
- "\tadventures: " + this.adventureCount
- ;
- }
-
- }
-
-
- private class TestTableModelListener implements TableModelListener {
- TestTableModelListener() {
- super();
- }
- public void tableChanged(TableModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
deleted file mode 100644
index b7e02d9150..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
+++ /dev/null
@@ -1,733 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.ButtonModel;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListSelectionModel;
-import javax.swing.SpinnerModel;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-import javax.swing.text.Document;
-
-import org.eclipse.jpt.utility.internal.ClassTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.CheckBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.ComboBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.SpinnerTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.TableCellEditorAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Crowd;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Person;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.PersonColumnAdapter;
-
-/**
- * an example UI for testing the TableModelAdapter
- * "name" column is read-only text field
- * "birth date" column is date text field
- * "gone west date" column is date spinner
- * "eye color" column is combo-box
- * "evil" column is check box
- * "rank" column is number text field
- * "adventure count" column is number spinner
- *
- * Note that the table model and row selection model share the same
- * list value model (the sorted people adapter)
- */
-public class TableModelAdapterUITest {
- private SimpleCollectionValueModel<Object> eyeColorsHolder; // Object because it adapts to a combo-box
- private WritablePropertyValueModel<Crowd> crowdHolder;
- private WritablePropertyValueModel<Person> selectedPersonHolder;
- private ListValueModel<Person> sortedPeopleAdapter;
- private TableModel tableModel;
- private ObjectListSelectionModel rowSelectionModel;
- private Action removeAction;
- private Action renameAction;
-
- public static void main(String[] args) throws Exception {
- new TableModelAdapterUITest().exec(args);
- }
-
- protected TableModelAdapterUITest() {
- super();
- }
-
- protected void exec(String[] args) throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- this.eyeColorsHolder = this. buildEyeColorCollectionHolder();
- this.crowdHolder = this.buildCrowdHolder();
- this.selectedPersonHolder = this.buildSelectedPersonHolder();
- this.sortedPeopleAdapter = this.buildSortedPeopleAdapter();
- this.tableModel = this.buildTableModel();
- this.rowSelectionModel = this.buildRowSelectionModel();
- this.openWindow();
- }
-
- private SimpleCollectionValueModel<Object> buildEyeColorCollectionHolder() {
- return new SimpleCollectionValueModel<Object>(new ArrayList<Object>(Person.getValidEyeColors()));
- }
-
- private WritablePropertyValueModel<Crowd> buildCrowdHolder() {
- return new SimplePropertyValueModel<Crowd>(this.buildCrowd());
- }
-
- private Crowd buildCrowd() {
- Crowd crowd = new Crowd();
-
- Person p = crowd.addPerson("Bilbo");
- p.setEyeColor(Person.EYE_COLOR_BROWN);
- p.setRank(22);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Gollum");
- p.setEyeColor(Person.EYE_COLOR_PINK);
- p.setEvil(true);
- p.setRank(2);
- p.setAdventureCount(50);
-
- p = crowd.addPerson("Frodo");
- p.setEyeColor(Person.EYE_COLOR_BLUE);
- p.setRank(34);
- p.setAdventureCount(1);
-
- p = crowd.addPerson("Samwise");
- p.setEyeColor(Person.EYE_COLOR_GREEN);
- p.setRank(19);
- p.setAdventureCount(1);
-
- return crowd;
- }
-
- private WritablePropertyValueModel<Person> buildSelectedPersonHolder() {
- return new SimplePropertyValueModel<Person>();
- }
-
- private ListValueModel<Person> buildSortedPeopleAdapter() {
- return new SortedListValueModelAdapter<Person>(this.buildPeopleNameAdapter());
- }
-
- // the list will need to be re-sorted if a name changes
- private ListValueModel<Person> buildPeopleNameAdapter() {
- return new ItemPropertyListValueModelAdapter<Person>(this.buildPeopleAdapter(), Person.NAME_PROPERTY);
- }
-
- private CollectionValueModel<Person> buildPeopleAdapter() {
- return new CollectionAspectAdapter<Crowd, Person>(this.crowdHolder, Crowd.PEOPLE_COLLECTION) {
- @Override
- protected Iterator<Person> iterator_() {
- return this.subject.people();
- }
- @Override
- protected int size_() {
- return this.subject.peopleSize();
- }
- };
- }
-
- private TableModel buildTableModel() {
- return new TableModelAdapter<Person>(this.sortedPeopleAdapter, this.buildColumnAdapter());
- }
-
- protected ColumnAdapter buildColumnAdapter() {
- return new PersonColumnAdapter();
- }
-
- private ObjectListSelectionModel buildRowSelectionModel() {
- ObjectListSelectionModel rsm = new ObjectListSelectionModel(new ListModelAdapter(this.sortedPeopleAdapter));
- rsm.addListSelectionListener(this.buildRowSelectionListener());
- rsm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- return rsm;
- }
-
- private ListSelectionListener buildRowSelectionListener() {
- return new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- TableModelAdapterUITest.this.rowSelectionChanged(e);
- }
- };
- }
-
- void rowSelectionChanged(ListSelectionEvent e) {
- Person selection = (Person) this.rowSelectionModel.selectedValue();
- this.selectedPersonHolder.setValue(selection);
- boolean personSelected = (selection != null);
- this.removeAction.setEnabled(personSelected);
- this.renameAction.setEnabled(personSelected);
- }
-
- private void openWindow() {
- JFrame window = new JFrame(ClassTools.shortClassNameForObject(this));
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(200, 200);
- window.setSize(600, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTablePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTablePane() {
- return new JScrollPane(this.buildTable());
- }
-
- private JTable buildTable() {
- JTable table = new JTable(this.tableModel);
- table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); // see Java bug 5007652
- table.setSelectionModel(this.rowSelectionModel);
- table.setDoubleBuffered(true);
- table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
- int rowHeight = 20; // start with minimum of 20
-
- // gone west column (spinner)
- TableColumn column = table.getColumnModel().getColumn(PersonColumnAdapter.GONE_WEST_DATE_COLUMN);
- SpinnerTableCellRenderer spinnerRenderer = this.buildDateSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildDateSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- // eye color column (combo-box)
- // the jdk combo-box renderer looks like a text field
- // until the user starts an edit - use a custom one
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EYE_COLOR_COLUMN);
- ComboBoxTableCellRenderer eyeColorRenderer = this.buildEyeColorComboBoxRenderer();
- column.setCellRenderer(eyeColorRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildEyeColorComboBoxRenderer()));
- rowHeight = Math.max(rowHeight, eyeColorRenderer.preferredHeight());
-
- // evil (check box)
- // the jdk check box renderer and editor suck - use a custom ones
- column = table.getColumnModel().getColumn(PersonColumnAdapter.EVIL_COLUMN);
- CheckBoxTableCellRenderer evilRenderer = new CheckBoxTableCellRenderer();
- column.setCellRenderer(evilRenderer);
- column.setCellEditor(new TableCellEditorAdapter(new CheckBoxTableCellRenderer()));
- rowHeight = Math.max(rowHeight, evilRenderer.preferredHeight());
-
- // adventure count column (spinner)
- column = table.getColumnModel().getColumn(PersonColumnAdapter.ADVENTURE_COUNT_COLUMN);
- spinnerRenderer = this.buildNumberSpinnerRenderer();
- column.setCellRenderer(spinnerRenderer);
- column.setCellEditor(new TableCellEditorAdapter(this.buildNumberSpinnerRenderer()));
- rowHeight = Math.max(rowHeight, spinnerRenderer.preferredHeight());
-
- table.setRowHeight(rowHeight);
- return table;
- }
-
- private SpinnerTableCellRenderer buildDateSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new DateSpinnerModelAdapter(new SimplePropertyValueModel<Object>()));
- }
-
- private SpinnerTableCellRenderer buildNumberSpinnerRenderer() {
- return new SpinnerTableCellRenderer(new NumberSpinnerModelAdapter(new SimplePropertyValueModel<Number>()));
- }
-
- private ComboBoxTableCellRenderer buildEyeColorComboBoxRenderer() {
- return new ComboBoxTableCellRenderer(this.buildReadOnlyEyeColorComboBoxModel(), this.buildEyeColorRenderer());
- }
-
- private ComboBoxModel buildReadOnlyEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, new SimplePropertyValueModel<Object>());
- }
-
- private ListCellRenderer buildEyeColorRenderer() {
- return new EyeColorRenderer();
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildButtonPanel());
- controlPanel.add(this.buildPersonPanel());
- return controlPanel;
- }
-
- private Component buildButtonPanel() {
- JPanel buttonPanel = new JPanel(new GridLayout(1, 0));
- buttonPanel.add(this.buildAddButton());
- buttonPanel.add(this.buildRemoveButton());
- buttonPanel.add(this.buildRenameButton());
- buttonPanel.add(this.buildAddEyeColorButton());
- buttonPanel.add(this.buildPrintButton());
- buttonPanel.add(this.buildResetButton());
- return buttonPanel;
- }
-
- private Component buildPersonPanel() {
- JPanel personPanel = new JPanel(new GridLayout(1, 0));
- personPanel.add(this.buildNameTextField());
- personPanel.add(this.buildBirthDateSpinner());
- personPanel.add(this.buildGoneWestDateSpinner());
- personPanel.add(this.buildEyeColorComboBox());
- personPanel.add(this.buildEvilCheckBox());
- personPanel.add(this.buildRankSpinner());
- personPanel.add(this.buildAdventureCountSpinner());
- return personPanel;
- }
-
-
- // ********** add button **********
-
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addPerson();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addPerson() {
- String name = this.getNameFromUser();
- if (name != null) {
- this.setSelectedPerson(this.crowd().addPerson(name));
- }
- }
-
-
- // ********** remove button **********
-
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- this.removeAction = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.removePerson();
- }
- };
- this.removeAction.setEnabled(false);
- return this.removeAction;
- }
-
- void removePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- this.crowd().removePerson(person);
- }
- }
-
-
- // ********** rename button **********
-
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- this.renameAction = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.renamePerson();
- }
- };
- this.renameAction.setEnabled(false);
- return this.renameAction;
- }
-
- void renamePerson() {
- Person person = this.selectedPerson();
- if (person != null) {
- String name = this.promptUserForName(person.getName());
- if (name != null) {
- person.setName(name);
- this.setSelectedPerson(person);
- }
- }
- }
-
-
- // ********** add eye color button **********
-
- private JButton buildAddEyeColorButton() {
- return new JButton(this.buildAddEyeColorAction());
- }
-
- private Action buildAddEyeColorAction() {
- Action action = new AbstractAction("add eye color") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.addEyeColor();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void addEyeColor() {
- String color = this.promptUserForEyeColor();
- if (color != null) {
- this.eyeColorsHolder.add(color);
- }
- }
-
- private String promptUserForEyeColor() {
- while (true) {
- String eyeColor = JOptionPane.showInputDialog("Eye Color");
- if (eyeColor == null) {
- return null; // user pressed <Cancel>
- }
- if ((eyeColor.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The eye color is required.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.eyeColorsHolder.iterator(), eyeColor)) {
- JOptionPane.showMessageDialog(null, "The eye color already exists.", "Invalid Eye Color", JOptionPane.ERROR_MESSAGE);
- } else {
- return eyeColor;
- }
- }
- }
-
-
- // ********** print button **********
-
- private JButton buildPrintButton() {
- return new JButton(this.buildPrintAction());
- }
-
- private Action buildPrintAction() {
- Action action = new AbstractAction("print") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.printCrowd();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void printCrowd() {
- System.out.println(this.crowd());
- for (Iterator<Person> stream = this.crowd().people(); stream.hasNext(); ) {
- System.out.println("\t" + stream.next());
- }
- }
-
-
- // ********** reset button **********
-
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TableModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- void reset() {
- this.crowdHolder.setValue(this.buildCrowd());
- }
-
-
- // ********** new name dialog **********
-
- private String getNameFromUser() {
- return this.promptUserForName(null);
- }
-
- private String promptUserForName(String originalName) {
- while (true) {
- String name = JOptionPane.showInputDialog("Person Name");
- if (name == null) {
- return null; // user pressed <Cancel>
- }
- if ((name.length() == 0)) {
- JOptionPane.showMessageDialog(null, "The name is required.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else if (CollectionTools.contains(this.crowd().peopleNames(), name)) {
- JOptionPane.showMessageDialog(null, "The name already exists.", "Invalid Name", JOptionPane.ERROR_MESSAGE);
- } else {
- return name;
- }
- }
- }
-
-
- // ********** name text field **********
-
- private Component buildNameTextField() {
- JTextField textField = new JTextField(this.buildNameDocument(), null, 0);
- textField.setEditable(false);
- return textField;
- }
-
- private Document buildNameDocument() {
- return new DocumentAdapter(this.buildNameAdapter());
- }
-
- private WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<Person, String>(this.selectedPersonHolder, Person.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
-
- // ********** birth date spinner **********
-
- private JSpinner buildBirthDateSpinner() {
- return new JSpinner(this.buildBirthDateSpinnerModel());
- }
-
- private SpinnerModel buildBirthDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildBirthDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildBirthDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.BIRTH_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getBirthDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setBirthDate((Date) value);
- }
- };
- }
-
-
- // ********** gone west date spinner **********
-
- private JSpinner buildGoneWestDateSpinner() {
- return new JSpinner(this.buildGoneWestDateSpinnerModel());
- }
-
- private SpinnerModel buildGoneWestDateSpinnerModel() {
- return new DateSpinnerModelAdapter(this.buildGoneWestDateAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildGoneWestDateAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.GONE_WEST_DATE_PROPERTY) {
- @Override
- protected Date buildValue_() {
- return this.subject.getGoneWestDate();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setGoneWestDate((Date) value);
- }
- };
- }
-
-
- // ********** eye color combo-box **********
-
- private JComboBox buildEyeColorComboBox() {
- return new JComboBox(this.buildEyeColorComboBoxModel());
- }
-
- private ComboBoxModel buildEyeColorComboBoxModel() {
- return new ComboBoxModelAdapter(this.eyeColorsHolder, this.buildEyeColorAdapter());
- }
-
- private WritablePropertyValueModel<Object> buildEyeColorAdapter() {
- return new PropertyAspectAdapter<Person, Object>(this.selectedPersonHolder, Person.EYE_COLOR_PROPERTY) {
- @Override
- protected Object buildValue_() {
- return this.subject.getEyeColor();
- }
- @Override
- protected void setValue_(Object value) {
- this.subject.setEyeColor((String) value);
- }
- };
- }
-
-
- // ********** evil check box **********
-
- private JCheckBox buildEvilCheckBox() {
- JCheckBox checkBox = new JCheckBox();
- checkBox.setText("evil");
- checkBox.setModel(this.buildEvilCheckBoxModel());
- return checkBox;
- }
-
- private ButtonModel buildEvilCheckBoxModel() {
- return new CheckBoxModelAdapter(this.buildEvilAdapter());
- }
-
- private WritablePropertyValueModel<Boolean> buildEvilAdapter() {
- return new PropertyAspectAdapter<Person, Boolean>(this.selectedPersonHolder, Person.EVIL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isEvil());
- }
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setEvil(value.booleanValue());
- }
- };
- }
-
-
- // ********** rank spinner **********
-
- private JSpinner buildRankSpinner() {
- return new JSpinner(this.buildRankSpinnerModel());
- }
-
- private SpinnerModel buildRankSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildRankAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildRankAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.RANK_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getRank());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setRank(value.intValue());
- }
- };
- }
-
-
- // ********** adventure count spinner **********
-
- private JSpinner buildAdventureCountSpinner() {
- return new JSpinner(this.buildAdventureCountSpinnerModel());
- }
-
- private SpinnerModel buildAdventureCountSpinnerModel() {
- return new NumberSpinnerModelAdapter(this.buildAdventureCountAdapter());
- }
-
- private WritablePropertyValueModel<Number> buildAdventureCountAdapter() {
- return new PropertyAspectAdapter<Person, Number>(this.selectedPersonHolder, Person.ADVENTURE_COUNT_PROPERTY) {
- @Override
- protected Number buildValue_() {
- return new Integer(this.subject.getAdventureCount());
- }
- @Override
- protected void setValue_(Number value) {
- this.subject.setAdventureCount(value.intValue());
- }
- };
- }
-
-
- // ********** queries **********
-
- private Crowd crowd() {
- return this.crowdHolder.value();
- }
-
- private Person selectedPerson() {
- if (this.rowSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (Person) this.rowSelectionModel.selectedValue();
- }
-
- private void setSelectedPerson(Person person) {
- this.rowSelectionModel.setSelectedValue(person);
- }
-
-
- // ********** custom renderer **********
-
- /**
- * This is simply an example of a renderer for the embedded combo-box.
- * It does nothing special unless you uncomment the code below....
- */
- private class EyeColorRenderer extends DefaultListCellRenderer {
- EyeColorRenderer() {
- super();
- }
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- // just do something to show the renderer is working...
- // value = ">" + value;
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
deleted file mode 100644
index eb46b93942..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
+++ /dev/null
@@ -1,817 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-public class TreeModelAdapterTests extends TestCase {
- boolean eventFired;
-
- public TreeModelAdapterTests(String name) {
- super(name);
- }
-
- public void testGetRoot() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- assertEquals("root", root.getName());
-// root.dump();
-// rootNode.dump();
- }
-
- public void testGetChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode expected = rootNode.childNamed("node 1");
- TestNode actual = (TestNode) treeModel.getChild(rootNode, 1);
- assertEquals(expected, actual);
-
- expected = rootNode.childNamed("node 2");
- actual = (TestNode) treeModel.getChild(rootNode, 2);
- assertEquals(expected, actual);
- }
-
- public void testGetChildCount() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- assertEquals(5, treeModel.getChildCount(rootNode));
-
- TestNode node = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getChildCount(node));
- }
-
- public void testGetIndexOfChild() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
-
- TestNode child = rootNode.childNamed("node 0");
- assertEquals(0, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 1");
- assertEquals(1, treeModel.getIndexOfChild(rootNode, child));
-
- child = rootNode.childNamed("node 2");
- assertEquals(2, treeModel.getIndexOfChild(rootNode, child));
- TestNode grandchild = child.childNamed("node 2.2");
- assertEquals(2, treeModel.getIndexOfChild(child, grandchild));
- }
-
- public void testIsLeaf() {
- TreeModel treeModel = this.buildSortedTreeModel();
- treeModel.addTreeModelListener(new TestTreeModelListener());
- TestNode rootNode = (TestNode) treeModel.getRoot();
- assertFalse(treeModel.isLeaf(rootNode));
- TestNode node = rootNode.childNamed("node 1");
- assertFalse(treeModel.isLeaf(node));
- node = rootNode.childNamed("node 3");
- assertTrue(treeModel.isLeaf(node));
- }
-
-
- public void testTreeNodesChanged() {
- // the only way to trigger a "node changed" event is to use an unsorted tree;
- // a sorted tree will will trigger only "node removed" and "node inserted" events
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.setName("node 1++");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.setName("node 1.1++");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesInserted() {
- // use an unsorted tree so the nodes are not re-shuffled...
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestNode node = rootNode.childNamed("node 1");
- TestModel tm = node.getTestModel();
- tm.addChild("new child...");
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- node = node.childNamed("node 1.1");
- tm = node.getTestModel();
- tm.addChild("another new child...");
- assertTrue(this.eventFired);
- }
-
- public void testTreeNodesRemoved() {
- TreeModel treeModel = this.buildUnsortedTreeModel();
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- root.removeChild(root.childNamed("node 3"));
- assertTrue(this.eventFired);
-
- this.eventFired = false;
- TestNode node = rootNode.childNamed("node 2");
- TestModel tm = node.getTestModel();
- tm.removeChild(tm.childNamed("node 2.2"));
- assertTrue(this.eventFired);
- }
-
- public void testTreeStructureChanged() {
- WritablePropertyValueModel<TreeNodeValueModel<Object>> nodeHolder = new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- TreeModel treeModel = this.buildTreeModel(nodeHolder);
- this.eventFired = false;
- treeModel.addTreeModelListener(new TestTreeModelListener() {
- @Override
- public void treeNodesInserted(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeNodesRemoved(TreeModelEvent e) {
- // do nothing
- }
- @Override
- public void treeStructureChanged(TreeModelEvent e) {
- TreeModelAdapterTests.this.eventFired = true;
- }
- });
- nodeHolder.setValue(this.buildUnsortedRootNode());
- assertTrue(this.eventFired);
- }
-
- /**
- * test a problem we had where removing a child from a tree would cause
- * the JTree to call #equals(Object) on each node removed (actually, it was
- * TreePath, but that was because its own #equals(Object) was called by
- * JTree); and since we had already removed the last listener from the
- * aspect adapter, the aspect adapter would say its value was null; this
- * would cause a NPE until we tweaked TreeModelAdapter to remove its
- * listeners from a node only *after* the node had been completely
- * removed from the JTree
- * @see TreeModelAdapter#removeNode(Object[], int, TreeNodeValueModel)
- * @see TreeModelAdapter#addNode(Object[], int, TreeNodeValueModel)
- */
- public void testLazyInitialization() {
- TreeModel treeModel = this.buildSpecialTreeModel();
- JTree jTree = new JTree(treeModel);
- TestNode rootNode = (TestNode) treeModel.getRoot();
- TestModel root = rootNode.getTestModel();
- // this would cause a NPE:
- root.removeChild(root.childNamed("node 3"));
- assertEquals(treeModel, jTree.getModel());
- }
-
-
- private TreeModel buildSortedTreeModel() {
- return this.buildTreeModel(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildUnsortedTreeModel() {
- return this.buildTreeModel(this.buildUnsortedRootNode());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TreeModel buildSpecialTreeModel() {
- return this.buildTreeModel(this.buildSpecialRootNode());
- }
-
- private TestNode buildSpecialRootNode() {
- return new SpecialTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
- /*Node node_0 = */root.addChild("node 0");
- TestModel node_1 = root.addChild("node 1");
- TestModel node_1_1 = node_1.addChild("node 1.1");
- /*Node node_1_1_1 = */node_1_1.addChild("node 1.1.1");
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_0 = */node_2.addChild("node 2.0");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- /*Node node_2_2 = */node_2.addChild("node 2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
- /*Node node_3 = */root.addChild("node 3");
- /*Node node_4 = */root.addChild("node 4");
- return root;
- }
-
-
- // ********** member classes **********
-
- /**
- * This is a typical model class with the typical change notifications
- * for #name and #children.
- */
- public static class TestModel extends AbstractModel {
-
- // the parent is immutable; the root's parent is null
- private final TestModel parent;
-
- // the name is mutable; so I guess it isn't the "primary key" :-)
- private String name;
- public static final String NAME_PROPERTY = "name";
-
- private final Collection<TestModel> children;
- public static final String CHILDREN_COLLECTION = "children";
-
-
- public TestModel(String name) { // root ctor
- this(null, name);
- }
- private TestModel(TestModel parent, String name) {
- super();
- this.parent = parent;
- this.name = name;
- this.children = new HashBag<TestModel>();
- }
-
- public TestModel getParent() {
- return this.parent;
- }
-
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public Iterator<TestModel> children() {
- return new ReadOnlyIterator<TestModel>(this.children);
- }
- public int childrenSize() {
- return this.children.size();
- }
- public TestModel addChild(String childName) {
- TestModel child = new TestModel(this, childName);
- this.addItemToCollection(child, this.children, CHILDREN_COLLECTION);
- return child;
- }
- public TestModel[] addChildren(String[] childNames) {
- TestModel[] newChildren = new TestModel[childNames.length];
- for (int i = 0; i < childNames.length; i++) {
- newChildren[i] = new TestModel(this, childNames[i]);
- }
- this.addItemsToCollection(newChildren, this.children, CHILDREN_COLLECTION);
- return newChildren;
- }
- public void removeChild(TestModel child) {
- this.removeItemFromCollection(child, this.children, CHILDREN_COLLECTION);
- }
- public void removeChildren(TestModel[] testModels) {
- this.removeItemsFromCollection(testModels, this.children, CHILDREN_COLLECTION);
- }
- public void clearChildren() {
- this.clearCollection(this.children, CHILDREN_COLLECTION);
- }
- public TestModel childNamed(String childName) {
- for (TestModel child : this.children) {
- if (child.getName().equals(childName)) {
- return child;
- }
- }
- throw new RuntimeException("child not found: " + childName);
- }
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (TestModel child : this.children) {
- child.dumpOn(writer);
- }
- writer.undent();
- }
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
- public void dump() {
- this.dumpOn(System.out);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.name);
- }
-
- }
-
-
- /**
- * This Node wraps a TestModel and converts into something that can
- * be used by TreeModelAdapter. It converts changes to the TestModel's
- * name into "state changes" to the Node; and converts the
- * TestModel's children into a ListValueModel of Nodes whose order is
- * determined by subclass implementations.
- */
- public static abstract class TestNode extends AbstractTreeNodeValueModel<Object> implements Displayable {
- /** the model object wrapped by this node */
- private final TestModel testModel;
- /** this node's parent node; null for the root node */
- private final TestNode parent;
- /** this node's child nodes */
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
- /** a listener that notifies us when the model object's "internal state" changes */
- private final PropertyChangeListener testModelListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * root node constructor
- */
- public TestNode(TestModel testModel) {
- this(null, testModel);
- }
-
- /**
- * branch or leaf node constructor
- */
- public TestNode(TestNode parent, TestModel testModel) {
- super();
- this.parent = parent;
- this.testModel = testModel;
- this.childrenModel = this.buildChildrenModel(testModel);
- this.testModelListener = this.buildTestModelListener();
- }
-
- private PropertyChangeListener buildTestModelListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- TestNode.this.testModelChanged(e);
- }
- };
- }
-
- /**
- * subclasses decide the order of the child nodes
- */
- protected abstract ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel model);
-
- /**
- * used by subclasses;
- * transform the test model children into nodes
- */
- protected ListValueModel<TreeNodeValueModel<Object>> buildNodeAdapter(TestModel model) {
- return new TransformationListValueModelAdapter<TestModel, TreeNodeValueModel<Object>>(this.buildChildrenAdapter(model)) {
- @Override
- protected TestNode transformItem(TestModel item) {
- return TestNode.this.buildChildNode(item);
- }
- };
- }
-
- /**
- * subclasses must build a concrete node for the specified test model
- */
- protected abstract TestNode buildChildNode(TestModel childTestModel);
-
- /**
- * return a collection value model on the specified model's children
- */
- protected CollectionValueModel<TestModel> buildChildrenAdapter(TestModel model) {
- return new CollectionAspectAdapter<TestModel, TestModel>(TestModel.CHILDREN_COLLECTION, model) {
- @Override
- protected Iterator<TestModel> iterator_() {
- return this.subject.children();
- }
- @Override
- protected int size_() {
- return this.subject.childrenSize();
- }
- };
- }
-
-
- // ********** TreeNodeValueModel implementation **********
-
- public TestModel value() {
- return this.testModel;
- }
-
- public TreeNodeValueModel<Object> parent() {
- return this.parent;
- }
-
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.testModel.addPropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
- @Override
- protected void disengageValue() {
- this.testModel.removePropertyChangeListener(TestModel.NAME_PROPERTY, this.testModelListener);
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.testModel.getName();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** debugging support **********
-
- public String dumpString() {
- StringWriter sw = new StringWriter();
- IndentingPrintWriter ipw = new IndentingPrintWriter(sw);
- this.dumpOn(ipw);
- return sw.toString();
- }
-
- public void dumpOn(IndentingPrintWriter writer) {
- writer.println(this);
- writer.indent();
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- // cast to a TestNode (i.e. this won't work with a NameTestNode in the tree)
- ((TestNode) stream.next()).dumpOn(writer);
- }
- writer.undent();
- }
-
- public void dumpOn(OutputStream stream) {
- IndentingPrintWriter writer = new IndentingPrintWriter(new OutputStreamWriter(stream));
- this.dumpOn(writer);
- writer.flush();
- }
-
- public void dump() {
- this.dumpOn(System.out);
- }
-
-
- // ********** behavior **********
-
- /**
- * the model's name has changed, forward the event to our listeners
- */
- protected void testModelChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "internal state" has changed
- this.fireStateChanged();
- // our display string stays in synch with the model's name
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, e.oldValue(), e.newValue());
- }
-
-
- // ********** queries **********
-
- public TestModel getTestModel() {
- return this.testModel;
- }
-
- /**
- * testing convenience method
- */
- public TestNode childNamed(String name) {
- for (Iterator<TreeNodeValueModel<Object>> stream = this.childrenModel.iterator(); stream.hasNext(); ) {
- TreeNodeValueModel<Object> childNode = stream.next();
- if (childNode instanceof TestNode) {
- if (((TestNode) childNode).getTestModel().getName().equals(name)) {
- return (TestNode) childNode;
- }
- }
- }
- throw new IllegalArgumentException("child not found: " + name);
- }
-
-
- // ********** standard methods **********
-
- /**
- * use the standard Displayable comparator
- */
- public int compareTo(Displayable d) {
- return DEFAULT_COMPARATOR.compare(this, d);
- }
-
- @Override
- public String toString() {
- return "Node(" + this.testModel + ")";
- }
-
- }
-
- /**
- * concrete implementation that keeps its children sorted
- */
- public static class SortedTestNode extends TestNode {
-
- // ********** constructors **********
- public SortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public SortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return new SortedListValueModelAdapter<TreeNodeValueModel<Object>>(this.buildDisplayStringAdapter(testModel));
- }
- /** the display string (name) of each node can change */
- protected ListValueModel<TreeNodeValueModel<Object>> buildDisplayStringAdapter(TestModel testModel) {
- return new ItemPropertyListValueModelAdapter<TreeNodeValueModel<Object>>(this.buildNodeAdapter(testModel), DISPLAY_STRING_PROPERTY);
- }
- /** children are also sorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- */
- public static class UnsortedTestNode extends TestNode {
-
- // ********** constructors **********
- public UnsortedTestNode(TestModel testModel) {
- super(testModel);
- }
- public UnsortedTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** the list should NOT be sorted */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- return this.buildNodeAdapter(testModel);
- }
- /** children are also unsorted nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new UnsortedTestNode(this, childNode);
- }
-
- }
-
-
- /**
- * concrete implementation that leaves its children unsorted
- * and has a special set of children for "node 3"
- */
- public static class SpecialTestNode extends UnsortedTestNode {
-
- // ********** constructors **********
- public SpecialTestNode(TestModel testModel) {
- super(testModel);
- }
- public SpecialTestNode(TestNode parent, TestModel testModel) {
- super(parent, testModel);
- }
-
- // ********** initialization **********
- /** return a different list of children for "node 3" */
- @Override
- protected ListValueModel<TreeNodeValueModel<Object>> buildChildrenModel(TestModel testModel) {
- if (testModel.getName().equals("node 3")) {
- return this.buildSpecialChildrenModel(testModel);
- }
- return super.buildChildrenModel(testModel);
- }
- protected ListValueModel<TreeNodeValueModel<Object>> buildSpecialChildrenModel(TestModel testModel) {
- TreeNodeValueModel<Object>[] children = new NameTestNode[1];
- children[0] = new NameTestNode(this);
- return new SimpleListValueModel<TreeNodeValueModel<Object>>(Arrays.asList(children));
- }
- /** children are also special nodes */
- @Override
- protected TestNode buildChildNode(TestModel childNode) {
- return new SpecialTestNode(this, childNode);
- }
-
- }
-
-
- public static class NameTestNode extends AbstractTreeNodeValueModel<Object> {
- private final WritablePropertyValueModel<String> nameAdapter;
- private final SpecialTestNode specialNode; // parent node
- private final PropertyChangeListener nameListener;
- private final ListValueModel<TreeNodeValueModel<Object>> childrenModel;
-
- // ********** construction/initialization **********
-
- public NameTestNode(SpecialTestNode specialNode) {
- super();
- this.nameListener = this.buildNameListener();
- this.specialNode = specialNode;
- this.nameAdapter = this.buildNameAdapter();
- this.childrenModel = new NullListValueModel<TreeNodeValueModel<Object>>();
- }
- protected PropertyChangeListener buildNameListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- NameTestNode.this.nameChanged(e);
- }
- };
- }
- protected WritablePropertyValueModel<String> buildNameAdapter() {
- return new PropertyAspectAdapter<TestModel, String>(TestModel.NAME_PROPERTY, this.getTestModel()) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- public TestModel getTestModel() {
- return this.specialNode.getTestModel();
- }
-
- // ********** TreeNodeValueModel implementation **********
-
- public String value() {
- return this.nameAdapter.value();
- }
- @Override
- public void setValue(Object value) {
- this.nameAdapter.setValue((String) value);
- }
- public TreeNodeValueModel<Object> parent() {
- return this.specialNode;
- }
- public ListValueModel<TreeNodeValueModel<Object>> childrenModel() {
- return this.childrenModel;
- }
-
- // ********** AbstractTreeNodeValueModel implementation **********
-
- @Override
- protected void engageValue() {
- this.nameAdapter.addPropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
- @Override
- protected void disengageValue() {
- this.nameAdapter.removePropertyChangeListener(PropertyValueModel.VALUE, this.nameListener);
- }
-
- // ********** behavior **********
-
- protected void nameChanged(PropertyChangeEvent e) {
- // we need to notify listeners that our "value" has changed
- this.firePropertyChanged(VALUE, e.oldValue(), e.newValue());
- }
- }
-
- private TreeModel buildTreeModel(TestNode root) {
- return this.buildTreeModel(new StaticPropertyValueModel<TreeNodeValueModel<Object>>(root));
- }
-
- private TreeModel buildTreeModel(PropertyValueModel<TreeNodeValueModel<Object>> rootHolder) {
- return new TreeModelAdapter<Object>(rootHolder) {
- @Override
- protected ListChangeListener buildChildrenListener() {
- return this.buildChildrenListener_();
- }
- @Override
- protected StateChangeListener buildNodeStateListener() {
- return this.buildNodeStateListener_();
- }
- @Override
- protected PropertyChangeListener buildNodeValueListener() {
- return this.buildNodeValueListener_();
- }
- @Override
- protected PropertyChangeListener buildRootListener() {
- return this.buildRootListener_();
- }
- };
- }
-
-
-
- /**
- * listener that will blow up with any event;
- * override and implement expected event methods
- */
- public class TestTreeModelListener implements TreeModelListener {
- public void treeNodesChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesInserted(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeNodesRemoved(TreeModelEvent e) {
- fail("unexpected event");
- }
- public void treeStructureChanged(TreeModelEvent e) {
- fail("unexpected event");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
deleted file mode 100644
index f38148ca89..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.model.value.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.GridLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.WindowConstants;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.DefaultTreeSelectionModel;
-import javax.swing.tree.TreeModel;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.SortedTestNode;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestNode;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.UnsortedTestNode;
-
-/**
- * an example UI for testing the TreeModelAdapter
- */
-public class TreeModelAdapterUITest {
-
- // hold the tree so we can restore its expansion state
- private JTree tree;
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> rootNodeHolder;
- private boolean sorted;
- private TreeModel treeModel;
- private TreeSelectionModel treeSelectionModel;
- private TextField nameTextField;
-
- public static void main(String[] args) throws Exception {
- new TreeModelAdapterUITest().exec(args);
- }
-
- private TreeModelAdapterUITest() {
- super();
- }
-
- private void exec(String[] args) throws Exception {
- this.rootNodeHolder = this.buildRootNodeHolder();
- this.sorted = this.rootNodeHolder.value() instanceof SortedTestNode;
- this.treeModel = this.buildTreeModel();
- this.treeSelectionModel = this.buildTreeSelectionModel();
- this.nameTextField = new TextField();
- this.openWindow();
- }
-
- private WritablePropertyValueModel<TreeNodeValueModel<Object>> buildRootNodeHolder() {
- return new SimplePropertyValueModel<TreeNodeValueModel<Object>>(this.buildSortedRootNode());
- }
-
- private TestNode buildSortedRootNode() {
- return new SortedTestNode(this.buildRoot());
- }
-
- private TestNode buildUnsortedRootNode() {
- return new UnsortedTestNode(this.buildRoot());
- }
-
- private TestModel buildRoot() {
- TestModel root = new TestModel("root");
-
- TestModel node_1 = root.addChild("node 1");
- /*Node node_1_1 = */node_1.addChild("node 1.1");
-
- TestModel node_2 = root.addChild("node 2");
- /*Node node_2_1 = */node_2.addChild("node 2.1");
- TestModel node_2_2 = node_2.addChild("node 2.2");
- /*Node node_2_2_1 = */node_2_2.addChild("node 2.2.1");
- /*Node node_2_2_2 = */node_2_2.addChild("node 2.2.2");
- /*Node node_2_3 = */node_2.addChild("node 2.3");
- /*Node node_2_4 = */node_2.addChild("node 2.4");
- /*Node node_2_5 = */node_2.addChild("node 2.5");
-
- TestModel node_3 = root.addChild("node 3");
- TestModel node_3_1 = node_3.addChild("node 3.1");
- TestModel node_3_1_1 = node_3_1.addChild("node 3.1.1");
- /*Node node_3_1_1_1 = */node_3_1_1.addChild("node 3.1.1.1");
-
- /*Node node_4 = */root.addChild("node 4");
-
- return root;
- }
-
- private TreeModel buildTreeModel() {
- return new TreeModelAdapter<Object>(this.rootNodeHolder);
- }
-
- private TreeSelectionModel buildTreeSelectionModel() {
- TreeSelectionModel tsm = new DefaultTreeSelectionModel();
- tsm.addTreeSelectionListener(this.buildTreeSelectionListener());
- tsm.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
- return tsm;
- }
-
- private TreeSelectionListener buildTreeSelectionListener() {
- return new TreeSelectionListener() {
- public void valueChanged(TreeSelectionEvent e) {
- TreeModelAdapterUITest.this.treeSelectionChanged(e);
- }
- };
- }
-
- void treeSelectionChanged(TreeSelectionEvent e) {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- this.nameTextField.setText(selectedTestModel.getName());
- }
- }
-
- private void openWindow() {
- JFrame window = new JFrame(this.getClass().getName());
- window.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- window.addWindowListener(this.buildWindowListener());
- window.getContentPane().add(this.buildMainPanel(), "Center");
- window.setLocation(300, 300);
- window.setSize(400, 400);
- window.setVisible(true);
- }
-
- private WindowListener buildWindowListener() {
- return new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e) {
- e.getWindow().setVisible(false);
- System.exit(0);
- }
- };
- }
-
- private Component buildMainPanel() {
- JPanel mainPanel = new JPanel(new BorderLayout());
- mainPanel.add(this.buildTreePane(), BorderLayout.CENTER);
- mainPanel.add(this.buildControlPanel(), BorderLayout.SOUTH);
- return mainPanel;
- }
-
- private Component buildTreePane() {
- return new JScrollPane(this.buildTree());
- }
-
- private JTree buildTree() {
- this.tree = new JTree(this.treeModel) {
- @Override
- public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
- return ((Displayable) value).displayString();
- }
- };
- this.tree.setSelectionModel(this.treeSelectionModel);
- this.tree.setRootVisible(true);
- this.tree.setShowsRootHandles(true);
- this.tree.setRowHeight(20);
- this.tree.setDoubleBuffered(true);
- return this.tree;
- }
-
- private Component buildControlPanel() {
- JPanel controlPanel = new JPanel(new GridLayout(0, 1));
- controlPanel.add(this.buildAddRenameNodePanel());
- controlPanel.add(this.buildMiscPanel());
- return controlPanel;
- }
-
- private Component buildAddRenameNodePanel() {
- JPanel addRenameNodePanel = new JPanel(new BorderLayout());
- addRenameNodePanel.add(this.buildAddButton(), BorderLayout.WEST);
- addRenameNodePanel.add(this.nameTextField, BorderLayout.CENTER);
- addRenameNodePanel.add(this.buildRenameButton(), BorderLayout.EAST);
- return addRenameNodePanel;
- }
-
- private Component buildMiscPanel() {
- JPanel miscPanel = new JPanel(new GridLayout(1, 0));
- miscPanel.add(this.buildClearChildrenButton());
- miscPanel.add(this.buildRemoveButton());
- miscPanel.add(this.buildResetButton());
- return miscPanel;
- }
-
- private String getName() {
- return this.nameTextField.getText();
- }
-
- // ********** queries **********
- private TestNode selectedNode() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return (TestNode) this.treeSelectionModel.getSelectionPath().getLastPathComponent();
- }
-
- private TestModel selectedTestModel() {
- if (this.treeSelectionModel.isSelectionEmpty()) {
- return null;
- }
- return this.selectedNode().value();
- }
-
- private TestNode rootNode() {
- return (TestNode) this.treeModel.getRoot();
- }
-
- private TestModel root() {
- return this.rootNode().value();
- }
-
- private Collection<TreePath> expandedPaths() {
- Enumeration<TreePath> stream = this.tree.getExpandedDescendants(new TreePath(this.rootNode()));
- if (stream == null) {
- return Collections.emptyList();
- }
- return CollectionTools.list(new EnumerationIterator<TreePath>(stream));
- }
-
- // ********** behavior **********
- private void setSelectedNode(TestNode selectedNode) {
- this.treeSelectionModel.setSelectionPath(new TreePath(selectedNode.path()));
- }
-
- private void expandPaths(Collection<TreePath> paths) {
- for (TreePath path : paths) {
- this.tree.expandPath(path);
- }
- }
-
- // ********** add **********
- private JButton buildAddButton() {
- return new JButton(this.buildAddAction());
- }
-
- private Action buildAddAction() {
- Action action = new AbstractAction("add") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.addNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * adding causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void addNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- String name = this.getName();
- // save the expansion state and restore it after the add
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.addChild(name);
-
- this.expandPaths(paths);
- this.setSelectedNode(this.selectedNode().childNamed(name));
- }
- }
-
- // ********** remove **********
- private JButton buildRemoveButton() {
- return new JButton(this.buildRemoveAction());
- }
-
- private Action buildRemoveAction() {
- Action action = new AbstractAction("remove") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.removeNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * we need to figure out which node to select after
- * the selected node is deleted
- */
- void removeNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- // do not allow the root to be removed
- if ((selectedTestModel != null) && (selectedTestModel != this.root())) {
- // save the parent and index, so we can select another, nearby, node
- // once the selected node is removed
- TestNode parentNode = (TestNode) this.selectedNode().parent();
- int childIndex = parentNode.indexOfChild(this.selectedNode());
-
- selectedTestModel.getParent().removeChild(selectedTestModel);
-
- int childrenSize = parentNode.childrenSize();
- if (childIndex < childrenSize) {
- // select the child that moved up and replaced the just-deleted child
- this.setSelectedNode((TestNode) parentNode.child(childIndex));
- } else {
- if (childrenSize == 0) {
- // if there are no more children, select the parent
- this.setSelectedNode(parentNode);
- } else {
- // if the child at the bottom of the list was deleted, select the next child up
- this.setSelectedNode((TestNode) parentNode.child(childIndex - 1));
- }
- }
- }
- }
-
- // ********** rename **********
- private JButton buildRenameButton() {
- return new JButton(this.buildRenameAction());
- }
-
- private Action buildRenameAction() {
- Action action = new AbstractAction("rename") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.renameNode();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * renaming causes the tree to be sorted and nodes to be
- * removed and re-added; so we have to fiddle with the expansion state
- */
- void renameNode() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- // save the node and re-select it after the rename
- TestNode selectedNode = this.selectedNode();
- // save the expansion state and restore it after the rename
- Collection<TreePath> paths = this.expandedPaths();
-
- selectedTestModel.setName(this.getName());
-
- this.expandPaths(paths);
- this.setSelectedNode(selectedNode);
- }
- }
-
- // ********** clear children **********
- private JButton buildClearChildrenButton() {
- return new JButton(this.buildClearChildrenAction());
- }
-
- private Action buildClearChildrenAction() {
- Action action = new AbstractAction("clear children") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.clearChildren();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * nothing special, we just want to test #fireCollectionChanged(String)
- */
- void clearChildren() {
- TestModel selectedTestModel = this.selectedTestModel();
- if (selectedTestModel != null) {
- selectedTestModel.clearChildren();
- }
- }
-
- // ********** reset **********
- private JButton buildResetButton() {
- return new JButton(this.buildResetAction());
- }
-
- private Action buildResetAction() {
- Action action = new AbstractAction("reset") {
- public void actionPerformed(ActionEvent event) {
- TreeModelAdapterUITest.this.reset();
- }
- };
- action.setEnabled(true);
- return action;
- }
-
- /**
- * test the adapter's root node holder;
- * toggle between sorted and unsorted lists
- */
- void reset() {
- this.sorted = ! this.sorted;
- if (this.sorted) {
- this.rootNodeHolder.setValue(this.buildSortedRootNode());
- } else {
- this.rootNodeHolder.setValue(this.buildUnsortedRootNode());
- }
- this.tree.expandPath(new TreePath(this.rootNode()));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java
deleted file mode 100644
index 618090bad7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.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.utility.tests.internal.node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-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.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.internal.node.Problem;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-import junit.framework.TestCase;
-
-public class AbstractNodeTests extends TestCase {
- private TestWorkbenchModel root;
-
- public AbstractNodeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.root = this.buildRoot();
- }
-
- private TestWorkbenchModel buildRoot() {
- TestWorkbenchModel r = new RootTestWorkbenchModel("root");
- TestWorkbenchModel node1 = r.addTestChildNamed("node 1");
- TestWorkbenchModel node1_1 = node1.addTestChildNamed("node 1.1");
- node1_1.addTestChildNamed("node 1.1.1");
- node1_1.addTestChildNamed("node 1.1.2");
- node1_1.addTestChildNamed("node 1.1.3");
- node1.addTestChildNamed("node 1.2");
- TestWorkbenchModel node2 = r.addTestChildNamed("node 2");
- node2.addTestChildNamed("node 2.1");
- node2.addTestChildNamed("node 2.2");
- r.addTestChildNamed("node 3");
- r.addTestChildNamed("node 4");
-
- // mark the entire tree clean
- r.markEntireBranchClean();
- return r;
- }
-
- @Override
- protected void tearDown() throws Exception {
- TestTools.clear(this);
- super.tearDown();
- }
-
- public void testTestWorkbenchModel() {
- // make sure our test class works OK...
- assertNull(this.root.testChildNamed(""));
- assertNotNull(this.root.testChildNamed("node 1"));
- assertTrue(this.root.testChildNamed("node 1").isClean());
- assertTrue(this.root.testChildNamed("node 1").isCleanBranch());
- assertNotNull(this.root.testChildNamed("node 2"));
- assertTrue(this.root.testChildNamed("node 2").isClean());
- assertTrue(this.root.testChildNamed("node 2").isCleanBranch());
- assertNull(this.root.testChildNamed("node 2.1"));
-
- assertNull(this.root.testDescendantNamed(""));
- assertNotNull(this.root.testDescendantNamed("node 1"));
- assertNotNull(this.root.testDescendantNamed("node 2"));
- assertNotNull(this.root.testDescendantNamed("node 2.1"));
- assertTrue(this.root.testDescendantNamed("node 2.1").isClean());
- assertTrue(this.root.testDescendantNamed("node 2.1").isCleanBranch());
- assertNotNull(this.root.testDescendantNamed("node 1.1.3"));
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isClean());
- assertTrue(this.root.testDescendantNamed("node 1.1.3").isCleanBranch());
- }
-
- public void testParentAndChildren() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- assertEquals("node 1.1.3", node.getName());
- assertEquals(0, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.parent();
- assertEquals("node 1.1", node.getName());
- assertEquals(3, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.parent();
- assertEquals("node 1", node.getName());
- assertEquals(2, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.parent();
- assertEquals("root", node.getName());
- assertEquals(4, CollectionTools.size(node.children()));
-
- node = (TestWorkbenchModel) node.parent();
- assertNull(node);
- }
-
- public void testDirty() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyUnchangedAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirty());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
-
- this.root.markEntireBranchClean();
- // set size to same number - should stay clean
- node.setSize(42);
- assertTrue(node.isClean());
- assertTrue(parent.isClean());
- assertTrue(this.root.isClean());
- }
-
- public void testDirtyBranch() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
- assertTrue(node.isDirtyBranch());
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirtyBranch());
-
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyParent() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- parent.setSize(77);
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the child, but leave the parent dirty
- node.markEntireBranchClean();
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchCleanChildDirtyChild() {
- TestWorkbenchModel node1 = this.root.testDescendantNamed("node 1.1.1");
- node1.setSize(41);
- TestWorkbenchModel node2 = this.root.testDescendantNamed("node 1.1.2");
- node2.setSize(42);
-
- TestWorkbenchModel parent = (TestWorkbenchModel) node1.parent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
-
- // now, clean the first child, but leave the second child dirty
- node1.markEntireBranchClean();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- }
-
- public void testDirtyBranchForced() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
-
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
-
- this.root.markEntireBranchDirty();
-
- assertTrue(node.isDirty());
- assertTrue(node.isDirtyBranch());
- assertTrue(parent.isDirty());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isDirty());
- assertTrue(this.root.isDirtyBranch());
- }
-
- public void testDirtyTransientAttribute() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- assertTrue(node.isDirty());
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- assertTrue(parent.isClean());
- assertTrue(parent.isDirtyBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isDirtyBranch());
-
- this.root.markEntireBranchClean();
-
- this.root.validateBranch();
-
- assertTrue(this.root.problemsSize() == 0);
- assertTrue(node.branchProblems().hasNext());
- assertTrue(parent.problemsSize() == 0);
- assertTrue(parent.branchProblems().hasNext());
- assertTrue(node.problemsSize() > 0);
-
- // since problems are transient, everything should still be clean
- assertTrue(node.isClean());
- assertTrue(node.isCleanBranch());
- assertTrue(parent.isClean());
- assertTrue(parent.isCleanBranch());
- assertTrue(this.root.isClean());
- assertTrue(this.root.isCleanBranch());
- }
-
- public void testProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
-
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem1 = node.problems().next();
-
- // now create another problem that should remove the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- Problem problem2 = node.problems().next();
- assertFalse(problem1 == problem2);
- problem1 = problem2;
-
- // now create another problem that should replace the old problem
- node.setName("STILL BOGUS");
- this.root.validateBranch();
-
- assertEquals(0, this.root.problemsSize());
- assertTrue(node.branchProblems().hasNext());
- assertEquals(0, parent.problemsSize());
- assertTrue(parent.branchProblems().hasNext());
- assertEquals(1, node.problemsSize());
- problem2 = node.problems().next();
- // the same problem should be there
- assertTrue(problem1.equals(problem2));
- }
-
- public void testBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- node.setName("okie-dokie");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, node.branchProblemsSize());
- }
-
- public void testClearAllBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, this.root.branchProblemsSize());
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, node.branchProblemsSize());
-
- parent.clearAllBranchProblems();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(1, this.root.branchProblemsSize());
- assertEquals(0, parent.problemsSize());
- assertEquals(0, parent.branchProblemsSize());
- assertEquals(0, node.problemsSize());
- assertEquals(0, CollectionTools.size(node.branchProblems()));
- }
-
- public void testRemovedBranchProblems() {
- TestWorkbenchModel node = this.root.testDescendantNamed("node 1.1.3");
- node.setName("BOGUS");
- TestWorkbenchModel parent = (TestWorkbenchModel) node.parent();
- parent.setName("BOGUS TOO");
- this.root.setName("BOGUS TOO TOO");
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(3, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(2, parent.branchProblemsSize());
- assertEquals(1, node.problemsSize());
- assertEquals(1, CollectionTools.size(node.branchProblems()));
-
- // completely remove a node that has problems -
- // the entire tree should recalculate its "branch" problems
- parent.removeTestChild(node);
-
- this.root.validateBranch();
-
- assertEquals(1, this.root.problemsSize());
- assertEquals(2, CollectionTools.size(this.root.branchProblems()));
- assertEquals(1, parent.problemsSize());
- assertEquals(1, parent.branchProblemsSize());
- }
-
- public void testSort() {
- List<TestWorkbenchModel> nodes = this.buildSortedNodes();
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "aaa")));
- assertTrue(new Range(0, 1).includes(this.indexOf(nodes, "AAA")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "bbb")));
- assertTrue(new Range(2, 3).includes(this.indexOf(nodes, "BBB")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "ccc")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "CCC")));
- assertTrue(new Range(4, 6).includes(this.indexOf(nodes, "���")));
- }
-
- private int indexOf(List<TestWorkbenchModel> nodes, String nodeName) {
- for (int i = nodes.size(); i-- > 0; ) {
- if (nodes.get(i).getName().equals(nodeName)) {
- return i;
- }
- }
- throw new IllegalArgumentException();
- }
-
- private List<TestWorkbenchModel> buildSortedNodes() {
- List<TestWorkbenchModel> result = new ArrayList<TestWorkbenchModel>();
- result.add(new RootTestWorkbenchModel("AAA"));
- result.add(new RootTestWorkbenchModel("BBB"));
- result.add(new RootTestWorkbenchModel("CCC"));
- result.add(new RootTestWorkbenchModel("���"));
- result.add(new RootTestWorkbenchModel("ccc"));
- result.add(new RootTestWorkbenchModel("bbb"));
- result.add(new RootTestWorkbenchModel("aaa"));
- return CollectionTools.sort(result);
- }
-
-
- // ********** inner classes **********
-
- private class TestWorkbenchModel extends AbstractNode {
- private String name;
- public static final String NAME_PROPERTY = "name";
- private int size;
- public static final String SIZE_PROPERTY = "size";
- private Collection<TestWorkbenchModel> testChildren;
- public static final String TEST_CHILDREN_COLLECTION = "children";
-
- // ********** construction/initialization **********
- public TestWorkbenchModel(TestWorkbenchModel parent, String name) {
- super(parent);
- if (name == null) {
- throw new NullPointerException();
- }
- this.name = name;
- }
- @Override
- protected void initialize() {
- super.initialize();
- this.size = 0;
- this.testChildren = new HashBag<TestWorkbenchModel>();
- }
-
- @Override
- protected void checkParent(Node parent) {
- // do nothing
- }
-
-
- // ********** accessors **********
- public String getName() {
- return this.name;
- }
- public void setName(String name) {
- Object old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- public int getSize() {
- return this.size;
- }
- public void setSize(int size) {
- int old = this.size;
- this.size = size;
- this.firePropertyChanged(SIZE_PROPERTY, old, size);
- }
-
- public Iterator<TestWorkbenchModel> testChildren() {
- return new CloneIterator<TestWorkbenchModel>(this.testChildren) {
- @Override
- protected void remove(TestWorkbenchModel current) {
- TestWorkbenchModel.this.removeTestChild(current);
- }
- };
- }
- public int testChildrenSize() {
- return this.testChildren.size();
- }
- private TestWorkbenchModel addTestChild(TestWorkbenchModel testChild) {
- this.addItemToCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- return testChild;
- }
- public TestWorkbenchModel addTestChildNamed(String childName) {
- if (this.testChildNamed(childName) != null) {
- throw new IllegalArgumentException(childName);
- }
- return this.addTestChild(new TestWorkbenchModel(this, childName));
- }
- public void removeTestChild(TestWorkbenchModel testChild) {
- this.removeItemFromCollection(testChild, this.testChildren, TEST_CHILDREN_COLLECTION);
- }
-
- // ********** queries **********
- public String displayString() {
- return this.name;
- }
- public TestWorkbenchModel testChildNamed(String childName) {
- for (TestWorkbenchModel testChild : this.testChildren) {
- if (testChild.getName().equals(childName)) {
- return testChild;
- }
- }
- return null;
- }
- public TestWorkbenchModel testDescendantNamed(String descendantName) {
- for (TestWorkbenchModel testDescendant : this.testChildren) {
- if (testDescendant.getName().equals(descendantName)) {
- return testDescendant;
- }
- // recurse...
- testDescendant = testDescendant.testDescendantNamed(descendantName);
- if (testDescendant != null) {
- return testDescendant;
- }
- }
- return null;
- }
-
- // ********** behavior **********
- @Override
- protected void addChildrenTo(List<Node> children) {
- super.addChildrenTo(children);
- children.addAll(this.testChildren);
- }
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- // names must be all lowercase...
- for (int i = this.name.length(); i-- > 0; ) {
- char c = this.name.charAt(i);
- if (Character.isLetter(c) && ! Character.isLowerCase(c)) {
- currentProblems.add(this.buildProblem("NAME_MUST_BE_LOWERCASE", this.name));
- return;
- }
- }
- }
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
- }
-
-
- private class RootTestWorkbenchModel extends TestWorkbenchModel {
- public RootTestWorkbenchModel(String name) {
- super(null, name);
- }
- @Override
- public Validator validator() {
- return Node.NULL_VALIDATOR;
- }
- }
-
-}
-
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java
deleted file mode 100644
index 94f682d878..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.utility.tests.internal.node;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUtilityNodeTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityNodeTests.class.getPackage().getName());
-
- suite.addTestSuite(AbstractNodeTests.class);
-
- return suite;
- }
-
- private JptUtilityNodeTests() {
- super();
- }
-
-}
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 bf3ab7e506..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
+++ /dev/null
@@ -1,40 +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 -->
- <property name="plugin-name" value="org.eclipse.jpt.utility.tests"/>
-
- <!-- 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}"/>
- <property name="extraVMargs" value=""/>
- </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">
- </target>
-</project> \ No newline at end of file

Back to the top